A problem with result binding for query on URL with reasoning=DL

1 view
Skip to first unread message

YU Fan

unread,
May 21, 2012, 5:29:51 PM5/21/12
to sta...@clarkparsia.com
Hi, all
   When trying stardog0.95 with the sample rdf about Unversity created as testdb, using stardog-shell, below log got. 
    It seems like  the result set binding is not correct for query, after invoking owl reasoning.
Fan YU



Executing Query:

select distinct ?s ?p where{?s ?p <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#FullProfessor>} limit 10

+-------+-------+
|   s   |   p   |
+-------+-------+
+-------+-------+

Query returned 0 results in 00:00:00.105

> query -c "http://localhost:5822/testdb" -q "select distinct ?s ?p where{?s ?p <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#FullProfessor>} limit 10"
Executing Query:

select distinct ?s ?p where{?s ?p <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#FullProfessor>} limit 10

+-------------------------------------------------------+-------------------------------------------------+
|                           s                           |                        p                        |
+-------------------------------------------------------+-------------------------------------------------+
+-------------------------------------------------------+-------------------------------------------------+

Query returned 10 results in 00:00:00.063

Mike Grove

unread,
May 21, 2012, 5:35:34 PM5/21/12
to YU Fan, sta...@clarkparsia.com
I encourage you to read the documentation on Stardog's reasoning
support [1], the salient point being that DL reasoning is supported
for TBox queries only. ABox information is not visible to the DL
reasoner in Stardog, which is why you do not get any results for the
provided query.

If you require reasoning over the ABox, you should select one of the
profiles, or restrict your queries to the TBox only.

Cheers,

Mike

[1] http://stardog.com/docs/owl2/
> --
> You received this message because you are subscribed to the C&P "Stardog"
> group.
> To post to this group, send email to sta...@clarkparsia.com
> To unsubscribe from this group, send email to
> stardog+u...@clarkparsia.com
> For more options, visit this group at
> http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

YU Fan

unread,
May 22, 2012, 10:45:59 AM5/22/12
to sta...@clarkparsia.com
I tried another RDF file, and reasoning with DL and QL, the result set is listed below.
What I am trying to do is to explicitly state;
 aa owl:sameAs bb, 
 bb a B, 
 bb someProperty cc 

wish to get:
aa a B  
aa someProperty cc .

Can anyone  give me a hint?

 query -c "http://localhost:5822/classicInfer;reasoning=DL" -q "select distinct ?p ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> ?p ?o} limit 20" 
Executing Query:

select distinct ?p ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> ?p ?o} limit 20

+--------------------------------------------+--------------------------------------------------------------------+
|                     p                      |                                 o                                  |
+--------------------------------------------+--------------------------------------------------------------------+
| http://www.w3.org/2000/01/rdf-schema#label | "order_briefs #10103"                                              |
| http://www.w3.org/2000/01/rdf-schema#label | http://localhost/vocab/order_briefs                                |
| http://www.w3.org/2000/01/rdf-schema#label | "Shipped"                                                          |
| http://www.w3.org/2000/01/rdf-schema#label | 10103                                                              |
| http://www.w3.org/2000/01/rdf-schema#label | file:///H:/p/d2rq-0.8/classic_a.n3#customers/121                   |
| http://www.w3.org/2000/01/rdf-schema#label | file:///H:/p/d2rq-0.8/classic_b.n3#orders/10103                    |
+--------------------------------------------+--------------------------------------------------------------------+

Query returned 9 results in 00:00:00.055
> query -c "http://localhost:5822/classicInfer;reasoning=QL" -q "select distinct ?p ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> ?p ?o} limit 20" 
Executing Query:

select distinct ?p ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> ?p ?o} limit 20

+--------------------------------------------+--------------------------------------------------------------------+
|                     p                      |                                 o                                  |
+--------------------------------------------+--------------------------------------------------------------------+
| http://www.w3.org/2000/01/rdf-schema#label | "order_briefs #10103"                                              |
| http://www.w3.org/2000/01/rdf-schema#label | http://localhost/vocab/order_briefs                                |
| http://www.w3.org/2000/01/rdf-schema#label | "Shipped"                                                          |
| http://www.w3.org/2000/01/rdf-schema#label | 10103                                                              |
| http://www.w3.org/2000/01/rdf-schema#label | file:///H:/p/d2rq-0.8/classic_a.n3#customers/121                   |
| http://www.w3.org/2000/01/rdf-schema#label | file:///H:/p/d2rq-0.8/classic_b.n3#orders/10103                    |
+--------------------------------------------+--------------------------------------------------------------------+

Query returned 9 results in 00:00:00.053
> export -c "http://localhost:5822/classicInfer" ../file.n3
Exported 1,947 triples in N3 format to file 'file.n3'.


On Mon, May 21, 2012 at 6:22 PM, YU Fan <yufa...@gmail.com> wrote:
Hi, Mike, 
   1) If we use sparql query with reasoning=DL, will get no result on all those explicit ABox facts?
   2) I Tried reasoning=QL , still no result on ABox query. See logs below. 

   query -c "http://localhost:5822/testdb;reasoning=QL" -q "select distinct  ?p ?o where{<http://www.Department0.University0.edu/FullProfessor0> ?p ?o} limit 10"
Executing Query:

