Page MenuHomePhabricator

Support for named graphs in SPARQL query federation
Open, MediumPublicBUG REPORT

Description

When you federate a SPARQL query to an allowed SPARQL endpoint that contains named graphs, such as the Europeana one, with a query that references any named graphs, you get the error Unknown error: Use of WITH and GRAPH constructs in query body is not supported in triples mode. For example, the following query replicates the error:

ASK {
  SERVICE <http://sparql.europeana.eu> {
    GRAPH ?g {
      [] ?p [] .
    }
  }
}

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
jindrichmynarz renamed this task from Support for named graph in SPARQL query federation to Support for named graphs in SPARQL query federation.Jun 6 2019, 1:11 PM
Smalyshev triaged this task as Medium priority.Jun 6 2019, 4:06 PM
Smalyshev added a project: Upstream.
Smalyshev added subscribers: Igorkim78, Smalyshev.

This looks like a bug, since Blazegraph shouldn't care for queries sent outside.

The full stack is here:

Caused by: com.bigdata.rdf.sparql.ast.QuadsOperationInTriplesModeException: Use of WITH and GRAPH constructs in query body is not supported in triples mode.
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.fillInIV(ASTDeferredIVResolution.java:1039)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.fillInIV(ASTDeferredIVResolution.java:896)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.fillInIV(ASTDeferredIVResolution.java:896)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.fillInIV(ASTDeferredIVResolution.java:1052)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.fillInIV(ASTDeferredIVResolution.java:896)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.prepare(ASTDeferredIVResolution.java:669)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.resolve(ASTDeferredIVResolution.java:454)
at com.bigdata.rdf.sparql.ast.eval.ASTDeferredIVResolution.resolveQuery(ASTDeferredIVResolution.java:268)
at com.bigdata.rdf.sparql.ast.eval.ASTEvalHelper.optimizeQuery(ASTEvalHelper.java:408)

The error is happening here:

https://github.com/wikimedia/wikidata-query-blazegraph/blob/324bc3c6f43d3b67092f324c1868dd64cf747655/bigdata-core/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/ASTDeferredIVResolution.java#L1038

This will be addressed with the move to an alternative backend (https://phabricator.wikimedia.org/T206560). A test case for this particular problem will be added to the WDQS Testing (https://wikitech.wikimedia.org/wiki/User:AndreaWest/WDQS_Testing).