Search Mailing List Archives
[protege-owl] online SPARQL query tool
james at howison.name
Sun Mar 29 08:35:10 PDT 2009
On 28 Mar 2009, at 5:35 PM, babar shahzad wrote:
> thanX a lot Tania for your such brief answer.
> OK, my other question is about can you kindly tell me about some
> framework that uses SPARQL as query language, have some good
> documentation & examples too; preferably.
>> SPARQL will give you the asserted statements, and not the inferred
>> (at least the Protege implementation).
> But ' Semantic web for working ontologist ' by Jim Hendler et all
> states .....
> shop: Henleys rdfs:subClassOf shop:Shirts .
> shop: ChamoisHenleys rdf:type shop:Henleys .
> Suppose we have a SPARQL triple pattern that we use to examine these
> triples. Thus:
> ?x rdf:type shop:Shirts.
> type propagation rule: the following single result will be returned:
> ?x = shop:ChamoisHenleys
This is true if you are working with an ontology that has been
'realized' by an OWL (or RDFS) reasoner. I think of the reasoner
sitting between the query and the asserted statements, so that when
you query, you get answers based on the 'full set', asserted +
What Tania is saying is that the SPARQL tab in Protege works only
against the asserted statements, the reasoner is not consulted, so
results that rely on inferred statements are not returned.
As they say, you may have more luck with the SQWRL or DL-Query tabs,
but you can also do this in SPARQL, but only stepping outside
Protege. For example using the Jena framework and an OntModel with an
appropriate reasoner spec. Making SPARQL queries against that will
produce the results you expect above.
I understand the difficulties of using SPARQL for some types of
queries, particularly complex queries about the tbox (i.e. finding
certain types of restrictions etc), I have no problems using SPARQL
for simpler queries for statements about individuals (including their
properties). The key is to look at your data, preferably after
reasoning, in Turtle format.
I'm not sure whether/how one programatically uses SQWRL or DL-query
queries, but I believe it is possible.
I guess my point is that, for SPARQL at least, the issue of a reasoner
is separate from the query language. ie. SPARQL can be used with or
without a reasoner, I think that SQWRL and DL-query always involve a
More information about the protege-owl