top of page
  • Writer's pictureMichael DeBellis

Creating a Custom Rules View Tab

Updated: Sep 28, 2023

Note: There was a problem with the link to the PDF for the tutorial below. It worked for me because I owned the file but for others since somehow it ended up in the trash, they couldn't see it. So if you tried and couldn't get it, check now and it should work.

One of my regrets about the Revised Protégé Pizza tutorial is that in the section on SWRL I only discussed the SWRLTab. The SWRLTab is excellent but for some use cases the Rules view is superior. E.g., if your ontology uses codes for IRIs the way the ontologies of the OBO foundry do, you definitely should use the Rules view rather than the SWRLTab. However, since it is a view not a tab and it isn't part of any of the standard Protégé tabs it is easy to miss the Rules view. This mini-tutorial will show you how to create your own custom Rules View tab. This will be useful for use cases where you need the Rules view and also will enable you to create your own custom tabs to take advantage of the many Views that are part of Protégé but that aren't included in any of the default tabs.

The problem I chose was to extend the Basic Formal Ontology (BFO) with the interval relations from the Allen Temporal model. BFO provides the foundation for all the Allen relations but doesn't include most of them. My original idea was just to use BFO as an example of the kind of ontology where one could use this SWRL Rules view tab. However, once I started, I realized it wouldn't take much work to add rules for the complete Allen model.

The PDF for the tutorial is at:

The ontology to start the tutorial is the The Basic Formal Ontology with properties added to define the Allen operators but not the rules is at:

The GitHub site for the complete extension of BFO with the Allen properties and rules is:

At the suggestion of Robert Rovetto, I also implemented the rules for the W3C Time Ontology. That has a bit of an issue, because the Time ontology only supports xsd:dateTimeStamp and for some reason SWRL only supports xsd:dateTime I don't understand why they both don't just support them both, I can't see any good reason not to. The odd thing is that for the examples I created SWRL seems to work with the xsd:dateTimeStamps (at least with Pellet) but it doesn't work for the W3C Time ontology test data. So still some bugs but for those interested in the W3C Time ontology here is my github repository for that ontology with SWRL rules to implement the Allen relations: Time Ontology with SWRL rules.

1 kommentar

06 sep. 2023

FYI, the PDF for the tutorial says that it is in your Google Drive trash so it can't be shown. Thanks for the great information!

bottom of page