Contradictory Results in Stardog?

1 view
Skip to first unread message

Matías Parodi

unread,
Oct 29, 2013, 7:59:40 PM10/29/13
to
I've written an example to show you an error I'm having in Stardog.

I uploaded into the database mydb this ontology:

@prefix ont:     <http://mydb.com/ont#>.
ont:Video
    rdf:type owl:Class;
.
ont:Fragment
    rdf:type owl:Class;
.
ont:hasFragment
    rdf:type owl:ObjectProperty;
    rdfs:range ont:Fragment;
.

And a couple of triples:

@prefix ont:     <http://mydb.com/ont#>.
@prefix dat:     <http://mydb.com/data#>.
dat:v1 a ont:Video.
dat:v1 ont:hasFragment ont:Fragment.

Then I execute these two queries, but the results seem to be contradictory, even when I'm using the same reasoner:

$ ./stardog query "mydb;reasoning=SL" "select distinct ?s where { ?s a <http://mydb.com/ont#Fragment>. }"
+------------------------------+
|              s               |
+------------------------------+
| http://mydb.com/ont#Fragment |
+------------------------------+
Query returned 1 results in 00:00:00.095
$ ./stardog query "mydb;reasoning=SL" "select distinct ?type where { ?s a ?type. }"                         
+---------------------------+
|           type            |
+---------------------------+
| http://mydb.com/ont#Video |
| owl:Class                 |
| owl:ObjectProperty        |
+---------------------------+

What am I missing?

Additionally to this problem I found that *sometimes* (not always) when I change the reasoner it crashes with the following error:

$ ./stardog query "mydb;reasoning=RDFS" "select distinct ?type where { ?s a ?type. }"
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger warn
WARNING: Selector.select() returned prematurely 512 times in a row; rebuilding selector.
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger info
INFO: Migrated 1 channel(s) to the new Selector.
com.complexible.stardog.StardogException

By the way, I've noticed that the "DL" reasoner is not being offered on the Web interface, why is that?

Thank you,
Matt

Héctor Pérez-Urbina

unread,
Oct 30, 2013, 9:02:32 AM10/30/13
to stardog
Hi,


There's a couple of things going on here. First, your query is ambiguous in the sense that it's not clear to what types of things ?s and ?type should bind. We try our best to determine the var types; however, in this case, the variable ?s could bind to individuals (which seems to be what you want), but it could also bind to classes and properties. You could add typing information to the query in order to be clear as to what you want:

select distinct ?type where { ?s a ?type ; a owl:NamedIndividual . }

At the moment, whenever we can't determine variable types we punt reasoning (there should be a notice in the log) and we query the RDF as is. This is why you got those results.

Now, notice that according to your RDF, <http://mydb.com/ont#Fragment> is both a class (due to the range axiom) and an individual (due to the property assertion). This is called punning [1], which at the moment we don't support for this type of query. Is punning very important in your domain? If not, you could simply rename either the class or the individual <http://mydb.com/ont#Fragment>.
 

Additionally to this problem I found that *sometimes* (not always) when I change the reasoner it crashes with the following error:

$ ./stardog query "mydb;reasoning=RDFS" "select distinct ?type where { ?s a ?type. }"
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger warn
WARNING: Selector.select() returned prematurely 512 times in a row; rebuilding selector.
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger info
INFO: Migrated 1 channel(s) to the new Selector.
com.complexible.stardog.StardogException

This is strange. I created a little test case that runs this 100 times and found no error. I'll try to reproduce it on the CLI.
 

By the way, I've noticed that the "DL" reasoner is not being offered on the Web interface, why is that?

The short answer is that DL is complete for TBox queries [2] only, so we thought it might confuse/annoy people if we had it there. We might change our minds about this.
 

Thank you,
Matt

--
-- --
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

[1] http://www.w3.org/TR/owl2-new-features/#F12:_Punning

Matías Parodi

unread,
Oct 30, 2013, 6:47:57 PM10/30/13
to sta...@clarkparsia.com
Ok, it makes sense now!

It wasn't required in previous versions of SPARQL it seems (at least in Pellet through Jena the same query worked fine!). Is there any way to config the server/reasoner so that everything at the left is a owl:NamedIndividual and everything at the right is owl:Class by default?

The problem is that I'm using an ORM that generates the queries automatically, and it's not adding the types...

Thanks.
Additionally to this problem I found that *sometimes* (not always) when I change the reasoner it crashes with the following error:

$ ./stardog query "mydb;reasoning=RDFS" "select distinct ?type where { ?s a ?type. }"
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger warn
WARNING: Selector.select() returned prematurely 512 times in a row; rebuilding selector.
Oct 29, 2013 2:37:51 PM io.netty.util.internal.logging.Slf4JLogger info
INFO: Migrated 1 channel(s) to the new Selector.
com.complexible.stardog.StardogException

By the way, I've noticed that the "DL" reasoner is not being offered on the Web interface, why is that?

Thank you,
Matt

Matías Parodi

unread,
Oct 30, 2013, 8:51:20 PM10/30/13
to sta...@clarkparsia.com
Well, I know it's not always like that and that at the right you could have anything, but my point is that there should be a way to infer the types or do some kind of reasoning even if they're not known.. I'm not sure how Pellet works but I bet you do.


--
-- --
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

To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Mike Grove

unread,
Oct 31, 2013, 9:38:34 AM10/31/13
to stardog
On Wed, Oct 30, 2013 at 6:47 PM, Matías Parodi <mparo...@gmail.com> wrote:
Ok, it makes sense now!

It wasn't required in previous versions of SPARQL it seems (at least in Pellet through Jena the same query worked fine!). Is there any way to config the server/reasoner so that everything at the left is a owl:NamedIndividual and everything at the right is owl:Class by default?

It's the entailment regimes that dictate, for good reasons, that all variables within a query should be typed.  This worked with Pellet standalone because it assumes that when a variable type is ambiguous, it's *all* types, and generates results for the union of the types the variable could have.  Pellet is not used in SPARQL query answering in Stardog, which is why the behavior is different.

There is no configuration option to change the behavior of requiring typed variables, or to provide default guesses when the type is ambiguous from the usage.  For now, you have to type your variables, either explicitly, or implicitly via their usage in other BGPs.

Cheers,

Mike 
 

--
Reply all
Reply to author
Forward
0 new messages