67 
 
Figure 9.1 The DL Query Tab 
 
9.2 SPARQL Queries 
SPARQL is a powerful language, and one could write a whole book about it. In fact, there are books 
written about it. The best one I have seen is the O’Reilly book Learning SPARQL by Bob DuCharme. 
This is an excellent book that not only goes into SPARQL but into topics such as RDF/RDFS and how 
triples are used to represent all information in OWL. I will only touch on those issues here, there is much 
more to say about them and DuCharme’s book is a great place to learn more. If some of the following is a 
bit hard to understand don’t be discouraged. This is just an attempt to give a very high level introduction 
to something that requires significant study to really understand.  
Essentially SPARQL is to the Semantic Web and Knowledge Graphs as SQL is to relational databases. 
Just as SQL can do more than just query, it can also assert new information into a database, so SPARQL 
can as well. The current SPARQL plugins for Protégé are somewhat limited and don’t support the 
statements such as INSERT for entering new data so we will just cover the basics of using SPARQL as a 
query language but keep in mind there is a lot more to it than what we briefly cover here.  
9.21 Some SPARQL Pizza Queries 
To start with go to the SPARQL Query tab. If it isn’t already there you can as always add it using 
Window>Tabs>SPARQL Query.  This tab consists of two views, the top which holds the query and the 
bottom which holds the results. There should be some text already there. It may look confusing, but we’ll 
explain it. Just to start with hit the Execute button at the bottom of the tab. You should see a bunch of 
classes and class expressions returned.