select distinct  ?p ?o where{<http://www.Department0.University0.edu/FullProfessor0> ?p ?o} limit 10

+-------+-------+
|   p   |   o   |
+-------+-------+
+-------+-------+

Query returned 0 results in 00:00:00.068

> query -c "http://localhost:5822/testdb;reasoning=QL" -q "select distinct ?s ?p ?o where{?s ?p ?o} limit 10"
Executing Query:

select distinct ?s ?p ?o where{?s ?p ?o} limit 10

+-------------------------------------------------------+------------------------------------------------------------------------+--------------------------------------------------------------------+
|                           s                           |                                   p                                    |                                 o                                  |
+-------------------------------------------------------+------------------------------------------------------------------------+--------------------------------------------------------------------+
| http://stardog.clarkparsia.com/                       | http://www.w3.org/1999/02/22-rdf-syntax-ns#type                        | http://www.w3.org/2002/07/owl#Ontology                             |
| http://stardog.clarkparsia.com/                       | http://www.w3.org/2002/07/owl#imports                                  | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl               |
| http://www.University0.edu                            | http://www.w3.org/1999/02/22-rdf-syntax-ns#type                        | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#University    |
| http://www.University0.edu                            | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#name              | "University0"                                                      |
| http://www.Department0.University0.edu                | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#name              | "Department0"                                                      |
| http://www.Department0.University0.edu                | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#subOrganizationOf | http://www.University0.edu                                         |
| http://www.Department0.University0.edu/FullProfessor0 | http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#name              | "FullProfessor0"                                                   |
+-------------------------------------------------------+------------------------------------------------------------------------+--------------------------------------------------------------------+

Query returned 10 results in 00:00:00.093

By the way, it is hard to find how to use stardog with reasoning,  i can only find those steps by searching in stardog group.

Thanks for reply.

Fan YU
file.n3

Mike Grove

unread,
May 22, 2012, 10:56:12 AM5/22/12
to YU Fan, sta...@clarkparsia.com
On Tue, May 22, 2012 at 10:45 AM, YU Fan <yufa...@gmail.com> wrote:
> I tried another RDF file, and reasoning with DL and QL, the result set is
> listed below.
> What I am trying to do is to explicitly state;
>  aa owl:sameAs bb,
>  bb a B,
>  bb someProperty cc
>
> wish to get:
> aa a B
> aa someProperty cc .
>
> Can anyone  give me a hint?

Stardog does not yet support equality reasoning.

I again suggest you review the documentation [1] on Stardog's
reasoning support to learn what's supported and how it works.

YU Fan

unread,
May 22, 2012, 11:23:07 AM5/22/12
to Mike Grove, sta...@clarkparsia.com
On Tue, May 22, 2012 at 10:56 AM, Mike Grove <mi...@clarkparsia.com> wrote:
On Tue, May 22, 2012 at 10:45 AM, YU Fan <yufa...@gmail.com> wrote:
> I tried another RDF file, and reasoning with DL and QL, the result set is
> listed below.
> What I am trying to do is to explicitly state;
>  aa owl:sameAs bb,
>  bb a B,
>  bb someProperty cc
>
> wish to get:
> aa a B
> aa someProperty cc .
>
> Can anyone  give me a hint?

Stardog does not yet support equality reasoning.

I again suggest you review the documentation [1] on Stardog's
reasoning support to learn what's supported and how it works.

On documentation[1] :
" Equality reasoning. Only explicit owl:sameAs and owl:differentFrom Data assertions will be taken into account for query answering. "
According to my understanding, equality reasoning has such a known issue that only explicit equality is supported now.  
But, in fact, it has no equality reasoning support at all?

Mike Grove

unread,
May 22, 2012, 1:26:07 PM5/22/12
to YU Fan, sta...@clarkparsia.com
On Tue, May 22, 2012 at 11:23 AM, YU Fan <yufa...@gmail.com> wrote:
>
>
> On Tue, May 22, 2012 at 10:56 AM, Mike Grove <mi...@clarkparsia.com> wrote:
>>
>> On Tue, May 22, 2012 at 10:45 AM, YU Fan <yufa...@gmail.com> wrote:
>> > I tried another RDF file, and reasoning with DL and QL, the result set
>> > is
>> > listed below.
>> > What I am trying to do is to explicitly state;
>> >  aa owl:sameAs bb,
>> >  bb a B,
>> >  bb someProperty cc
>> >
>> > wish to get:
>> > aa a B
>> > aa someProperty cc .
>> >
>> > Can anyone  give me a hint?
>>
>> Stardog does not yet support equality reasoning.
>>
>> I again suggest you review the documentation [1] on Stardog's
>> reasoning support to learn what's supported and how it works.
>
>
> On documentation[1] :
> " Equality reasoning. Only explicit owl:sameAs and owl:differentFrom Data
> assertions will be taken into account for query answering. "
> According to my understanding, equality reasoning has such a known issue
> that only explicit equality is supported now.
> But, in fact, it has no equality reasoning support at all?
>

Your example using DL will not work because explicit sameAs assertions
are in the ABox and not visible to the DL reasoner. The example using
QL does not work as you expect because QL does not include sameAs. If
you use EL or RL, you'll get the behavior you're expecting. You might
want to refer to [1] for information about the various OWL profiles.

Cheers,

Mike

[1] http://www.w3.org/TR/owl2-profiles/

YU Fan

unread,
May 22, 2012, 2:28:57 PM5/22/12
to Mike Grove, sta...@clarkparsia.com
Yes, it is true that

A a owl:Class
B a owl:Class
A owl:sameAs B
aa a A

stardog0.9.5 with reasoning=DL can get 
aa a B

thanks.

$ ./stardog query -c "http://localhost:5822/classicInfer;reasoning=DL" -q "select distinct ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o} limit 50"

This build of Stardog will expire in 26 days.

Executing Query:

 

select distinct ?o where {<file:///H:/p/d2rq-0.8/classic_a.n3#order_briefs/10103> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?o} limit 50

 

+-------------------------------------+

|                  o                  |

+-------------------------------------+

| http://localhost/vocab/orders       |

| http://www.w3.org/2002/07/owl#Thing |

| http://localhost/vocab/order_briefs |

+-------------------------------------+

 

Query returned 3 results in 00:00:00.545

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages