[Pellet-users] SPARQL Query results

Mudunuri, Raj Raj.Mudunuri at medizin.uni-leipzig.de
Mon Mar 19 09:41:44 UTC 2007


Hi Maarten and Brandon,

Thanx fot the suggestions... the syntax problem was solved and I'm getting the query result... I still have some questions regarding the querying semantics of SPARQL... Ayomi stated that he is getting 5 answers for the query, 

SELECT ?x WHERE { persons:Academic rdfs:subClassOf ?x .}

Whereas I'm getting only the following two answers displayed in the Results panel of SPARQL:

worksAt some University
Person

Why is that so?  

Even for the other query aswell, 

SELECT ?x WHERE { persons:Professor rdfs:subClassOf ?x .}

I'm getting only 1 (Academic), but not 5, answers as the query result...

I guess this query only gives me the direct superclass but not all others like Person, owl:thing etc... Also, I wonder why in the results of both the queries there is 'Employee' included... this is inferred knowledge but not asserted one... so, does Ayomi's query results are derived from inferred concept hierarchy?

for the second query Ayomi stated that the query result included persons:Employee, which is true only in the inferred knowledge but not in the asserted one... 

Thankyou,
Raj



-----Original Message-----
From: m.j.vanderveen at gmail.com [mailto:m.j.vanderveen at gmail.com] On Behalf Of M.J. van der Veen
Sent: Freitag, 16. März 2007 15:31
To: Mudunuri, Raj
Subject: Re: [Pellet-users] SPARQL Query results

Yes it is, you have to add a

PREFIX persons: <http://thecorrecturi#> .

to the query. Make sure you use the correct uri.

Maarten


On 3/15/07, Mudunuri, Raj <Raj.Mudunuri at medizin.uni-leipzig.de> wrote:
> Hi Ayomi,
>
> When I run the same query I get a query parse error that states "Line 8, column 19: Unresolved qname: persons:Academic"
>
> Is this some kind of namespace problem?
>
> Cheers,
> Raj
>
>
>
> -----Original Message-----
> From: pellet-users-bounces at lists.owldl.com [mailto:pellet-users-bounces at lists.owldl.com] On Behalf Of Ayomi Bandara
> Sent: Dienstag, 13. März 2007 19:46
> To: pellet-users at lists.owldl.com
> Subject: [Pellet-users] SPARQL Query results
>
> Hello,
>
> I am trying to use SPARQL to obtain information related to certain concepts
> in an ontology. Specifically I need to to get the information about
> existential (owl:someValuesFrom) restrictions on certain concepts. But I have
> noticed that SPARQL will return only asserted knowledge regarding these
> restrictions, it will not show the restrictions inherited from its super
> classes. For example in the attached example ontology, the class "Academic"
> is defined to have someValuesFrom  restriction on the property, "worksAt".
> The "Professor" being a subclass of the "Academic" class inherits this
> condition.
>
> When I run the following SPARQL query to get the super classes of
> the  "Academic" class, the SomeValuesFrom restriction is returned as one of
> its super classes. But the same query for its subclass "Professor" does not
> return this condition.
>
> SELECT ?x WHERE { persons:Academic rdfs:subClassOf ?x .}
> -----------------------------------------------------
> Query Results (5 answers):
> x
> ===============================================================
> owl:Thing
> persons:Person
> persons:Employee
> persons:Academic
> restriction(persons:worksAt someValuesFrom(persons:University))
>
>
> SELECT ?x WHERE { persons:Professor rdfs:subClassOf ?x .}
> -----------------------------------------------------
> Query Results (5 answers):
> x
> =================
> persons:Academic
> owl:Thing
> persons:Person
> persons:Employee
> persons:Professor
>
> However I have realised that SPARQL does sometimes return results that
> include inferred knowledge.
> For example when I raise the following query (for subclasses of "Employee")
> with the attached ontology as the input file:
> SELECT ?x WHERE { ?x rdfs:subClassOf  persons:Employee}
>
> the query results include the inferred subclass "Academic" as well, although
> it is not asserted in the ontology.
>
>
> So my questions are:
>
> Is this because SPARQL can support only certain types of inferred knowledge?
> Is it defined anywhere, what type of inferences are supported in SPARQL?
>
> Is there any other trick or method that I can use to access such inferred
> knowledge (specifically the inherited conditions of owl:SomeValuesFrom
> restrictions) through SPARQL?
>
> Please can someone help me on these?
>
> Thanks a lot in advance,
> Ayomi.
>
> _______________________________________________
> 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