Closed wouterbeek closed 7 years ago
Pff, horrible, the sparql grammar. Postponing this for now, and will look into it later.
ps. interestingly enough, the other js SPARQL parsers fails on this query specifically as well: https://github.com/RubenVerborgh/SPARQL.js
@LaurensRietveld SPARQL syntax not that bad (compared to GML syntax, that is :-P), let me walk you through it:
First, we use the following rule to introduce an anonymous blank node with square bracket notation:
[101] BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']'
Within the brackets we are then allowed to write a VerbPath
followed
by an ObjectListPath
:
[83] PropertyListPathNotEmpty ::= ( VerbPath | VerbSimple ) ObjectListPath
( ';' ( ( VerbPath | VerbSimple ) ObjectList )? )*
For the VerbPath
we can quickly walk through a sequence of simple
grammar rules that show us that iri '/' iri
is legal:
[84] VerbPath ::= Path
[88] Path ::= PathAlternative
[89] PathAlternative ::= PathSequence ( '|' PathSequence )*
[90] PathSequence ::= PathEltOrInverse ( '/' PathEltOrInverse )*
[92] PathEltOrInverse ::= PathElt | '^' PathElt
[91] PathElt ::= PathPrimary PathMod?
[94] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')'
The ObjectListPath
is a simple iri
.
It seems the YASGUI grammar is correct (and the only sparql.org validator isnt ;)).
Your clause [ :p3/:p4 o2]
is incorrect. Paths are not allowed there (see https://www.w3.org/TR/sparql11-query/#rPropertyListPathNotEmpty), only ObjectLists
YASQE flags correct path syntax inside blank node abbreviation forms as incorrect.
MWE:
This is correct according to sparql.org and according to the W3C BNF grammar.