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

Fix conformance to SPARQL Update / Query's prefix declaration #1788

Open
csarven opened this issue Jun 11, 2024 · 3 comments
Open

Fix conformance to SPARQL Update / Query's prefix declaration #1788

csarven opened this issue Jun 11, 2024 · 3 comments

Comments

@csarven
Copy link
Member

csarven commented Jun 11, 2024

Snippet of an example request:

PATCH https://example.org/test.ttl  HTTP/1.1
Content-Type: application/sparql-update

PREFIX acl: <http://www.w3.org/ns/auth/acl#>

Snippet of an example response:

HTTP/1.1 400 Bad Request
X-Powered-By: solid-server/5.7.11
Accept-Patch: application/sparql-update
Content-Type: text/plain; charset=utf-8
Content-Length: 206

Patch document syntax error: Line 1 of <https://example.org/test.ttl>: Bad syntax:
   Unknown syntax at start of statememt: 'PREFIX acl: <http://'/
   at: "PREFIX acl: <http://www.w3.org/"

AFAICT, linkeddata/rdflib.js#651 captures the issue in that NSS rejects SPARQL Update requests with valid payload using PREFIX (and accepts invalid payload containing @prefix).

@TallTed
Copy link
Member

TallTed commented Jun 11, 2024

note: lines beginning @prefix are also valid; they are just required to end with ., while lines beginning PREFIX (case-insensitive!) must not end with ..

@csarven
Copy link
Member Author

csarven commented Jun 11, 2024

Just so I understand you correctly, are you saying that @prefix is valid in SPARQL Update/Query (application/sparql-update)? My reading of https://www.w3.org/TR/sparql11-query/#rPrefixDecl is that it is invalid. Is there another reference somewhere that I'm overlooking? Or did you mean in the case of N3 / Turtle?

@TallTed
Copy link
Member

TallTed commented Jun 11, 2024

Oh, ugh. I'm sorry, I keep thinking that SPARQL and Turtle [@]prefix statements were fully aligned, but it was only done in one direction (so copy-paste works from one to the other, but not from the other to the one).

I feel like this partial alignment should be considered an erratum for SPARQL 1.2/RDF 1.2, no matter how clear the independent grammars may be in-and-of themselves, because I'm not the only one who gets them flipped.

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

No branches or pull requests

2 participants