[Pellet-users] Bnodes in SPARQL queries
Evren Sirin
evren at clarkparsia.com
Wed Jan 16 13:29:25 UTC 2008
Hi Arthur,
Currently Pellet query engine only supports ABox queries [1] and the
second query you have is not an ABox query (there is a variable in the
predicate position). For non-ABox queries we fall back to Jena query
engine and the bnodes are not treated as true non-distinguished
variables anymore (and that's why you don't get the answers you expect).
You query fits into what we call SPARQL-DL [2]. C&P intern Petr have
implemented a SPARQL-DL engine in Pellet and have very informative blogs
about it [3]. The SPARQL-DL engine is not available to use yet but we'll
include it in the next release of Pellet.
Cheers,
Evren
[1] http://pellet.owldl.com/faq/what-is-an-abox-query/
[2] http://clarkparsia.com/files/pdf/sparqldl.pdf
[3] http://clarkparsia.com/weblog/category/sparql/
On 1/10/08 1:22 PM, Arthur Peters wrote:
> I am experimenting with using an OWL ontology to infer information
> about instances based on a set of class membership assertion. I also
> want to be able to get information about instances that can be
> inferred to exist based on these class memberships.
>
> I created a small test OWL (Attached) and I've been running queries on
> it using Pellet and I'm not getting exactly what I expect. It probably
> some silly mistake on my part in the OWL or the query (and if so sorry
> for bugging you, I know this is a pellet list not an OWL help list).
>
> $ bash pellet.sh -if /home/amp/tmp/categories_test.owl -s level -qs
> "PREFIX : <http://www.owl-ontologies.com/Ontology1199984147.owl#>
> SELECT * WHERE { ?a a :Obj . ?a ?p ?y }"
> Input file: file:/home/amp/tmp/categories_test.owl
> OWL Species: DL
> DL Expressivity: ALCN(D)
> Consistent: Yes
> Time: 725 ms (Loading: 632 Species Validation: 29 Consistency: 13 )
>
> Query:
> PREFIX : <http://www.owl-ontologies.com/Ontology1199984147.owl#>
> SELECT * WHERE { ?a a :Obj . ?a ?p ?y }
> -----------------------------------------------------
> Query Results (6 answers):
> a | p | y
> =========================================================================================================
> ontology1199984147:InstanceOfObj | ontology1199984147:data |
> "1"^^xsd:int
> ontology1199984147:InstanceOfObj | rdf:type |
> ontology1199984147:HasRelationWith2Relations
> ontology1199984147:InstanceOfObj | rdf:type | owl:Thing
> ontology1199984147:InstanceOfObj | rdf:type |
> ontology1199984147:Has1Relation
> ontology1199984147:InstanceOfObj | rdf:type |
> ontology1199984147:Obj
> ontology1199984147:InstanceOfObj | owl:sameAs |
> ontology1199984147:InstanceOfObj
>
> So far so good. Now try to get information about an instance that is
> only inferred to exist:
>
> $ bash pellet.sh -if /home/amp/tmp/categories_test.owl -s level -qs
> "PREFIX : <http://www.owl-ontologies.com/Ontology1199984147.owl#>
> SELECT * WHERE { ?a a :Obj . ?a :related _:x . _:x ?p ?y }"
> Input file: file:/home/amp/tmp/categories_test.owl
> OWL Species: DL
> DL Expressivity: ALCN(D)
> Consistent: Yes
> Time: 748 ms (Loading: 652 Species Validation: 30 Consistency: 14 )
>
> Query:
> PREFIX : <http://www.owl-ontologies.com/Ontology1199984147.owl#>
> SELECT * WHERE { ?a a :Obj . ?a :related _:x . _:x ?p ?y }
> -----------------------------------------------------
> Query Results (0 answers):
> NO RESULTS
>
> No dice. I should at least get a type for _:x.
>
> Any advise or pointers to resources that cover this type of thing?
>
> Thanks for your time.
> -Arthur
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Pellet-users mailing list
> Pellet-users at lists.owldl.com
> http://lists.owldl.com/mailman/listinfo/pellet-users
> _______________________________________________
>
> Sponsored by Clark & Parsia, LLC http://clarkparsia.com/
More information about the Pellet-users
mailing list