Property paths for multiple graphs

Hello,

Assuming we have the following graphs in our stardog DB: a schema graph and a data graph

<http://ex.com/Person> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> <http://ex.com/schema> .
<http://ex.com/Athete> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class> <http://ex.com/schema> .
<http://ex.com/Athete> <http://www.w3.org/2000/01/rdf-schema#subClassOf> <http://ex.com/Person> <http://ex.com/schema> .
<http://ex.com/Bolt> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://ex.com/Athete> <http://ex.com/data> .

I want to be able to get results from queries like

select * where {?s rdf:type/rdfs:subClassOf <http://ex.com/Person> }

when I enable querying in all graphs by default in settings, or explicitly as

select * 
from named <http://ex.com/data>
from named <http://ex.com/schema>
where {?s rdf:type/rdfs:subClassOf <http://ex.com/Person> }

but the queries return nothing. I have already seen the answer to this similar query and would like to make a more specific support request here.

what is the best way to get the transitive closure of types? I am only interested rdf:type/rdfs:subClassOf paths in this case.
in our setup, merging everything on the default graph or copying the schema graph in each graph would not work and was wondering is there is a lightweight reasoning option without the rdfs side effects ofe.g.rdfs:domain & rdfs:range

Thank you in advance

Hi Dimitris,

If you have query.all.graphs=true in your stardog.properties, then the first query should return Bolt. At least it does so for me with the latest Stardog. You should get the same result from the 2nd query if you change from named to from since your property path pattern is in the default scope (i.e. not within graph ?g { .. }).

Make sure you do not have query.pp.contexts=true in your stardog.properties (otherwise property paths won’t cross named graph boundaries) and you use 5.2.

Cheers,
Pavel

Thank you Pavel,

we are a few versions back, will check this as soon as we upgrade.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.