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

SPARQL update is parsed as turtle, but they are in fact different #48

Open
ylebre opened this issue Feb 22, 2021 · 0 comments
Open

SPARQL update is parsed as turtle, but they are in fact different #48

ylebre opened this issue Feb 22, 2021 · 0 comments
Milestone

Comments

@ylebre
Copy link
Member

ylebre commented Feb 22, 2021

See: https://www.w3.org/TeamSubmission/turtle/#sec-diff-sparql

These differences are subtle, but just big enough that they trip up the EasyRDF parser in some cases.


10. Turtle compared to SPARQL (Informative)

the SPARQL Query Language for RDF (SPARQL) uses a Turtle/N3 style syntax for the Triple patterns including the same forms of abbreviated forms given here.

SPARQL includes at least the following syntax that is not in Turtle (not a complete list):

  1. RDF Literals are allowed in triple subjects
  2. Variables are allowed in any part of the triple of the form ?name or $name
  3. Long literals can use use single quote (') characters: ''' ... '''
  4. The constants allowed for XSD booleans: true and false are case independent. In Turtle they are not, only lowercase forms are allowed.
  5. SPARQL allows '.'s in names in all positions apart from the first or last. These would correspond to rules:
    name ::= nameStartChar ( ( nameChar | '.' )\* nameChar )?  
    prefixName ::= ( nameStartChar - '\_' ) ( ( nameChar | ' .' )\* nameChar )?
  1. SPARQL allows digits in the first character of the PN_LOCAL lexical token. In Turtle, the only ascii characters allowed in a nameStartChar[30] are [A-Z] | "_" | [a-z].
  2. Turtle allows prefix and base declarations[30] anywhere outside of a triple. In SPARQL, they are only allowed in the Prologue (at the start of the SPARQL query).

For further information see the Syntax for IRIs and SPARQL Grammar sections of the SPARQL query document SPARQLQ.

[30] nameStartChar ::= [A-Z] | "_" | [a-z] | [#x00C0-#x00D6] | [#x00D8-#x00F6] | [#x00F8-#x02FF] | [#x0370-#x037D] | [#x037F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
@Potherca Potherca added this to the v0.5.0 milestone Oct 21, 2021
@Potherca Potherca modified the milestones: v0.5.0, v0.7.0 Dec 8, 2021
@Potherca Potherca modified the milestones: v0.7.0, v0.8.0 Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

2 participants