On 20/07/2022 17:17, Olivier Dameron wrote:
Dear Jena community,
    a FROM in a SPARQL subquery generates an error:
${JENA_HOME}/bin/sparql --data=data.trig --query=query-subQuery-namedGraph.rq
Encountered " "from" "FROM "" at line 7, column 5.
Was expecting one of:
     <IRIref> ...
...

I did not seen any specification that prevents it, and the query runs fine with virtuoso. Did I miss something or is it a bug?

It is not in
https://www.w3.org/TR/sparql11-query/

https://www.w3.org/TR/sparql11-query/#rSubSelect

The dataset is fixed at the start of a query.

Did you mean to use GRAPH (use a query pattern on a particular graph)?

    Andy



Thank you
olivier


with query-subQuery-namedGraph.rq:
----------------------------------

PREFIX od: <http://www.univ-rennes1.fr/dameron/ontology/rdfTest/>

SELECT ?val
WHERE {
   {
     SELECT ?val
     FROM od:MyGraph
     WHERE {
       od:a od:MyRelation ?val .
     }
   }
}

and data.trig:
--------------

@prefix od: <http://www.univ-rennes1.fr/dameron/ontology/rdfTest/> .

od:a od:MyRelation od:b .

GRAPH od:MyGraph {
   od:a od:MyRelation od:c .
}

Reply via email to