From 050d96f8310c90d3f4176b26d61da55f3dc8b546 Mon Sep 17 00:00:00 2001 From: Andy Seaborne Date: Fri, 16 Aug 2024 11:25:18 +0100 Subject: [PATCH] Update SPARQL grammar for reifier syntax --- spec/index.html | 362 +++++++++++++++++++++++++++++------------------- 1 file changed, 223 insertions(+), 139 deletions(-) diff --git a/spec/index.html b/spec/index.html index 8e6c1ce..7ae7277 100644 --- a/spec/index.html +++ b/spec/index.html @@ -10849,622 +10849,692 @@

Grammar

[56]   + ReifiedTripleBlock +   ::=   + ReifiedTriple PropertyList + + + + [57]   + ReifiedTripleBlockPath +   ::=   + ReifiedTriple PropertyListPath + + + + [58]   GraphPatternNotTriples   ::=   GroupOrUnionGraphPattern | OptionalGraphPattern | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData - [57]   + [59]   OptionalGraphPattern   ::=   'OPTIONAL' GroupGraphPattern - [58]   + [60]   GraphGraphPattern   ::=   'GRAPH' VarOrIri GroupGraphPattern - [59]   + [61]   ServiceGraphPattern   ::=   'SERVICE' 'SILENT'? VarOrIri GroupGraphPattern - [60]   + [62]   Bind   ::=   'BIND' '(' Expression 'AS' Var ')' - [61]   + [63]   InlineData   ::=   'VALUES' DataBlock - [62]   + [64]   DataBlock   ::=   InlineDataOneVar | InlineDataFull - [63]   + [65]   InlineDataOneVar   ::=   Var '{' DataBlockValue* '}' - [64]   + [66]   InlineDataFull   ::=   ( NIL | '(' Var* ')' ) '{' ( '(' DataBlockValue* ')' | NIL )* '}' - [65]   + [67]   DataBlockValue   ::=   - iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF' | QuotedTripleData + iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF' | TripleTermData - [66]   + [68]   + Reifier +   ::=   + '~' VarOrReifierId? + + + + [69]   + ReifierData +   ::=   + '~' ReifierId? + + + + [70]   + ReifierId +   ::=   + iri | BlankNode + + + + [71]   + VarOrReifierId +   ::=   + Var | ReifierId + + + + [72]   MinusGraphPattern   ::=   'MINUS' GroupGraphPattern - [67]   + [73]   GroupOrUnionGraphPattern   ::=   GroupGraphPattern ( 'UNION' GroupGraphPattern )* - [68]   + [74]   Filter   ::=   'FILTER' Constraint - [69]   + [75]   Constraint   ::=   BrackettedExpression | BuiltInCall | FunctionCall - [70]   + [76]   FunctionCall   ::=   iri ArgList - [71]   + [77]   ArgList   ::=   NIL | '(' 'DISTINCT'? Expression ( ',' Expression )* ')' - [72]   + [78]   ExpressionList   ::=   NIL | '(' Expression ( ',' Expression )* ')' - [73]   + [79]   ConstructTemplate   ::=   '{' ConstructTriples? '}' - [74]   + [80]   ConstructTriples   ::=   TriplesSameSubject ( '.' ConstructTriples? )? - [75]   + [81]   TriplesSameSubject   ::=   - VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList + VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList | ReifiedTripleBlock - [76]   + [82]   PropertyList   ::=   PropertyListNotEmpty? - [77]   + [83]   PropertyListNotEmpty   ::=   Verb ObjectList ( ';' ( Verb ObjectList )? )* - [78]   + [84]   Verb   ::=   VarOrIri | 'a' - [79]   + [85]   ObjectList   ::=   Object ( ',' Object )* - [80]   + [86]   Object   ::=   GraphNode Annotation - [81]   + [87]   TriplesSameSubjectPath   ::=   - VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath + VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath | ReifiedTripleBlockPath - [82]   + [88]   PropertyListPath   ::=   PropertyListPathNotEmpty? - [83]   + [89]   PropertyListPathNotEmpty   ::=   ( VerbPath | VerbSimple ) ObjectListPath ( ';' ( ( VerbPath | VerbSimple ) ObjectListPath )? )* - [84]   + [90]   VerbPath   ::=   Path - [85]   + [91]   VerbSimple   ::=   Var - [86]   + [92]   ObjectListPath   ::=   ObjectPath ( ',' ObjectPath )* - [87]   + [93]   ObjectPath   ::=   GraphNodePath AnnotationPath - [88]   + [94]   Path   ::=   PathAlternative - [89]   + [95]   PathAlternative   ::=   PathSequence ( '|' PathSequence )* - [90]   + [96]   PathSequence   ::=   PathEltOrInverse ( '/' PathEltOrInverse )* - [91]   + [97]   PathElt   ::=   PathPrimary PathMod? - [92]   + [98]   PathEltOrInverse   ::=   PathElt | '^' PathElt - [93]   + [99]   PathMod   ::=   '?' | '*' | '+' - [94]   + [100]   PathPrimary   ::=   iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')' - [95]   + [101]   PathNegatedPropertySet   ::=   PathOneInPropertySet | '(' ( PathOneInPropertySet ( '|' PathOneInPropertySet )* )? ')' - [96]   + [102]   PathOneInPropertySet   ::=   iri | 'a' | '^' ( iri | 'a' ) - [97]   + [103]   Integer   ::=   INTEGER - [98]   + [104]   TriplesNode   ::=   Collection | BlankNodePropertyList - [99]   + [105]   BlankNodePropertyList   ::=   '[' PropertyListNotEmpty ']' - [100]   + [106]   TriplesNodePath   ::=   CollectionPath | BlankNodePropertyListPath - [101]   + [107]   BlankNodePropertyListPath   ::=   '[' PropertyListPathNotEmpty ']' - [102]   + [108]   Collection   ::=   '(' GraphNode+ ')' - [103]   + [109]   CollectionPath   ::=   '(' GraphNodePath+ ')' - [104]   + [110]   AnnotationPath   ::=   - ( '{|' PropertyListPathNotEmpty '|}' )? + ( Reifier | AnnotationBlockPath )* - [105]   + [111]   + AnnotationBlockPath +   ::=   + '{|' PropertyListPath '|}' + + + + [112]   Annotation   ::=   - ( '{|' PropertyListNotEmpty '|}' )? + ( Reifier | AnnotationBlock )* - [106]   + [113]   + AnnotationBlock +   ::=   + '{|' PropertyList '|}' + + + + [114]   GraphNode   ::=   - VarOrTerm | TriplesNode + VarOrTerm | TriplesNode | ReifiedTriple - [107]   + [115]   GraphNodePath   ::=   - VarOrTerm | TriplesNodePath + VarOrTerm | TriplesNodePath | ReifiedTriple - [108]   + [116]   VarOrTerm   ::=   - Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL | QuotedTriple + Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL | TripleTerm - [109]   - QuotedTriple + [117]   + ReifiedTriple   ::=   - '<<' VarOrTerm Verb VarOrTerm '>>' + '<<' VarOrTerm Verb VarOrTerm Reifier? '>>' - [110]   - QuotedTripleData + [118]   + ReifiedTripleData   ::=   - '<<' DataValueTerm ( iri | 'a' ) DataValueTerm '>>' + '<<' DataValueTerm ( iri | 'a' ) DataValueTerm ReifierData? '>>' - [111]   + [119]   + TripleTerm +   ::=   + L_TRIPLE VarOrTerm Verb VarOrTerm R_TRIPLE + + + + [120]   + TripleTermData +   ::=   + L_TRIPLE DataValueTerm ( iri | 'a' ) DataValueTerm R_TRIPLE + + + + [121]   DataValueTerm   ::=   - iri | RDFLiteral | NumericLiteral | BooleanLiteral | QuotedTripleData + iri | RDFLiteral | NumericLiteral | BooleanLiteral | TripleTermData - [112]   + [122]   VarOrIri   ::=   Var | iri - [113]   + [123]   Var   ::=   VAR1 | VAR2 - [114]   + [124]   Expression   ::=   ConditionalOrExpression - [115]   + [125]   ConditionalOrExpression   ::=   ConditionalAndExpression ( '||' ConditionalAndExpression )* - [116]   + [126]   ConditionalAndExpression   ::=   ValueLogical ( '&&' ValueLogical )* - [117]   + [127]   ValueLogical   ::=   RelationalExpression - [118]   + [128]   RelationalExpression   ::=   NumericExpression ( '=' NumericExpression | '!=' NumericExpression | '<' NumericExpression | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList )? - [119]   + [129]   NumericExpression   ::=   AdditiveExpression - [120]   + [130]   AdditiveExpression   ::=   MultiplicativeExpression ( '+' MultiplicativeExpression | '-' MultiplicativeExpression | ( NumericLiteralPositive | NumericLiteralNegative ) ( ( '*' UnaryExpression ) | ( '/' UnaryExpression ) )* )* - [121]   + [131]   MultiplicativeExpression   ::=   UnaryExpression ( '*' UnaryExpression | '/' UnaryExpression )* - [122]   + [132]   UnaryExpression   ::=     '!' PrimaryExpression
| '+' PrimaryExpression
| '-' PrimaryExpression
| PrimaryExpression
- [123]   + [133]   PrimaryExpression   ::=   - BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprQuotedTriple + BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprReifiedTriple - [124]   + [134]   ExprVarOrTerm   ::=   - iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprQuotedTriple + iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprReifiedTriple - [125]   - ExprQuotedTriple + [135]   + ExprReifiedTriple   ::=   '<<' ExprVarOrTerm Verb ExprVarOrTerm '>>' - [126]   + [136]   BrackettedExpression   ::=   '(' Expression ')' - [127]   + [137]   BuiltInCall   ::=     Aggregate
| 'STR' '(' Expression ')'
| 'LANG' '(' Expression ')'
| 'LANGMATCHES' '(' Expression ',' Expression ')'
| 'DATATYPE' '(' Expression ')'
| 'BOUND' '(' Var ')'
| 'IRI' '(' Expression ')'
| 'URI' '(' Expression ')'
| 'BNODE' ( '(' Expression ')' | NIL )
| 'RAND' NIL
| 'ABS' '(' Expression ')'
| 'CEIL' '(' Expression ')'
| 'FLOOR' '(' Expression ')'
| 'ROUND' '(' Expression ')'
| 'CONCAT' ExpressionList
| SubstringExpression
| 'STRLEN' '(' Expression ')'
| StrReplaceExpression
| 'UCASE' '(' Expression ')'
| 'LCASE' '(' Expression ')'
| 'ENCODE_FOR_URI' '(' Expression ')'
| 'CONTAINS' '(' Expression ',' Expression ')'
| 'STRSTARTS' '(' Expression ',' Expression ')'
| 'STRENDS' '(' Expression ',' Expression ')'
| 'STRBEFORE' '(' Expression ',' Expression ')'
| 'STRAFTER' '(' Expression ',' Expression ')'
| 'YEAR' '(' Expression ')'
| 'MONTH' '(' Expression ')'
| 'DAY' '(' Expression ')'
| 'HOURS' '(' Expression ')'
| 'MINUTES' '(' Expression ')'
| 'SECONDS' '(' Expression ')'
| 'TIMEZONE' '(' Expression ')'
| 'TZ' '(' Expression ')'
| 'NOW' NIL
| 'UUID' NIL
| 'STRUUID' NIL
| 'MD5' '(' Expression ')'
| 'SHA1' '(' Expression ')'
| 'SHA256' '(' Expression ')'
| 'SHA384' '(' Expression ')'
| 'SHA512' '(' Expression ')'
| 'COALESCE' ExpressionList
| 'IF' '(' Expression ',' Expression ',' Expression ')'
| 'STRLANG' '(' Expression ',' Expression ')'
| 'STRDT' '(' Expression ',' Expression ')'
| 'sameTerm' '(' Expression ',' Expression ')'
| 'isIRI' '(' Expression ')'
| 'isURI' '(' Expression ')'
| 'isBLANK' '(' Expression ')'
| 'isLITERAL' '(' Expression ')'
| 'isNUMERIC' '(' Expression ')'
| RegexExpression
| ExistsFunc
| NotExistsFunc
| 'isTRIPLE' '(' Expression ')'
| 'TRIPLE' '(' Expression ',' Expression ',' Expression ')'
| 'SUBJECT' '(' Expression ')'
| 'PREDICATE' '(' Expression ')'
| 'OBJECT' '(' Expression ')'
- [128]   + [138]   RegexExpression   ::=   'REGEX' '(' Expression ',' Expression ( ',' Expression )? ')' - [129]   + [139]   SubstringExpression   ::=   'SUBSTR' '(' Expression ',' Expression ( ',' Expression )? ')' - [130]   + [140]   StrReplaceExpression   ::=   'REPLACE' '(' Expression ',' Expression ',' Expression ( ',' Expression )? ')' - [131]   + [141]   ExistsFunc   ::=   'EXISTS' GroupGraphPattern - [132]   + [142]   NotExistsFunc   ::=   'NOT' 'EXISTS' GroupGraphPattern - [133]   + [143]   Aggregate   ::=     'COUNT' '(' 'DISTINCT'? ( '*' | Expression ) ')'
| 'SUM' '(' 'DISTINCT'? Expression ')'
| 'MIN' '(' 'DISTINCT'? Expression ')'
| 'MAX' '(' 'DISTINCT'? Expression ')'
| 'AVG' '(' 'DISTINCT'? Expression ')'
| 'SAMPLE' '(' 'DISTINCT'? Expression ')'
| 'GROUP_CONCAT' '(' 'DISTINCT'? Expression ( ';' 'SEPARATOR' '=' String )? ')'
- [134]   + [144]   iriOrFunction   ::=   iri ArgList? - [135]   + [145]   RDFLiteral   ::=   String ( LANGTAG | ( '^^' iri ) )? - [136]   + [146]   NumericLiteral   ::=   NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative - [137]   + [147]   NumericLiteralUnsigned   ::=   INTEGER | DECIMAL | DOUBLE - [138]   + [148]   NumericLiteralPositive   ::=   INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE - [139]   + [149]   NumericLiteralNegative   ::=   INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE - [140]   + [150]   BooleanLiteral   ::=   'true' | 'false' - [141]   + [151]   String   ::=   STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 - [142]   + [152]   iri   ::=   IRIREF | PrefixedName - [143]   + [153]   PrefixedName   ::=   PNAME_LN | PNAME_NS - [144]   + [154]   BlankNode   ::=   BLANK_NODE_LABEL | ANON @@ -11476,245 +11546,259 @@

Grammar

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - +
[145]  [155]   IRIREF   ::=   '<' ([^<>"{}|^`\]-[#x00-#x20])* '>'
[146]  [156]   PNAME_NS   ::=   PN_PREFIX? ':'
[147]  [157]   PNAME_LN   ::=   PNAME_NS PN_LOCAL
[148]  [158]   BLANK_NODE_LABEL   ::=   '_:' ( PN_CHARS_U | [0-9] ) ((PN_CHARS|'.')* PN_CHARS)?
[149]  [159]   VAR1   ::=   '?' VARNAME
[150]  [160]   VAR2   ::=   '$' VARNAME
[151]  [161]   LANGTAG   ::=   '@' [a-zA-Z]+ ('-' [a-zA-Z0-9]+)*
[152]  [162]   INTEGER   ::=   [0-9]+
[153]  [163]   DECIMAL   ::=   [0-9]* '.' [0-9]+
[154]  [164]   DOUBLE   ::=   [0-9]+ '.' [0-9]* EXPONENT | '.' ([0-9])+ EXPONENT | ([0-9])+ EXPONENT
[155]  [165]   INTEGER_POSITIVE   ::=   '+' INTEGER
[156]  [166]   DECIMAL_POSITIVE   ::=   '+' DECIMAL
[157]  [167]   DOUBLE_POSITIVE   ::=   '+' DOUBLE
[158]  [168]   INTEGER_NEGATIVE   ::=   '-' INTEGER
[159]  [169]   DECIMAL_NEGATIVE   ::=   '-' DECIMAL
[160]  [170]   DOUBLE_NEGATIVE   ::=   '-' DOUBLE
[161]  [171]   EXPONENT   ::=   [eE] [+-]? [0-9]+
[162]  [172]   STRING_LITERAL1   ::=   "'" ( ([^#x27#x5C#xA#xD]) | ECHAR )* "'"
[163]  [173]   STRING_LITERAL2   ::=   '"' ( ([^#x22#x5C#xA#xD]) | ECHAR )* '"'
[164]  [174]   STRING_LITERAL_LONG1   ::=   "'''" ( ( "'" | "''" )? ( [^'\] | ECHAR ) )* "'''"
[165]  [175]   STRING_LITERAL_LONG2   ::=   '"""' ( ( '"' | '""' )? ( [^"\] | ECHAR ) )* '"""'
[166]  [176]   ECHAR   ::=   '\' [tbnrf\"']
[167]  [177]   NIL   ::=   '(' WS* ')'
[168]  [178]   WS   ::=   #x20 | #x9 | #xD | #xA
[169]  [179]   ANON   ::=   '[' WS* ']'
[170]  [180]  [<L_TRIPLE  ::=  '<<('
[181]  [<R_TRIPLE  ::=  ')>>'
[182]   PN_CHARS_BASE   ::=   [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]
[171]  [183]   PN_CHARS_U   ::=   PN_CHARS_BASE | '_'
[172]  [184]   VARNAME   ::=   ( PN_CHARS_U | [0-9] ) ( PN_CHARS_U | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040] )*
[173]  [185]   PN_CHARS   ::=   PN_CHARS_U | '-' | [0-9] | #x00B7 | [#x0300-#x036F] | [#x203F-#x2040]
[174]  [186]   PN_PREFIX   ::=   PN_CHARS_BASE ((PN_CHARS|'.')* PN_CHARS)?
[175]  [187]   PN_LOCAL   ::=   (PN_CHARS_U | ':' | [0-9] | PLX ) ((PN_CHARS | '.' | ':' | PLX)* (PN_CHARS | ':' | PLX) )?
[176]  [188]   PLX   ::=   PERCENT | PN_LOCAL_ESC
[177]  [189]   PERCENT   ::=   '%' HEX HEX
[178]  [190]   HEX   ::=   [0-9] | [A-F] | [a-f]
[179]  [191]   PN_LOCAL_ESC   ::=   '\' ( '_' | '~' | '.' | '-' | '!' | '$' | '&' | "'" | '(' | ')' | '*' | '+' | ',' | ';' | '=' | '/' | '?' | '#' | '@' | '%' )