top of page

New Protégé Pizza Tutorial

Writer's picture: Michael DeBellisMichael DeBellis

Updated: Sep 11, 2023

I've written a new version of the Pizza Tutorial for Protégé . The long version of the Pizza tutorial has had minor inconsistencies with the latest Protégé UI for quite some time. The differences were fairly trivial but since a tutorial should be as clear as possible they could make things difficult for some users, especially those not already familiar with object-oriented modeling. I've addressed those differences I've also made many changes based on the kinds of issues I've seen new users grapple with. Finally, I've added new sections for tools like SWRL, SPARQL, and SHACL.


Note: Today (10/8/2021) I've replaced the previous version with a newer version, version 3.2 This version has some minor corrections based on feedback from various users.


The latest tutorial can be found here: https://tinyurl.com/NewPizzaTutorialV3-2 There is also a link in the tutorial to the following file: https://tinyurl.com/PizzaWDataV2 This is a solution to the initial tutorial development and also has some additional individuals and data properties which can be used to test the new parts of the tutorial that deal with SWRL, SPARQL, and SHACL.


I've also added a new tutorial ontology and guide in a recent post: The People_Ontology. This ontology is an addendum for an article I'm writing that hasn't been published yet. It has some overlap with the Pizza tutorial but also some new work such as more detail on properties and a Linked Data SPARQL query developed with the help of Franz Inc.


A new addition: see this blog post for information about a YouTube playlist for Protégé users created by Xiaoqi Zhao


As various users have used the tutorial, they've discovered some errors. I'm going to release a new version of the tutorial fairly soon, I think by the end of this year (2023) but in the mean time, here are some issues you should be aware of regarding the current version. Special thanks to Xiaoqi Zhao who found most of these:


8/29/2023 Edit: Two updates:

1) I think I put this in the tutorial somewhere but if I did, it is something that people often miss: If you don't see the appropriate inferences, especially in the SWRL section make sure you have loaded the Pellet reasoner plugin and make sure you do Reasoner>Configure and check all the boxes. By default many of them are not checked because for large ontologies they can make the reasoner slow but for the tutorial and most ontologies created by new users reasoner performance is just fine with all possible inferencing turned on. IMO, it is good to start with that so you can see the full power of the reasoner, then scale it back if and whey you get into medium (thousands of entities) to large (millions of triples) ontologies where performance may become an issue. Thanks to Xiaoqi Zhao for pointing this out.


2) In this tutorial and my older SWRL tutorial I only mention using the SWRLTab. The SWRLTab is great for many use cases but it only can reference entities by their IRIs. For ontologies such as those in the OBO foundry that have codes for IRIs you need the Rules view. In a recent post, I've created a mini-tutorial on how to setup your own custom Rules Tab for editing SWRL rules with the Rules view. I hope this will be helpful both for those who need to edit rules by their rdfs:label as well as an example of how you can create your own custom tabs with any arbitrary combination of Views you find useful. The new mini-tutorial is at: https://www.michaeldebellis.com/post/creating-a-rules-view-tab


9/7/2023 Edit: In the tutorial there is a link to Top Quadrant's site for their SHACL demo. They did a reorganization of their site a while ago and that link is stale. Instead use this as the link


9/11/2023 Edit: In Protégé 5.5 and later there is currently a bug where the SPARQL Tab won't work if you launch it after you load an ontology (i.e., it's pretty useless until that bug is fixed). There is a simple work around which is to use the Snap SPARQL plugin. I prefer Snap SPARQL anyway because you can add new data with Snap SPARQL (using CONSTRUCT) but you can't with the SPARQL Tab. However, there is a bug in Snap SPARQL where queries with A wildcard in the predicate position won't work. I have one such query in the tutorial:

SELECT *
WHERE { ?customer a pizza:Customer.
?customer ?relation ?relatedToCustomer.}

Because this has a wildcard in the predicate (?relation) this query won't work in Snap SPARQL.

30,005 views18 comments

18 Comments


consultancy
Jan 12

Great tutorial Mike!


Often tutorials fall short of being complete and accurate, this one appears not to. I will use it when introducing people to ontology design.


With regards to restrictions, I would like to suggest including a thought on closing axioms: there is no need to include the lowest level subClass and it might make sense not to.


In the Pizza tutorial V3.2 # 4.1.3, to make both VegetarianPizza and CheesyPizza work, it suffices to close the SohoPizza axiom with

  • "hasTopping only (CheeseTopping or VegetableTopping)"

    rather than your tutorial stating

  • "hasTopping only (MozarellaTopping or OliveTopping or ParmesanTopping or TomatoTopping)"


So "Pizza and (hasTopping only (VegetableTopping or CheeseTopping))" fits "hasTopping only (CheeseTopping or VegetableTopping)".


Whereas I know protege can autocomplete…


Edited
Like

Guest
Jun 27, 2023

Thanks for the great work and the new tutorial document. Maybe it is possible to get a version of the document without highlights? I could not delete them to learn and make my own comments and highlighting.

Like
Michael DeBellis
Michael DeBellis
Sep 28, 2023
Replying to

I've thought about putting the Word document on Github. The reason I don't is that it is really easy to add Malware to MS Office documents and I'm a bit worried someone might do that and then people would download the document. I'm probably being paranoid but I prefer being a little paranoid when it comes to security. But if you email me (my email is in the document) I can send you the Word document and you can edit it as you wish as long as you abide by the Open Source licensing.

Like

Guest
Jun 22, 2023

The lastest version of Protoge (5.6.1) has a bug that prevents the SPARQL Query tab from functioning properly. Broken when using with Protege 5.6.1 · Issue #12 · protegeproject/rdf-library · GitHub


To work around this issue download Protoge 5.5.0. Release Protégé 5.5.0 · protegeproject/protege-distribution · GitHub

Like

Guest
May 25, 2023

THank you for your work! Wonderful!

Like

Ya Wen
Ya Wen
May 22, 2023

Hi Michael,


thanks a lot!it helps me with the owl journey.


but i got a lot problem. when I new one ontology, and open the 'SPARQL' tab, it works fine. but when I open one existing ontology i created, and then open the 'SPARQL' tab, the interface shows nothing. it is empty, no text and no 'execute' button. may I ask how can i fix it?

Like
Michael DeBellis
Michael DeBellis
May 22, 2023
Replying to

Unfortunately, this is just a known bug with the current version (5.6) of Protege. There is no fix as far as I know for the standard SPARQL tab. The way you can get around this is to use the Snap SPARQL plugin.

If you do File>Check for plugins you will see a long list of plugins (tools that work with Protege but that by default aren't loaded). Snap SPARQL should be in that list. Or if it isn't in that list that means it is probably already loaded in your version of Protege. Click on the Install box in the check for plugins screen next to Snap SPARQL and click OK. You should get a message that says somethin…


Like
bottom of page