-
Notifications
You must be signed in to change notification settings - Fork 2
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
Are prefixes carried from one section to another? Can they repeat? #54
Comments
Same as Turtle. I don't see any text that says it is an error to mention a prefix name more than once. SPARQL Update operation boundaries are not significant in the parsing process. It is the structure and execution of "update" that has the concept of boundaries.
Any spec defines what is correct, and can not cover every error possibility, the spec would more than double in size; there are more errors than correct behaviour. If you want clarification, the best way is to submit a PR to TARQL behavior is not as intended and that is acknowledged in the issue. Please do not reference private JIRA. The user experience such as indicating strange or unusual input is a product issue. |
Please don't question anyone's mental health nor make such disparaging remarks about our possible data export habits. Please also don't forbid redefinition of a single prefix to a different namespace within a Turtle document. There are plenty of situations where the same generic prefixes (e.g.,
Yes, and it should remain so.
The forgetfulness is certainly a bug. I don't know why it should be evidence that we should specify or forbid anything.
It should. Just like Turtle.
No.
Sounds right.
It should be.
Nope.
As it should be. Might be should be allowed in more locations than that. |
A SPARQL query is a single query. The prefixes all come at the beginning.
Where does it say that? IMHO there isn't any text to say which prefix wins in such case.
This is indeed the behavior explicitly specified by Turtle 1.2 (references in w3c/rdf-turtle#87).
@abrokenjester |
If a system wants to provide default SPARQL prefixes, an easy way to do it is to concatenate the user query to the default list of prefixes. This way if the user wants to overrides some prefixes, they can but the query can still make use of the default prefixes. |
Just as @Tpt says above, a number of deployments have a set of default prefixes which they prepend to all user queries and on which some users depend (by not including any prefix declarations in their queries), while other users put their own set of prefixes into all their queries (which is, after all, the only way users can be certain what prefixes are in effect for their query). These deployment decisions rely on both the ability to change the prefix declaration and the ability to re-declare identically. |
(cc @afs @cygri @lisp @kasei @ericprud)
Prefixes can appear anywhere in Turtle: this facilitates concatenating Turtle files, which I use often.
SPARQL:
SPARQL Update allows multiple updates (
;
separated sections).TARQL supports SELECT and CONSTRUCT (not Update) and allows multiple CONSTRUCT in the same query (a non-standard extension)
Afaik both Query spec and Update spec are silent on this point. I propose to add a section before the SPARQL grammar:
Prefix Reuse, Redeclaration and Redefinition
Query processors should return a syntax error
;
separated sections) in the same query.Each section may have its own
BASE
andPREFIX
definitions, and these are carried over to subsequent sections.However, redefining a prefix to a different namespace is not allowed: Update processors should return a syntax error.
BASE
to a new namespace is allowed between sectionsThe text was updated successfully, but these errors were encountered: