Explosion of results with reasoning

I think I don't understand how Stardog does reasoning. I'm looking into migrating from AllegroGraph to Stardog Cloud.

My database is numerous named graphs and a handful of vocabularies inserted into their respective graphs too. I reduced the data to a minimal function set of 12k edges. Consider the query below

CONSTRUCT { ?s ?p ?o } {
    graph <urn:foo:bar> {
       ?s ?p ?o
limit 5

Needless to say, that graph does not exist in the database. Thus, even with reasoning I would expect an empty result. Instead, I get an endless resultset of triples like.

    <http://www.w3.org/2000/01/rdf-schema#> owl:topObjectProperty <http://www.w3.org/2000/01/rdf-schema#> .
    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> owl:topObjectProperty <http://www.w3.org/2000/01/rdf-schema#> .
    <https://hypermedia.app/knossos#supportedByProperty> owl:topObjectProperty <http://www.w3.org/2000/01/rdf-schema#> .
    <https://hypermedia.app/knossos#supportedByClass> owl:topObjectProperty <http://www.w3.org/2000/01/rdf-schema#> .
    <https://code.described.at/EcmaScriptModule> owl:topObjectProperty <http://www.w3.org/2000/01/rdf-

Where is all that coming from? It basically kills more complex of my queries, flooding the results which then run forever.

I also tried the same query after removing the vocabulary graphs. That keeps some 9k triples. The result is pretty much the same. Even an unbound COUNT(*) over the empty named graph times out without a result.

So far this is an absolute blocker

Ah, I found this in OWL 2 spec

  • all pairs of individuals are connected by owl:topObjectProperty
  • all possible individuals are connected with all literals by owl:topDataProperty

It would indeed look like Stardog was trying to return a cartesian product of owl:topObjectProperty and owl:topDataProperty for all resource pairs. :face_with_raised_eyebrow: