Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
afs opened this issue Sep 26, 2024 · 6 comments · Fixed by #159
Closed
Assignees

Comments

@afs
Copy link
Contributor

afs commented Sep 26, 2024

Discovered because of w3c/rdf-tests#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
Copy link
Contributor

kasei commented Sep 29, 2024

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
Copy link
Contributor Author

afs commented Sep 29, 2024

(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.

w3c/rdf-tests#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.

@afs
Copy link
Contributor Author

afs commented Oct 3, 2024

@kasei -
Would you like to raise a general issue for triple-terms in the subject position in SPARQL?

@kasei
Copy link
Contributor

kasei commented Oct 3, 2024

Would you like to raise a general issue for triple-terms in the subject position in SPARQL?

Sorry, busy week. I don't feel strongly about this, so I don't think so. My comment was mostly just about raising the point that we might not need to do anything with the grammar so long as editorial text made clear the actual restrictions. But as #159 already has the proposed grammar changes, I'm very happy to see that move forward.

@afs
Copy link
Contributor Author

afs commented Oct 3, 2024

@kasei - Thanks for the reply.

#159 is cautious - it has the syntax restriction - but of course that could change and now has limited impact on the rest of the grammar.

The definition of SPARQL is simpler if it works with generalized subjects.

The CONSTRUCT query type already has text to the effect "only valid triples" (for literals in the subject position).

@kasei
Copy link
Contributor

kasei commented Oct 3, 2024

The definition of SPARQL is simpler if it works with generalized subjects.

Agreed. Following this idea, it occurred to me that we might not want to prevent something like this:

<<( :s :p :o )>> ^rdf:reifies ?reifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants