Querying superproperties

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Querying superproperties

Kamran Soomro
Hi,

I have an ontology that defines two object properties:

has-father subPropertyOf has-parent

and two individuals child and father related by:

child has-father father

Now I ran the HermiT reasoner on it, and it correctly infers the relation:

child has-parent father

However, I am trying to run a SPARQL query that tells me whether child has a parent. The query is given below:

PREFIX t: <http://test#>

SELECT ?child ?father WHERE {
?child t:has-parent ?father

}

This query _does not_ give me {child, father} as is expected. If I change the queried relationship to to t:has-father, I get the correct result. Is there some additional configuration I have to do to make the SPARQL query work? Thanks.

--Kamran


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Querying superproperties

Lorenz Buehmann
How do you run the SPARQL query in Protege 4? Anyway, for what you want reasoning has to be enabled somehow.

Lorenz
On 20.08.2012 12:50, Kamran Soomro wrote:
Hi,

I have an ontology that defines two object properties:

has-father subPropertyOf has-parent

and two individuals child and father related by:

child has-father father

Now I ran the HermiT reasoner on it, and it correctly infers the relation:

child has-parent father

However, I am trying to run a SPARQL query that tells me whether child has a parent. The query is given below:

PREFIX t: <http://test#>

SELECT ?child ?father WHERE {
?child t:has-parent ?father

}

This query _does not_ give me {child, father} as is expected. If I change the queried relationship to to t:has-father, I get the correct result. Is there some additional configuration I have to do to make the SPARQL query work? Thanks.

--Kamran



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Querying superproperties

Kamran Soomro
There's a SPARQL query tab in 4.2 that I use to run the query. How do I enable the reasoning?

—Kamran

On 20 Aug 2012, at 11:54, "Lorenz Bühmann" <[hidden email]> wrote:

How do you run the SPARQL query in Protege 4? Anyway, for what you want reasoning has to be enabled somehow.

Lorenz
On 20.08.2012 12:50, Kamran Soomro wrote:
Hi,

I have an ontology that defines two object properties:

has-father subPropertyOf has-parent

and two individuals child and father related by:

child has-father father

Now I ran the HermiT reasoner on it, and it correctly infers the relation:

child has-parent father

However, I am trying to run a SPARQL query that tells me whether child has a parent. The query is given below:

PREFIX t: <http://test#>

SELECT ?child ?father WHERE {
?child t:has-parent ?father

}

This query _does not_ give me {child, father} as is expected. If I change the queried relationship to to t:has-father, I get the correct result. Is there some additional configuration I have to do to make the SPARQL query work? Thanks.

--Kamran



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Querying superproperties

Timothy Redmond
In reply to this post by Kamran Soomro

This is, in my opinion, a major defect in the current SPARQL query tab.   It only queries the asserted information.  There is a SPARQL query plugin that understands inference [1] and there should be another SPARQL query tool out sometime soon.

-Timothy

[1] http://krizik.felk.cvut.cz/km/owl2query/


On 08/20/2012 03:50 AM, Kamran Soomro wrote:
Hi,

I have an ontology that defines two object properties:

has-father subPropertyOf has-parent

and two individuals child and father related by:

child has-father father

Now I ran the HermiT reasoner on it, and it correctly infers the relation:

child has-parent father

However, I am trying to run a SPARQL query that tells me whether child has a parent. The query is given below:

PREFIX t: <http://test#>

SELECT ?child ?father WHERE {
?child t:has-parent ?father

}

This query _does not_ give me {child, father} as is expected. If I change the queried relationship to to t:has-father, I get the correct result. Is there some additional configuration I have to do to make the SPARQL query work? Thanks.

--Kamran



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback
Reply | Threaded
Open this post in threaded view
|

Re: Querying superproperties

Kamran Soomro
Awesome! Thanks!

--Kamran

On 20 Aug 2012, at 16:20, Timothy Redmond <[hidden email]>
 wrote:


This is, in my opinion, a major defect in the current SPARQL query tab.   It only queries the asserted information.  There is a SPARQL query plugin that understands inference [1] and there should be another SPARQL query tool out sometime soon.

-Timothy

[1] http://krizik.felk.cvut.cz/km/owl2query/


On 08/20/2012 03:50 AM, Kamran Soomro wrote:
Hi,

I have an ontology that defines two object properties:

has-father subPropertyOf has-parent

and two individuals child and father related by:

child has-father father

Now I ran the HermiT reasoner on it, and it correctly infers the relation:

child has-parent father

However, I am trying to run a SPARQL query that tells me whether child has a parent. The query is given below:

PREFIX t: <http://test#>

SELECT ?child ?father WHERE {
?child t:has-parent ?father

}

This query _does not_ give me {child, father} as is expected. If I change the queried relationship to to t:has-father, I get the correct result. Is there some additional configuration I have to do to make the SPARQL query work? Thanks.

--Kamran



_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback

_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback


_______________________________________________
p4-feedback mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/p4-feedback