SPARQL 1.1 entailment regimes and query with FROM

2019-08-08 17:40发布

问题:

This is a follow-up question from SPARQL 1.1 entailment regimes and query with FROM clause

I'm currently documenting/testing about SPARQL 1.1 entailment regimes and the recommendation repeatedly states that

The scoping graph is graph-equivalent to the active graph...

So it would seems that the inference scoping graph depends on the query.

The question is: does the scoping graph stems from the query's dataset (FROM/FROM NAMED clauses) or does it refer to the real current active graph context for the triple pattern being evaluated ?

With the following graphs

# Named graph: <urn:rdfs-schema-graph>
@prefix ex:<http://www.example.org/> .
ex:Article rdfs:subClassOf ex:Publication .
ex:publishes rdfs:range ex:Publication .

# Named graph: <urn:data-graph>
@prefix ex:<http://www.example.org/> .
ex:book1 a ex:Publication .
ex:book2 a ex:Article .
ex:MITPress ex:publishes ex:book3 .

What should the following query return (here under RDFS-entailment regime, for instance) and according to the recommendation ?

PREFIX ex: <http://www.example.org/>
SELECT ?s 
FROM <urn:rdfs-schema-graph>
FROM NAMED <urn:data-graph>
WHERE {
  GRAPH <urn:data-graph> {
    ?s a ex:Publication .
  }
}

should I get back all three resources:

<http://www.example.org/book1>
<http://www.example.org/book2>
<http://www.example.org/book3>

or just

<http://www.example.org/book1>

since the active graph on the triple pattern is scoped to the NAMED graph while inferencing axioms are "located" in the default graph ?

Thanks for your insight,

Max.