w3c / sparql-query

https://w3c.github.io/sparql-query/
Other
7 stars 0 forks source link

The SPARQL grammar allows expression syntax triple terms to have triple terms as subjects. #158

Open afs opened 5 days ago

afs commented 5 days ago

Discovered because of https://github.com/w3c/rdf-tests/pull/144.

## expr-tripleterm-02.rq
PREFIX : <http://example.com/ns#>

SELECT * {
  ?s ?p ?o .
  BIND(<<( <<(?s ?p ?o)>> :q :z )>> AS ?t)
}

This should made invalid syntax.

kasei commented 1 day ago

I wonder if this is actually something that needs to change in the grammar as opposed to having some editorial text added. It feels similar to the grammar allowing literals in the subject position of triple patterns.

afs commented 1 day ago

(the argument can't pushed too hard - the purest view would be to allow literals as predicates!)

Personally, I don't have strong opinion as long as the syntax for triple-term-in-pattern and triple-term-in-expression are the same. In the formalism its "RDF terms" for subject and object. There is a reference to RDF core text (2002) about future working groups.

This area, the data model is an area of debate in the WG.

https://github.com/w3c/rdf-tests/issues/140 has them in the subject position.

Would you like to raise a general issue? and allow the current restricted/safe grammar to go into the editors' working draft?

Logistically, I think its better to get a consolidated editors working draft + issues than have long-running and potentially overlapping PRs.

PR #159 has rules for the subject/object position so is set up to switch easily.