@faubulous/mentor-rdf 1.4.1 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1868,8 +1868,8 @@ var Uri = class _Uri {
1868
1868
  if (u.endsWith("/") || u.endsWith("#")) {
1869
1869
  u = u.substring(0, u.length - 1);
1870
1870
  }
1871
- let ns = _Uri.getNamespaceIri(u);
1872
- return ns.length < u.length ? u.replace(ns, "") : void 0;
1871
+ let ns2 = _Uri.getNamespaceIri(u);
1872
+ return ns2.length < u.length ? u.replace(ns2, "") : void 0;
1873
1873
  }
1874
1874
  /**
1875
1875
  * Get the portion of a URI after the first occurance of '#' or the last occurance of '/'.
@@ -4125,7 +4125,7 @@ var ShapeRepository = class extends IndividualRepository {
4125
4125
  */
4126
4126
  getPropertyPathTokens(graphUris, subject) {
4127
4127
  const visitedNodes = /* @__PURE__ */ new Set();
4128
- const parse = (subject2, level, separator = "/", i = 0) => {
4128
+ const parse2 = (subject2, level, separator = "/", i = 0) => {
4129
4129
  if (visitedNodes.has(subject2.value)) {
4130
4130
  return [];
4131
4131
  }
@@ -4135,10 +4135,10 @@ var ShapeRepository = class extends IndividualRepository {
4135
4135
  } else {
4136
4136
  const first2 = this.store.matchAll(graphUris, subject2, rdf.first, null, false).next().value;
4137
4137
  if (first2) {
4138
- const path = parse(first2.object, level + 1);
4138
+ const path = parse2(first2.object, level + 1);
4139
4139
  const rest = this.store.matchAll(graphUris, subject2, rdf.rest, null, false).next().value;
4140
4140
  if (rest && rest.object.value !== rdf.nil.value) {
4141
- const tail = parse(rest.object, level, separator, i + 1);
4141
+ const tail = parse2(rest.object, level, separator, i + 1);
4142
4142
  if (tail.length === 0) {
4143
4143
  return path;
4144
4144
  }
@@ -4153,19 +4153,19 @@ var ShapeRepository = class extends IndividualRepository {
4153
4153
  for (let q of this.store.matchAll(graphUris, subject2, null, null, false)) {
4154
4154
  switch (q.predicate.value) {
4155
4155
  case sh.inversePath.value: {
4156
- return ["^", ...parse(q.object, level)];
4156
+ return ["^", ...parse2(q.object, level)];
4157
4157
  }
4158
4158
  case sh.zeroOrOnePath.value: {
4159
- return [...parse(q.object, level), "?"];
4159
+ return [...parse2(q.object, level), "?"];
4160
4160
  }
4161
4161
  case sh.zeroOrMorePath.value: {
4162
- return [...parse(q.object, level), "*"];
4162
+ return [...parse2(q.object, level), "*"];
4163
4163
  }
4164
4164
  case sh.oneOrMorePath.value: {
4165
- return [...parse(q.object, level), "+"];
4165
+ return [...parse2(q.object, level), "+"];
4166
4166
  }
4167
4167
  case sh.alternativePath.value: {
4168
- return parse(q.object, level, "|");
4168
+ return parse2(q.object, level, "|");
4169
4169
  }
4170
4170
  default:
4171
4171
  throw new Error(`Unsupported path predicate: ${q.predicate.value}`);
@@ -4175,7 +4175,7 @@ var ShapeRepository = class extends IndividualRepository {
4175
4175
  }
4176
4176
  }
4177
4177
  };
4178
- return parse(subject, 0);
4178
+ return parse2(subject, 0);
4179
4179
  }
4180
4180
  /**
4181
4181
  * Get the first discovered path from a given shape class to the sh:Shape root.
@@ -14889,6 +14889,2676 @@ var SparqlTokens = [
14889
14889
  RdfToken.STRING_LITERAL_SINGLE_QUOTE,
14890
14890
  RdfToken.STRING_LITERAL_QUOTE
14891
14891
  ];
14892
+ var SparqlParser = class extends CstParser {
14893
+ constructor() {
14894
+ super(SparqlTokens, {
14895
+ recoveryEnabled: true
14896
+ });
14897
+ /**
14898
+ * A map of prefixes to their namespace IRI.
14899
+ */
14900
+ __publicField(this, "namespaces", {});
14901
+ /**
14902
+ * Tracks whether the current verb in a PropertyListPathNotEmpty is a simple
14903
+ * path (IRI or 'a') vs a complex property path expression. Per spec note 16,
14904
+ * annotations and reifiers are only permitted when the verb is a simple path.
14905
+ */
14906
+ __publicField(this, "_verbIsSimplePath", true);
14907
+ /**
14908
+ * Tracks whether we are inside a DELETE block (DELETE DATA, DELETE WHERE,
14909
+ * or DeleteClause). Per grammar note 7, blank node syntax is not allowed
14910
+ * in these contexts, which means anonymous reifiers and annotation blocks
14911
+ * without a named reifier are disallowed.
14912
+ */
14913
+ __publicField(this, "_insideDeleteBlock", false);
14914
+ /**
14915
+ * Whether to throw errors during parsing or collect them.
14916
+ */
14917
+ __publicField(this, "_throwOnErrors", true);
14918
+ /**
14919
+ * Semantic errors collected during parsing (e.g., UndefinedNamespacePrefixError).
14920
+ */
14921
+ __publicField(this, "semanticErrors", []);
14922
+ // ==========================================
14923
+ // Entry point
14924
+ // ==========================================
14925
+ /**
14926
+ * [1] QueryUnit ::= Query
14927
+ * [30] UpdateUnit ::= Update
14928
+ * Combined entry point that tries Query first, then Update.
14929
+ */
14930
+ __publicField(this, "queryOrUpdate", this.RULE("queryOrUpdate", () => {
14931
+ this.SUBRULE(this.prologue);
14932
+ this.OR([
14933
+ // Query forms (SELECT, CONSTRUCT, DESCRIBE, ASK)
14934
+ { ALT: () => this.SUBRULE(this.queryBody) },
14935
+ // Update forms (INSERT, DELETE, LOAD, CLEAR, DROP, ADD, MOVE, COPY, CREATE, WITH)
14936
+ { ALT: () => this.SUBRULE(this.updateBody) }
14937
+ ]);
14938
+ }));
14939
+ // ==========================================
14940
+ // Query productions [2]-[29]
14941
+ // ==========================================
14942
+ /**
14943
+ * [2] Query ::= Prologue (SelectQuery | ConstructQuery | DescribeQuery | AskQuery) ValuesClause
14944
+ * Note: Prologue is factored out into queryOrUpdate.
14945
+ */
14946
+ __publicField(this, "query", this.RULE("query", () => {
14947
+ this.SUBRULE(this.prologue);
14948
+ this.SUBRULE(this.queryBody);
14949
+ }));
14950
+ /**
14951
+ * Query body after prologue: (SelectQuery | ConstructQuery | DescribeQuery | AskQuery) ValuesClause
14952
+ */
14953
+ __publicField(this, "queryBody", this.RULE("queryBody", () => {
14954
+ this.OR([
14955
+ { ALT: () => this.SUBRULE(this.selectQuery) },
14956
+ { ALT: () => this.SUBRULE(this.constructQuery) },
14957
+ { ALT: () => this.SUBRULE(this.describeQuery) },
14958
+ { ALT: () => this.SUBRULE(this.askQuery) }
14959
+ ]);
14960
+ this.SUBRULE(this.valuesClause);
14961
+ }));
14962
+ /**
14963
+ * [4] Prologue ::= (BaseDecl | PrefixDecl | VersionDecl)*
14964
+ */
14965
+ __publicField(this, "prologue", this.RULE("prologue", () => {
14966
+ this.MANY(() => {
14967
+ this.OR([
14968
+ { ALT: () => this.SUBRULE(this.baseDecl) },
14969
+ { ALT: () => this.SUBRULE(this.prefixDecl) },
14970
+ { ALT: () => this.SUBRULE(this.versionDecl) }
14971
+ ]);
14972
+ });
14973
+ }));
14974
+ /**
14975
+ * [5] BaseDecl ::= 'BASE' IRIREF
14976
+ */
14977
+ __publicField(this, "baseDecl", this.RULE("baseDecl", () => {
14978
+ this.CONSUME(RdfToken.BASE);
14979
+ this.CONSUME(RdfToken.IRIREF);
14980
+ }));
14981
+ /**
14982
+ * [6] PrefixDecl ::= 'PREFIX' PNAME_NS IRIREF
14983
+ */
14984
+ __publicField(this, "prefixDecl", this.RULE("prefixDecl", () => {
14985
+ this.CONSUME(RdfToken.PREFIX);
14986
+ const prefix = this.CONSUME(RdfToken.PNAME_NS);
14987
+ const iri = this.CONSUME(RdfToken.IRIREF);
14988
+ this.registerNamespace(prefix, iri);
14989
+ }));
14990
+ /**
14991
+ * [7] VersionDecl ::= 'VERSION' VersionSpecifier
14992
+ */
14993
+ __publicField(this, "versionDecl", this.RULE("versionDecl", () => {
14994
+ this.CONSUME(RdfToken.SPARQL_VERSION);
14995
+ this.SUBRULE(this.versionSpecifier);
14996
+ }));
14997
+ /**
14998
+ * [8] VersionSpecifier ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE
14999
+ */
15000
+ __publicField(this, "versionSpecifier", this.RULE("versionSpecifier", () => {
15001
+ this.OR([
15002
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_QUOTE) },
15003
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_SINGLE_QUOTE) }
15004
+ ]);
15005
+ }));
15006
+ /**
15007
+ * [9] SelectQuery ::= SelectClause DatasetClause* WhereClause SolutionModifier
15008
+ */
15009
+ __publicField(this, "selectQuery", this.RULE("selectQuery", () => {
15010
+ this.SUBRULE(this.selectClause);
15011
+ this.MANY(() => this.SUBRULE(this.datasetClause));
15012
+ this.SUBRULE(this.whereClause);
15013
+ this.SUBRULE(this.solutionModifier);
15014
+ }));
15015
+ /**
15016
+ * [10] SubSelect ::= SelectClause WhereClause SolutionModifier ValuesClause
15017
+ */
15018
+ __publicField(this, "subSelect", this.RULE("subSelect", () => {
15019
+ this.SUBRULE(this.selectClause);
15020
+ this.SUBRULE(this.whereClause);
15021
+ this.SUBRULE(this.solutionModifier);
15022
+ this.SUBRULE(this.valuesClause);
15023
+ }));
15024
+ /**
15025
+ * [11] SelectClause ::= 'SELECT' ('DISTINCT' | 'REDUCED')? ((Var | ('(' Expression 'AS' Var ')'))+ | '*')
15026
+ */
15027
+ __publicField(this, "selectClause", this.RULE("selectClause", () => {
15028
+ this.CONSUME(RdfToken.SELECT);
15029
+ this.OPTION(() => {
15030
+ this.OR1([
15031
+ { ALT: () => this.CONSUME(RdfToken.DISTINCT) },
15032
+ { ALT: () => this.CONSUME(RdfToken.REDUCED) }
15033
+ ]);
15034
+ });
15035
+ this.OR2([
15036
+ {
15037
+ ALT: () => {
15038
+ this.AT_LEAST_ONE(() => {
15039
+ this.OR3([
15040
+ { ALT: () => this.SUBRULE(this.var) },
15041
+ {
15042
+ ALT: () => {
15043
+ this.CONSUME(RdfToken.LPARENT);
15044
+ this.SUBRULE(this.expression);
15045
+ this.CONSUME(RdfToken.AS_KW);
15046
+ this.SUBRULE2(this.var);
15047
+ this.CONSUME(RdfToken.RPARENT);
15048
+ }
15049
+ }
15050
+ ]);
15051
+ });
15052
+ }
15053
+ },
15054
+ { ALT: () => this.CONSUME(RdfToken.STAR) }
15055
+ ]);
15056
+ }));
15057
+ /**
15058
+ * [12] ConstructQuery ::= 'CONSTRUCT' (ConstructTemplate DatasetClause* WhereClause SolutionModifier
15059
+ * | DatasetClause* 'WHERE' '{' TriplesTemplate? '}' SolutionModifier)
15060
+ */
15061
+ __publicField(this, "constructQuery", this.RULE("constructQuery", () => {
15062
+ this.CONSUME(RdfToken.CONSTRUCT);
15063
+ this.OR([
15064
+ {
15065
+ ALT: () => {
15066
+ this.SUBRULE(this.constructTemplate);
15067
+ this.MANY1(() => this.SUBRULE1(this.datasetClause));
15068
+ this.SUBRULE1(this.whereClause);
15069
+ this.SUBRULE1(this.solutionModifier);
15070
+ }
15071
+ },
15072
+ {
15073
+ ALT: () => {
15074
+ this.MANY2(() => this.SUBRULE2(this.datasetClause));
15075
+ this.CONSUME(RdfToken.WHERE);
15076
+ this.CONSUME(RdfToken.LCURLY);
15077
+ this.OPTION(() => this.SUBRULE(this.triplesTemplate));
15078
+ this.CONSUME(RdfToken.RCURLY);
15079
+ this.SUBRULE2(this.solutionModifier);
15080
+ }
15081
+ }
15082
+ ]);
15083
+ }));
15084
+ /**
15085
+ * [13] DescribeQuery ::= 'DESCRIBE' (VarOrIri+ | '*') DatasetClause* WhereClause? SolutionModifier
15086
+ */
15087
+ __publicField(this, "describeQuery", this.RULE("describeQuery", () => {
15088
+ this.CONSUME(RdfToken.DESCRIBE);
15089
+ this.OR([
15090
+ { ALT: () => this.AT_LEAST_ONE(() => this.SUBRULE(this.varOrIri)) },
15091
+ { ALT: () => this.CONSUME(RdfToken.STAR) }
15092
+ ]);
15093
+ this.MANY(() => this.SUBRULE(this.datasetClause));
15094
+ this.OPTION(() => this.SUBRULE(this.whereClause));
15095
+ this.SUBRULE(this.solutionModifier);
15096
+ }));
15097
+ /**
15098
+ * [14] AskQuery ::= 'ASK' DatasetClause* WhereClause SolutionModifier
15099
+ */
15100
+ __publicField(this, "askQuery", this.RULE("askQuery", () => {
15101
+ this.CONSUME(RdfToken.ASK);
15102
+ this.MANY(() => this.SUBRULE(this.datasetClause));
15103
+ this.SUBRULE(this.whereClause);
15104
+ this.SUBRULE(this.solutionModifier);
15105
+ }));
15106
+ /**
15107
+ * [15] DatasetClause ::= 'FROM' (DefaultGraphClause | NamedGraphClause)
15108
+ */
15109
+ __publicField(this, "datasetClause", this.RULE("datasetClause", () => {
15110
+ this.CONSUME(RdfToken.FROM);
15111
+ this.OR([
15112
+ { ALT: () => this.SUBRULE(this.defaultGraphClause) },
15113
+ { ALT: () => this.SUBRULE(this.namedGraphClause) }
15114
+ ]);
15115
+ }));
15116
+ /**
15117
+ * [16] DefaultGraphClause ::= SourceSelector
15118
+ */
15119
+ __publicField(this, "defaultGraphClause", this.RULE("defaultGraphClause", () => {
15120
+ this.SUBRULE(this.sourceSelector);
15121
+ }));
15122
+ /**
15123
+ * [17] NamedGraphClause ::= 'NAMED' SourceSelector
15124
+ */
15125
+ __publicField(this, "namedGraphClause", this.RULE("namedGraphClause", () => {
15126
+ this.CONSUME(RdfToken.NAMED);
15127
+ this.SUBRULE(this.sourceSelector);
15128
+ }));
15129
+ /**
15130
+ * [18] SourceSelector ::= iri
15131
+ */
15132
+ __publicField(this, "sourceSelector", this.RULE("sourceSelector", () => {
15133
+ this.SUBRULE(this.iri);
15134
+ }));
15135
+ /**
15136
+ * [19] WhereClause ::= 'WHERE'? GroupGraphPattern
15137
+ */
15138
+ __publicField(this, "whereClause", this.RULE("whereClause", () => {
15139
+ this.OPTION(() => this.CONSUME(RdfToken.WHERE));
15140
+ this.SUBRULE(this.groupGraphPattern);
15141
+ }));
15142
+ /**
15143
+ * [20] SolutionModifier ::= GroupClause? HavingClause? OrderClause? LimitOffsetClauses?
15144
+ */
15145
+ __publicField(this, "solutionModifier", this.RULE("solutionModifier", () => {
15146
+ this.OPTION1(() => this.SUBRULE(this.groupClause));
15147
+ this.OPTION2(() => this.SUBRULE(this.havingClause));
15148
+ this.OPTION3(() => this.SUBRULE(this.orderClause));
15149
+ this.OPTION4(() => this.SUBRULE(this.limitOffsetClauses));
15150
+ }));
15151
+ /**
15152
+ * [21] GroupClause ::= 'GROUP' 'BY' GroupCondition+
15153
+ */
15154
+ __publicField(this, "groupClause", this.RULE("groupClause", () => {
15155
+ this.CONSUME(RdfToken.GROUP);
15156
+ this.CONSUME(RdfToken.BY);
15157
+ this.AT_LEAST_ONE(() => this.SUBRULE(this.groupCondition));
15158
+ }));
15159
+ /**
15160
+ * [22] GroupCondition ::= BuiltInCall | FunctionCall | '(' Expression ('AS' Var)? ')' | Var
15161
+ */
15162
+ __publicField(this, "groupCondition", this.RULE("groupCondition", () => {
15163
+ this.OR([
15164
+ { ALT: () => this.SUBRULE(this.builtInCall) },
15165
+ { ALT: () => this.SUBRULE(this.functionCall) },
15166
+ {
15167
+ ALT: () => {
15168
+ this.CONSUME(RdfToken.LPARENT);
15169
+ this.SUBRULE(this.expression);
15170
+ this.OPTION(() => {
15171
+ this.CONSUME(RdfToken.AS_KW);
15172
+ this.SUBRULE(this.var);
15173
+ });
15174
+ this.CONSUME(RdfToken.RPARENT);
15175
+ }
15176
+ },
15177
+ { ALT: () => this.SUBRULE2(this.var) }
15178
+ ]);
15179
+ }));
15180
+ /**
15181
+ * [23] HavingClause ::= 'HAVING' HavingCondition+
15182
+ */
15183
+ __publicField(this, "havingClause", this.RULE("havingClause", () => {
15184
+ this.CONSUME(RdfToken.HAVING);
15185
+ this.AT_LEAST_ONE(() => this.SUBRULE(this.havingCondition));
15186
+ }));
15187
+ /**
15188
+ * [24] HavingCondition ::= Constraint
15189
+ */
15190
+ __publicField(this, "havingCondition", this.RULE("havingCondition", () => {
15191
+ this.SUBRULE(this.constraint);
15192
+ }));
15193
+ /**
15194
+ * [25] OrderClause ::= 'ORDER' 'BY' OrderCondition+
15195
+ */
15196
+ __publicField(this, "orderClause", this.RULE("orderClause", () => {
15197
+ this.CONSUME(RdfToken.ORDER);
15198
+ this.CONSUME(RdfToken.BY);
15199
+ this.AT_LEAST_ONE(() => this.SUBRULE(this.orderCondition));
15200
+ }));
15201
+ /**
15202
+ * [26] OrderCondition ::= (('ASC' | 'DESC') BrackettedExpression) | (Constraint | Var)
15203
+ */
15204
+ __publicField(this, "orderCondition", this.RULE("orderCondition", () => {
15205
+ this.OR([
15206
+ {
15207
+ ALT: () => {
15208
+ this.OR2([
15209
+ { ALT: () => this.CONSUME(RdfToken.ASC_KW) },
15210
+ { ALT: () => this.CONSUME(RdfToken.DESC_KW) }
15211
+ ]);
15212
+ this.SUBRULE(this.brackettedExpression);
15213
+ }
15214
+ },
15215
+ { ALT: () => this.SUBRULE(this.constraint) },
15216
+ { ALT: () => this.SUBRULE(this.var) }
15217
+ ]);
15218
+ }));
15219
+ /**
15220
+ * [27] LimitOffsetClauses ::= LimitClause OffsetClause? | OffsetClause LimitClause?
15221
+ */
15222
+ __publicField(this, "limitOffsetClauses", this.RULE("limitOffsetClauses", () => {
15223
+ this.OR([
15224
+ {
15225
+ ALT: () => {
15226
+ this.SUBRULE1(this.limitClause);
15227
+ this.OPTION1(() => this.SUBRULE1(this.offsetClause));
15228
+ }
15229
+ },
15230
+ {
15231
+ ALT: () => {
15232
+ this.SUBRULE2(this.offsetClause);
15233
+ this.OPTION2(() => this.SUBRULE2(this.limitClause));
15234
+ }
15235
+ }
15236
+ ]);
15237
+ }));
15238
+ /**
15239
+ * [28] LimitClause ::= 'LIMIT' INTEGER
15240
+ */
15241
+ __publicField(this, "limitClause", this.RULE("limitClause", () => {
15242
+ this.CONSUME(RdfToken.LIMIT);
15243
+ this.CONSUME(RdfToken.INTEGER);
15244
+ }));
15245
+ /**
15246
+ * [29] OffsetClause ::= 'OFFSET' INTEGER
15247
+ */
15248
+ __publicField(this, "offsetClause", this.RULE("offsetClause", () => {
15249
+ this.CONSUME(RdfToken.OFFSET);
15250
+ this.CONSUME(RdfToken.INTEGER);
15251
+ }));
15252
+ // ==========================================
15253
+ // Update productions [30]-[49]
15254
+ // ==========================================
15255
+ /**
15256
+ * [31] Update ::= Prologue (Update1 (';' Update)? )?
15257
+ * Note: Prologue is factored out into queryOrUpdate.
15258
+ */
15259
+ __publicField(this, "update", this.RULE("update", () => {
15260
+ this.SUBRULE(this.prologue);
15261
+ this.SUBRULE(this.updateBody);
15262
+ }));
15263
+ /**
15264
+ * Update body after prologue: (Update1 (';' Update)?)?
15265
+ */
15266
+ __publicField(this, "updateBody", this.RULE("updateBody", () => {
15267
+ this.OPTION(() => {
15268
+ this.SUBRULE(this.update1);
15269
+ this.OPTION2(() => {
15270
+ this.CONSUME(RdfToken.SEMICOLON);
15271
+ this.SUBRULE(this.update);
15272
+ });
15273
+ });
15274
+ }));
15275
+ /**
15276
+ * [32] Update1 ::= Load | Clear | Drop | Add | Move | Copy | Create | InsertData | DeleteData | DeleteWhere | Modify
15277
+ */
15278
+ __publicField(this, "update1", this.RULE("update1", () => {
15279
+ this.OR([
15280
+ { ALT: () => this.SUBRULE(this.load) },
15281
+ { ALT: () => this.SUBRULE(this.clear) },
15282
+ { ALT: () => this.SUBRULE(this.drop) },
15283
+ { ALT: () => this.SUBRULE(this.add) },
15284
+ { ALT: () => this.SUBRULE(this.move) },
15285
+ { ALT: () => this.SUBRULE(this.copy) },
15286
+ { ALT: () => this.SUBRULE(this.create) },
15287
+ { ALT: () => this.SUBRULE(this.insertData) },
15288
+ { ALT: () => this.SUBRULE(this.deleteData) },
15289
+ { ALT: () => this.SUBRULE(this.deleteWhere) },
15290
+ { ALT: () => this.SUBRULE(this.modify) }
15291
+ ]);
15292
+ }));
15293
+ /**
15294
+ * [33] Load ::= 'LOAD' 'SILENT'? iri ('INTO' GraphRef)?
15295
+ */
15296
+ __publicField(this, "load", this.RULE("load", () => {
15297
+ this.CONSUME(RdfToken.LOAD);
15298
+ this.OPTION1(() => this.CONSUME(RdfToken.SILENT));
15299
+ this.SUBRULE(this.iri);
15300
+ this.OPTION2(() => {
15301
+ this.CONSUME(RdfToken.INTO);
15302
+ this.SUBRULE(this.graphRef);
15303
+ });
15304
+ }));
15305
+ /**
15306
+ * [34] Clear ::= 'CLEAR' 'SILENT'? GraphRefAll
15307
+ */
15308
+ __publicField(this, "clear", this.RULE("clear", () => {
15309
+ this.CONSUME(RdfToken.CLEAR);
15310
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15311
+ this.SUBRULE(this.graphRefAll);
15312
+ }));
15313
+ /**
15314
+ * [35] Drop ::= 'DROP' 'SILENT'? GraphRefAll
15315
+ */
15316
+ __publicField(this, "drop", this.RULE("drop", () => {
15317
+ this.CONSUME(RdfToken.DROP);
15318
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15319
+ this.SUBRULE(this.graphRefAll);
15320
+ }));
15321
+ /**
15322
+ * [36] Create ::= 'CREATE' 'SILENT'? GraphRef
15323
+ */
15324
+ __publicField(this, "create", this.RULE("create", () => {
15325
+ this.CONSUME(RdfToken.CREATE_KW);
15326
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15327
+ this.SUBRULE(this.graphRef);
15328
+ }));
15329
+ /**
15330
+ * [37] Add ::= 'ADD' 'SILENT'? GraphOrDefault 'TO' GraphOrDefault
15331
+ */
15332
+ __publicField(this, "add", this.RULE("add", () => {
15333
+ this.CONSUME(RdfToken.ADD_KW);
15334
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15335
+ this.SUBRULE1(this.graphOrDefault);
15336
+ this.CONSUME(RdfToken.TO);
15337
+ this.SUBRULE2(this.graphOrDefault);
15338
+ }));
15339
+ /**
15340
+ * [38] Move ::= 'MOVE' 'SILENT'? GraphOrDefault 'TO' GraphOrDefault
15341
+ */
15342
+ __publicField(this, "move", this.RULE("move", () => {
15343
+ this.CONSUME(RdfToken.MOVE);
15344
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15345
+ this.SUBRULE1(this.graphOrDefault);
15346
+ this.CONSUME(RdfToken.TO);
15347
+ this.SUBRULE2(this.graphOrDefault);
15348
+ }));
15349
+ /**
15350
+ * [39] Copy ::= 'COPY' 'SILENT'? GraphOrDefault 'TO' GraphOrDefault
15351
+ */
15352
+ __publicField(this, "copy", this.RULE("copy", () => {
15353
+ this.CONSUME(RdfToken.COPY);
15354
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15355
+ this.SUBRULE1(this.graphOrDefault);
15356
+ this.CONSUME(RdfToken.TO);
15357
+ this.SUBRULE2(this.graphOrDefault);
15358
+ }));
15359
+ /**
15360
+ * [40] InsertData ::= 'INSERT' 'DATA' QuadData
15361
+ */
15362
+ __publicField(this, "insertData", this.RULE("insertData", () => {
15363
+ this.CONSUME(RdfToken.INSERT);
15364
+ this.CONSUME(RdfToken.DATA);
15365
+ this.SUBRULE(this.quadData);
15366
+ }));
15367
+ /**
15368
+ * [41] DeleteData ::= 'DELETE' 'DATA' QuadData
15369
+ */
15370
+ __publicField(this, "deleteData", this.RULE("deleteData", () => {
15371
+ this.CONSUME(RdfToken.DELETE_KW);
15372
+ this.CONSUME(RdfToken.DATA);
15373
+ const prev = this._insideDeleteBlock;
15374
+ this._insideDeleteBlock = true;
15375
+ this.SUBRULE(this.quadData);
15376
+ this._insideDeleteBlock = prev;
15377
+ }));
15378
+ /**
15379
+ * [42] DeleteWhere ::= 'DELETE' 'WHERE' QuadPattern
15380
+ */
15381
+ __publicField(this, "deleteWhere", this.RULE("deleteWhere", () => {
15382
+ this.CONSUME(RdfToken.DELETE_KW);
15383
+ this.CONSUME(RdfToken.WHERE);
15384
+ const prev = this._insideDeleteBlock;
15385
+ this._insideDeleteBlock = true;
15386
+ this.SUBRULE(this.quadPattern);
15387
+ this._insideDeleteBlock = prev;
15388
+ }));
15389
+ /**
15390
+ * [43] Modify ::= ('WITH' iri)? (DeleteClause InsertClause? | InsertClause) UsingClause* 'WHERE' GroupGraphPattern
15391
+ */
15392
+ __publicField(this, "modify", this.RULE("modify", () => {
15393
+ this.OPTION1(() => {
15394
+ this.CONSUME(RdfToken.WITH_KW);
15395
+ this.SUBRULE1(this.iri);
15396
+ });
15397
+ this.OR([
15398
+ {
15399
+ ALT: () => {
15400
+ this.SUBRULE(this.deleteClause);
15401
+ this.OPTION2(() => this.SUBRULE1(this.insertClause));
15402
+ }
15403
+ },
15404
+ { ALT: () => this.SUBRULE2(this.insertClause) }
15405
+ ]);
15406
+ this.MANY(() => this.SUBRULE(this.usingClause));
15407
+ this.CONSUME(RdfToken.WHERE);
15408
+ this.SUBRULE(this.groupGraphPattern);
15409
+ }));
15410
+ /**
15411
+ * [44] DeleteClause ::= 'DELETE' QuadPattern
15412
+ */
15413
+ __publicField(this, "deleteClause", this.RULE("deleteClause", () => {
15414
+ this.CONSUME(RdfToken.DELETE_KW);
15415
+ const prev = this._insideDeleteBlock;
15416
+ this._insideDeleteBlock = true;
15417
+ this.SUBRULE(this.quadPattern);
15418
+ this._insideDeleteBlock = prev;
15419
+ }));
15420
+ /**
15421
+ * [45] InsertClause ::= 'INSERT' QuadPattern
15422
+ */
15423
+ __publicField(this, "insertClause", this.RULE("insertClause", () => {
15424
+ this.CONSUME(RdfToken.INSERT);
15425
+ this.SUBRULE(this.quadPattern);
15426
+ }));
15427
+ /**
15428
+ * [46] UsingClause ::= 'USING' (iri | 'NAMED' iri)
15429
+ */
15430
+ __publicField(this, "usingClause", this.RULE("usingClause", () => {
15431
+ this.CONSUME(RdfToken.USING);
15432
+ this.OR([
15433
+ {
15434
+ ALT: () => {
15435
+ this.CONSUME(RdfToken.NAMED);
15436
+ this.SUBRULE1(this.iri);
15437
+ }
15438
+ },
15439
+ { ALT: () => this.SUBRULE2(this.iri) }
15440
+ ]);
15441
+ }));
15442
+ /**
15443
+ * [47] GraphOrDefault ::= 'DEFAULT' | 'GRAPH'? iri
15444
+ */
15445
+ __publicField(this, "graphOrDefault", this.RULE("graphOrDefault", () => {
15446
+ this.OR([
15447
+ { ALT: () => this.CONSUME(RdfToken.DEFAULT_KW) },
15448
+ {
15449
+ ALT: () => {
15450
+ this.OPTION(() => this.CONSUME(RdfToken.GRAPH));
15451
+ this.SUBRULE(this.iri);
15452
+ }
15453
+ }
15454
+ ]);
15455
+ }));
15456
+ /**
15457
+ * [48] GraphRef ::= 'GRAPH' iri
15458
+ */
15459
+ __publicField(this, "graphRef", this.RULE("graphRef", () => {
15460
+ this.CONSUME(RdfToken.GRAPH);
15461
+ this.SUBRULE(this.iri);
15462
+ }));
15463
+ /**
15464
+ * [49] GraphRefAll ::= GraphRef | 'DEFAULT' | 'NAMED' | 'ALL'
15465
+ */
15466
+ __publicField(this, "graphRefAll", this.RULE("graphRefAll", () => {
15467
+ this.OR([
15468
+ { ALT: () => this.SUBRULE(this.graphRef) },
15469
+ { ALT: () => this.CONSUME(RdfToken.DEFAULT_KW) },
15470
+ { ALT: () => this.CONSUME(RdfToken.NAMED) },
15471
+ { ALT: () => this.CONSUME(RdfToken.ALL_KW) }
15472
+ ]);
15473
+ }));
15474
+ // ==========================================
15475
+ // Quad productions [50]-[54]
15476
+ // ==========================================
15477
+ /**
15478
+ * [50] QuadPattern ::= '{' Quads '}'
15479
+ */
15480
+ __publicField(this, "quadPattern", this.RULE("quadPattern", () => {
15481
+ this.CONSUME(RdfToken.LCURLY);
15482
+ this.SUBRULE(this.quads);
15483
+ this.CONSUME(RdfToken.RCURLY);
15484
+ }));
15485
+ /**
15486
+ * [51] QuadData ::= '{' Quads '}'
15487
+ */
15488
+ __publicField(this, "quadData", this.RULE("quadData", () => {
15489
+ this.CONSUME(RdfToken.LCURLY);
15490
+ this.SUBRULE(this.quads);
15491
+ this.CONSUME(RdfToken.RCURLY);
15492
+ }));
15493
+ /**
15494
+ * [52] Quads ::= TriplesTemplate? (QuadsNotTriples '.'? TriplesTemplate?)*
15495
+ */
15496
+ __publicField(this, "quads", this.RULE("quads", () => {
15497
+ this.OPTION1(() => this.SUBRULE1(this.triplesTemplate));
15498
+ this.MANY(() => {
15499
+ this.SUBRULE(this.quadsNotTriples);
15500
+ this.OPTION2(() => this.CONSUME(RdfToken.PERIOD));
15501
+ this.OPTION3(() => this.SUBRULE2(this.triplesTemplate));
15502
+ });
15503
+ }));
15504
+ /**
15505
+ * [53] QuadsNotTriples ::= 'GRAPH' VarOrIri '{' TriplesTemplate? '}'
15506
+ */
15507
+ __publicField(this, "quadsNotTriples", this.RULE("quadsNotTriples", () => {
15508
+ this.CONSUME(RdfToken.GRAPH);
15509
+ this.SUBRULE(this.varOrIri);
15510
+ this.CONSUME(RdfToken.LCURLY);
15511
+ this.OPTION(() => this.SUBRULE(this.triplesTemplate));
15512
+ this.CONSUME(RdfToken.RCURLY);
15513
+ }));
15514
+ /**
15515
+ * [54] TriplesTemplate ::= TriplesSameSubject ('.' TriplesTemplate?)?
15516
+ */
15517
+ __publicField(this, "triplesTemplate", this.RULE("triplesTemplate", () => {
15518
+ this.SUBRULE(this.triplesSameSubject);
15519
+ this.OPTION(() => {
15520
+ this.CONSUME(RdfToken.PERIOD);
15521
+ this.OPTION2(() => this.SUBRULE(this.triplesTemplate));
15522
+ });
15523
+ }));
15524
+ // ==========================================
15525
+ // Graph pattern productions [55]-[73]
15526
+ // ==========================================
15527
+ /**
15528
+ * [55] GroupGraphPattern ::= '{' (SubSelect | GroupGraphPatternSub) '}'
15529
+ */
15530
+ __publicField(this, "groupGraphPattern", this.RULE("groupGraphPattern", () => {
15531
+ this.CONSUME(RdfToken.LCURLY);
15532
+ this.OR([
15533
+ { ALT: () => this.SUBRULE(this.subSelect) },
15534
+ { ALT: () => this.SUBRULE(this.groupGraphPatternSub) }
15535
+ ]);
15536
+ this.CONSUME(RdfToken.RCURLY);
15537
+ }));
15538
+ /**
15539
+ * [56] GroupGraphPatternSub ::= TriplesBlock? (GraphPatternNotTriples '.'? TriplesBlock?)*
15540
+ */
15541
+ __publicField(this, "groupGraphPatternSub", this.RULE("groupGraphPatternSub", () => {
15542
+ this.OPTION1(() => this.SUBRULE1(this.triplesBlock));
15543
+ this.MANY(() => {
15544
+ this.SUBRULE(this.graphPatternNotTriples);
15545
+ this.OPTION2(() => this.CONSUME(RdfToken.PERIOD));
15546
+ this.OPTION3(() => this.SUBRULE2(this.triplesBlock));
15547
+ });
15548
+ }));
15549
+ /**
15550
+ * [57] TriplesBlock ::= TriplesSameSubjectPath ('.' TriplesBlock?)?
15551
+ */
15552
+ __publicField(this, "triplesBlock", this.RULE("triplesBlock", () => {
15553
+ this.SUBRULE(this.triplesSameSubjectPath);
15554
+ this.OPTION(() => {
15555
+ this.CONSUME(RdfToken.PERIOD);
15556
+ this.OPTION2(() => this.SUBRULE(this.triplesBlock));
15557
+ });
15558
+ }));
15559
+ /**
15560
+ * [58] GraphPatternNotTriples ::= GroupOrUnionGraphPattern | OptionalGraphPattern
15561
+ * | MinusGraphPattern | GraphGraphPattern | ServiceGraphPattern | Filter | Bind | InlineData
15562
+ * | ReifiedTripleBlockPath
15563
+ */
15564
+ __publicField(this, "graphPatternNotTriples", this.RULE("graphPatternNotTriples", () => {
15565
+ this.OR([
15566
+ { ALT: () => this.SUBRULE(this.groupOrUnionGraphPattern) },
15567
+ { ALT: () => this.SUBRULE(this.optionalGraphPattern) },
15568
+ { ALT: () => this.SUBRULE(this.minusGraphPattern) },
15569
+ { ALT: () => this.SUBRULE(this.graphGraphPattern) },
15570
+ { ALT: () => this.SUBRULE(this.serviceGraphPattern) },
15571
+ { ALT: () => this.SUBRULE(this.filter) },
15572
+ { ALT: () => this.SUBRULE(this.bind) },
15573
+ { ALT: () => this.SUBRULE(this.inlineData) },
15574
+ { ALT: () => this.SUBRULE(this.reifiedTripleBlockPath) }
15575
+ ]);
15576
+ }));
15577
+ /**
15578
+ * [59] ReifiedTripleBlockPath ::= ReifiedTriple PropertyListPath
15579
+ */
15580
+ __publicField(this, "reifiedTripleBlockPath", this.RULE("reifiedTripleBlockPath", () => {
15581
+ this.SUBRULE(this.reifiedTriple);
15582
+ this.SUBRULE(this.propertyListPath);
15583
+ }));
15584
+ /**
15585
+ * [60] OptionalGraphPattern ::= 'OPTIONAL' GroupGraphPattern
15586
+ */
15587
+ __publicField(this, "optionalGraphPattern", this.RULE("optionalGraphPattern", () => {
15588
+ this.CONSUME(RdfToken.OPTIONAL_KW);
15589
+ this.SUBRULE(this.groupGraphPattern);
15590
+ }));
15591
+ /**
15592
+ * [61] GraphGraphPattern ::= 'GRAPH' VarOrIri GroupGraphPattern
15593
+ */
15594
+ __publicField(this, "graphGraphPattern", this.RULE("graphGraphPattern", () => {
15595
+ this.CONSUME(RdfToken.GRAPH);
15596
+ this.SUBRULE(this.varOrIri);
15597
+ this.SUBRULE(this.groupGraphPattern);
15598
+ }));
15599
+ /**
15600
+ * [62] ServiceGraphPattern ::= 'SERVICE' 'SILENT'? VarOrIri GroupGraphPattern
15601
+ */
15602
+ __publicField(this, "serviceGraphPattern", this.RULE("serviceGraphPattern", () => {
15603
+ this.CONSUME(RdfToken.SERVICE);
15604
+ this.OPTION(() => this.CONSUME(RdfToken.SILENT));
15605
+ this.SUBRULE(this.varOrIri);
15606
+ this.SUBRULE(this.groupGraphPattern);
15607
+ }));
15608
+ /**
15609
+ * [63] Bind ::= 'BIND' '(' Expression 'AS' Var ')'
15610
+ */
15611
+ __publicField(this, "bind", this.RULE("bind", () => {
15612
+ this.CONSUME(RdfToken.BIND_KW);
15613
+ this.CONSUME(RdfToken.LPARENT);
15614
+ this.SUBRULE(this.expression);
15615
+ this.CONSUME(RdfToken.AS_KW);
15616
+ this.SUBRULE(this.var);
15617
+ this.CONSUME(RdfToken.RPARENT);
15618
+ }));
15619
+ /**
15620
+ * [64] InlineData ::= 'VALUES' DataBlock
15621
+ */
15622
+ __publicField(this, "inlineData", this.RULE("inlineData", () => {
15623
+ this.CONSUME(RdfToken.VALUES);
15624
+ this.SUBRULE(this.dataBlock);
15625
+ }));
15626
+ /**
15627
+ * [65] DataBlock ::= InlineDataOneVar | InlineDataFull
15628
+ */
15629
+ __publicField(this, "dataBlock", this.RULE("dataBlock", () => {
15630
+ this.OR([
15631
+ { ALT: () => this.SUBRULE(this.inlineDataOneVar) },
15632
+ { ALT: () => this.SUBRULE(this.inlineDataFull) }
15633
+ ]);
15634
+ }));
15635
+ /**
15636
+ * [66] InlineDataOneVar ::= Var '{' DataBlockValue* '}'
15637
+ */
15638
+ __publicField(this, "inlineDataOneVar", this.RULE("inlineDataOneVar", () => {
15639
+ this.SUBRULE(this.var);
15640
+ this.CONSUME(RdfToken.LCURLY);
15641
+ this.MANY(() => this.SUBRULE(this.dataBlockValue));
15642
+ this.CONSUME(RdfToken.RCURLY);
15643
+ }));
15644
+ /**
15645
+ * [67] InlineDataFull ::= (NIL | '(' Var* ')') '{' ('(' DataBlockValue* ')' | NIL)* '}'
15646
+ */
15647
+ __publicField(this, "inlineDataFull", this.RULE("inlineDataFull", () => {
15648
+ this.OR1([
15649
+ { ALT: () => this.CONSUME1(RdfToken.NIL) },
15650
+ {
15651
+ ALT: () => {
15652
+ this.CONSUME(RdfToken.LPARENT);
15653
+ this.MANY1(() => this.SUBRULE(this.var));
15654
+ this.CONSUME(RdfToken.RPARENT);
15655
+ }
15656
+ }
15657
+ ]);
15658
+ this.CONSUME(RdfToken.LCURLY);
15659
+ this.MANY2(() => {
15660
+ this.OR2([
15661
+ {
15662
+ ALT: () => {
15663
+ this.CONSUME2(RdfToken.LPARENT);
15664
+ this.MANY3(() => this.SUBRULE(this.dataBlockValue));
15665
+ this.CONSUME2(RdfToken.RPARENT);
15666
+ }
15667
+ },
15668
+ { ALT: () => this.CONSUME2(RdfToken.NIL) }
15669
+ ]);
15670
+ });
15671
+ this.CONSUME(RdfToken.RCURLY);
15672
+ }));
15673
+ /**
15674
+ * [68] DataBlockValue ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | 'UNDEF' | TripleTermData
15675
+ */
15676
+ __publicField(this, "dataBlockValue", this.RULE("dataBlockValue", () => {
15677
+ this.OR([
15678
+ { ALT: () => this.SUBRULE(this.iri) },
15679
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
15680
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
15681
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
15682
+ { ALT: () => this.CONSUME(RdfToken.UNDEF) },
15683
+ { ALT: () => this.SUBRULE(this.tripleTermData) }
15684
+ ]);
15685
+ }));
15686
+ /**
15687
+ * [69] MinusGraphPattern ::= 'MINUS' GroupGraphPattern
15688
+ */
15689
+ __publicField(this, "minusGraphPattern", this.RULE("minusGraphPattern", () => {
15690
+ this.CONSUME(RdfToken.MINUS_KW);
15691
+ this.SUBRULE(this.groupGraphPattern);
15692
+ }));
15693
+ /**
15694
+ * [70] GroupOrUnionGraphPattern ::= GroupGraphPattern ('UNION' GroupGraphPattern)*
15695
+ */
15696
+ __publicField(this, "groupOrUnionGraphPattern", this.RULE("groupOrUnionGraphPattern", () => {
15697
+ this.SUBRULE1(this.groupGraphPattern);
15698
+ this.MANY(() => {
15699
+ this.CONSUME(RdfToken.UNION);
15700
+ this.SUBRULE2(this.groupGraphPattern);
15701
+ });
15702
+ }));
15703
+ /**
15704
+ * [71] Filter ::= 'FILTER' Constraint
15705
+ */
15706
+ __publicField(this, "filter", this.RULE("filter", () => {
15707
+ this.CONSUME(RdfToken.FILTER);
15708
+ this.SUBRULE(this.constraint);
15709
+ }));
15710
+ /**
15711
+ * [72] Constraint ::= BrackettedExpression | BuiltInCall | FunctionCall
15712
+ */
15713
+ __publicField(this, "constraint", this.RULE("constraint", () => {
15714
+ this.OR([
15715
+ { ALT: () => this.SUBRULE(this.brackettedExpression) },
15716
+ { ALT: () => this.SUBRULE(this.builtInCall) },
15717
+ { ALT: () => this.SUBRULE(this.functionCall) }
15718
+ ]);
15719
+ }));
15720
+ /**
15721
+ * [73] FunctionCall ::= iri ArgList
15722
+ */
15723
+ __publicField(this, "functionCall", this.RULE("functionCall", () => {
15724
+ this.SUBRULE(this.iri);
15725
+ this.SUBRULE(this.argList);
15726
+ }));
15727
+ // ==========================================
15728
+ // ArgList / ExpressionList [74]-[75]
15729
+ // ==========================================
15730
+ /**
15731
+ * [74] ArgList ::= NIL | '(' 'DISTINCT'? Expression (',' Expression)* ')'
15732
+ */
15733
+ __publicField(this, "argList", this.RULE("argList", () => {
15734
+ this.OR([
15735
+ { ALT: () => this.CONSUME(RdfToken.NIL) },
15736
+ {
15737
+ ALT: () => {
15738
+ this.CONSUME(RdfToken.LPARENT);
15739
+ this.OPTION(() => this.CONSUME(RdfToken.DISTINCT));
15740
+ this.SUBRULE1(this.expression);
15741
+ this.MANY(() => {
15742
+ this.CONSUME(RdfToken.COMMA);
15743
+ this.SUBRULE2(this.expression);
15744
+ });
15745
+ this.CONSUME(RdfToken.RPARENT);
15746
+ }
15747
+ }
15748
+ ]);
15749
+ }));
15750
+ /**
15751
+ * [75] ExpressionList ::= NIL | '(' Expression (',' Expression)* ')'
15752
+ */
15753
+ __publicField(this, "expressionList", this.RULE("expressionList", () => {
15754
+ this.OR([
15755
+ { ALT: () => this.CONSUME(RdfToken.NIL) },
15756
+ {
15757
+ ALT: () => {
15758
+ this.CONSUME(RdfToken.LPARENT);
15759
+ this.SUBRULE1(this.expression);
15760
+ this.MANY(() => {
15761
+ this.CONSUME(RdfToken.COMMA);
15762
+ this.SUBRULE2(this.expression);
15763
+ });
15764
+ this.CONSUME(RdfToken.RPARENT);
15765
+ }
15766
+ }
15767
+ ]);
15768
+ }));
15769
+ // ==========================================
15770
+ // Construct template [76]-[77]
15771
+ // ==========================================
15772
+ /**
15773
+ * [76] ConstructTemplate ::= '{' ConstructTriples? '}'
15774
+ */
15775
+ __publicField(this, "constructTemplate", this.RULE("constructTemplate", () => {
15776
+ this.CONSUME(RdfToken.LCURLY);
15777
+ this.OPTION(() => this.SUBRULE(this.constructTriples));
15778
+ this.CONSUME(RdfToken.RCURLY);
15779
+ }));
15780
+ /**
15781
+ * [77] ConstructTriples ::= TriplesSameSubject ('.' ConstructTriples?)?
15782
+ */
15783
+ __publicField(this, "constructTriples", this.RULE("constructTriples", () => {
15784
+ this.SUBRULE(this.triplesSameSubject);
15785
+ this.OPTION(() => {
15786
+ this.CONSUME(RdfToken.PERIOD);
15787
+ this.OPTION2(() => this.SUBRULE(this.constructTriples));
15788
+ });
15789
+ }));
15790
+ // ==========================================
15791
+ // Triple productions [78]-[93]
15792
+ // ==========================================
15793
+ /**
15794
+ * [78] TriplesSameSubject ::= VarOrTerm PropertyListNotEmpty | TriplesNode PropertyList | ReifiedTripleBlock
15795
+ */
15796
+ __publicField(this, "triplesSameSubject", this.RULE("triplesSameSubject", () => {
15797
+ this.OR([
15798
+ {
15799
+ ALT: () => {
15800
+ this.SUBRULE(this.varOrTerm);
15801
+ this.SUBRULE(this.propertyListNotEmpty);
15802
+ }
15803
+ },
15804
+ {
15805
+ ALT: () => {
15806
+ this.SUBRULE(this.triplesNode);
15807
+ this.SUBRULE(this.propertyList);
15808
+ }
15809
+ },
15810
+ { ALT: () => this.SUBRULE(this.reifiedTripleBlock) }
15811
+ ]);
15812
+ }));
15813
+ /**
15814
+ * [79] PropertyList ::= PropertyListNotEmpty?
15815
+ */
15816
+ __publicField(this, "propertyList", this.RULE("propertyList", () => {
15817
+ this.OPTION(() => this.SUBRULE(this.propertyListNotEmpty));
15818
+ }));
15819
+ /**
15820
+ * [80] PropertyListNotEmpty ::= Verb ObjectList (';' (Verb ObjectList)?)*
15821
+ */
15822
+ __publicField(this, "propertyListNotEmpty", this.RULE("propertyListNotEmpty", () => {
15823
+ this.SUBRULE1(this.verb);
15824
+ this.SUBRULE1(this.objectList);
15825
+ this.MANY(() => {
15826
+ this.CONSUME(RdfToken.SEMICOLON);
15827
+ this.OPTION(() => {
15828
+ this.SUBRULE2(this.verb);
15829
+ this.SUBRULE2(this.objectList);
15830
+ });
15831
+ });
15832
+ }));
15833
+ /**
15834
+ * [81] Verb ::= VarOrIri | 'a'
15835
+ */
15836
+ __publicField(this, "verb", this.RULE("verb", () => {
15837
+ this.OR([
15838
+ { ALT: () => this.SUBRULE(this.varOrIri) },
15839
+ { ALT: () => this.CONSUME(RdfToken.A) }
15840
+ ]);
15841
+ }));
15842
+ /**
15843
+ * [85] ObjectList ::= Object (',' Object)*
15844
+ */
15845
+ __publicField(this, "objectList", this.RULE("objectList", () => {
15846
+ this.SUBRULE1(this.graphObject);
15847
+ this.MANY(() => {
15848
+ this.CONSUME(RdfToken.COMMA);
15849
+ this.SUBRULE2(this.graphObject);
15850
+ });
15851
+ }));
15852
+ /**
15853
+ * [86] Object ::= GraphNode Annotation
15854
+ */
15855
+ __publicField(this, "graphObject", this.RULE("graphObject", () => {
15856
+ this.SUBRULE(this.graphNode);
15857
+ this.SUBRULE(this.annotation);
15858
+ }));
15859
+ /**
15860
+ * [84] TriplesSameSubjectPath ::= VarOrTerm PropertyListPathNotEmpty | TriplesNodePath PropertyListPath | ReifiedTripleBlockPath
15861
+ */
15862
+ __publicField(this, "triplesSameSubjectPath", this.RULE("triplesSameSubjectPath", () => {
15863
+ this.OR([
15864
+ {
15865
+ ALT: () => {
15866
+ this.SUBRULE(this.varOrTerm);
15867
+ this.SUBRULE(this.propertyListPathNotEmpty);
15868
+ }
15869
+ },
15870
+ {
15871
+ ALT: () => {
15872
+ this.SUBRULE(this.triplesNodePath);
15873
+ this.SUBRULE(this.propertyListPath);
15874
+ }
15875
+ },
15876
+ { ALT: () => this.SUBRULE(this.reifiedTripleBlockPath) }
15877
+ ]);
15878
+ }));
15879
+ /**
15880
+ * [85] PropertyListPath ::= PropertyListPathNotEmpty?
15881
+ */
15882
+ __publicField(this, "propertyListPath", this.RULE("propertyListPath", () => {
15883
+ this.OPTION(() => this.SUBRULE(this.propertyListPathNotEmpty));
15884
+ }));
15885
+ /**
15886
+ * [86] PropertyListPathNotEmpty ::= (VerbPath | VerbSimple) ObjectListPath (';' ((VerbPath | VerbSimple) ObjectListPath)?)*
15887
+ *
15888
+ * Per spec note 16: annotations and reifiers are only permitted when the
15889
+ * predicate is a simple path (IRI, 'a', or variable). Inside annotation
15890
+ * blocks, complex paths in verb position produce an error after parsing.
15891
+ */
15892
+ __publicField(this, "propertyListPathNotEmpty", this.RULE("propertyListPathNotEmpty", () => {
15893
+ this._verbIsSimplePath = true;
15894
+ this.OR1([
15895
+ { ALT: () => this.SUBRULE1(this.verbPath) },
15896
+ { ALT: () => this.SUBRULE1(this.verbSimple) }
15897
+ ]);
15898
+ this.SUBRULE1(this.objectListPath);
15899
+ this.MANY(() => {
15900
+ this.CONSUME(RdfToken.SEMICOLON);
15901
+ this.OPTION(() => {
15902
+ this._verbIsSimplePath = true;
15903
+ this.OR2([
15904
+ { ALT: () => this.SUBRULE2(this.verbPath) },
15905
+ { ALT: () => this.SUBRULE2(this.verbSimple) }
15906
+ ]);
15907
+ this.SUBRULE2(this.objectListPath);
15908
+ });
15909
+ });
15910
+ }));
15911
+ /**
15912
+ * [87] VerbPath ::= Path
15913
+ */
15914
+ __publicField(this, "verbPath", this.RULE("verbPath", () => {
15915
+ this.SUBRULE(this.path);
15916
+ }));
15917
+ /**
15918
+ * [88] VerbSimple ::= Var
15919
+ */
15920
+ __publicField(this, "verbSimple", this.RULE("verbSimple", () => {
15921
+ this.SUBRULE(this.var);
15922
+ }));
15923
+ /**
15924
+ * [92] ObjectListPath ::= ObjectPath (',' ObjectPath)*
15925
+ */
15926
+ __publicField(this, "objectListPath", this.RULE("objectListPath", () => {
15927
+ this.SUBRULE1(this.objectPath);
15928
+ this.MANY(() => {
15929
+ this.CONSUME(RdfToken.COMMA);
15930
+ this.SUBRULE2(this.objectPath);
15931
+ });
15932
+ }));
15933
+ /**
15934
+ * [93] ObjectPath ::= GraphNodePath AnnotationPath
15935
+ */
15936
+ __publicField(this, "objectPath", this.RULE("objectPath", () => {
15937
+ this.SUBRULE(this.graphNodePath);
15938
+ this.SUBRULE(this.annotationPath);
15939
+ }));
15940
+ // ==========================================
15941
+ // Property path productions [91]-[99]
15942
+ // ==========================================
15943
+ /**
15944
+ * [91] Path ::= PathAlternative
15945
+ */
15946
+ __publicField(this, "path", this.RULE("path", () => {
15947
+ this.SUBRULE(this.pathAlternative);
15948
+ }));
15949
+ /**
15950
+ * [92] PathAlternative ::= PathSequence ('|' PathSequence)*
15951
+ */
15952
+ __publicField(this, "pathAlternative", this.RULE("pathAlternative", () => {
15953
+ this.SUBRULE1(this.pathSequence);
15954
+ this.MANY(() => {
15955
+ this._verbIsSimplePath = false;
15956
+ this.CONSUME(RdfToken.PIPE);
15957
+ this.SUBRULE2(this.pathSequence);
15958
+ });
15959
+ }));
15960
+ /**
15961
+ * [93] PathSequence ::= PathEltOrInverse ('/' PathEltOrInverse)*
15962
+ */
15963
+ __publicField(this, "pathSequence", this.RULE("pathSequence", () => {
15964
+ this.SUBRULE1(this.pathEltOrInverse);
15965
+ this.MANY(() => {
15966
+ this._verbIsSimplePath = false;
15967
+ this.CONSUME(RdfToken.SLASH);
15968
+ this.SUBRULE2(this.pathEltOrInverse);
15969
+ });
15970
+ }));
15971
+ /**
15972
+ * [94] PathElt ::= PathPrimary PathMod?
15973
+ */
15974
+ __publicField(this, "pathElt", this.RULE("pathElt", () => {
15975
+ this.SUBRULE(this.pathPrimary);
15976
+ this.OPTION(() => this.SUBRULE(this.pathMod));
15977
+ }));
15978
+ /**
15979
+ * [95] PathEltOrInverse ::= PathElt | '^' PathElt
15980
+ */
15981
+ __publicField(this, "pathEltOrInverse", this.RULE("pathEltOrInverse", () => {
15982
+ this.OR([
15983
+ { ALT: () => this.SUBRULE1(this.pathElt) },
15984
+ {
15985
+ ALT: () => {
15986
+ this._verbIsSimplePath = false;
15987
+ this.CONSUME(RdfToken.CARET);
15988
+ this.SUBRULE2(this.pathElt);
15989
+ }
15990
+ }
15991
+ ]);
15992
+ }));
15993
+ /**
15994
+ * [96] PathMod ::= '?' | '*' | '+'
15995
+ */
15996
+ __publicField(this, "pathMod", this.RULE("pathMod", () => {
15997
+ this._verbIsSimplePath = false;
15998
+ this.OR([
15999
+ { ALT: () => this.CONSUME(RdfToken.QUESTION_MARK) },
16000
+ { ALT: () => this.CONSUME(RdfToken.STAR) },
16001
+ { ALT: () => this.CONSUME(RdfToken.PLUS_SIGN) }
16002
+ ]);
16003
+ }));
16004
+ /**
16005
+ * [97] PathPrimary ::= iri | 'a' | '!' PathNegatedPropertySet | '(' Path ')'
16006
+ */
16007
+ __publicField(this, "pathPrimary", this.RULE("pathPrimary", () => {
16008
+ this.OR([
16009
+ { ALT: () => this.SUBRULE(this.iri) },
16010
+ { ALT: () => this.CONSUME(RdfToken.A) },
16011
+ {
16012
+ ALT: () => {
16013
+ this._verbIsSimplePath = false;
16014
+ this.CONSUME(RdfToken.BANG);
16015
+ this.SUBRULE(this.pathNegatedPropertySet);
16016
+ }
16017
+ },
16018
+ {
16019
+ ALT: () => {
16020
+ this._verbIsSimplePath = false;
16021
+ this.CONSUME(RdfToken.LPARENT);
16022
+ this.SUBRULE(this.path);
16023
+ this.CONSUME(RdfToken.RPARENT);
16024
+ }
16025
+ }
16026
+ ]);
16027
+ }));
16028
+ /**
16029
+ * [98] PathNegatedPropertySet ::= PathOneInPropertySet | '(' (PathOneInPropertySet ('|' PathOneInPropertySet)*)? ')'
16030
+ */
16031
+ __publicField(this, "pathNegatedPropertySet", this.RULE("pathNegatedPropertySet", () => {
16032
+ this.OR([
16033
+ { ALT: () => this.SUBRULE1(this.pathOneInPropertySet) },
16034
+ {
16035
+ ALT: () => {
16036
+ this.CONSUME(RdfToken.LPARENT);
16037
+ this.OPTION(() => {
16038
+ this.SUBRULE2(this.pathOneInPropertySet);
16039
+ this.MANY(() => {
16040
+ this.CONSUME(RdfToken.PIPE);
16041
+ this.SUBRULE3(this.pathOneInPropertySet);
16042
+ });
16043
+ });
16044
+ this.CONSUME(RdfToken.RPARENT);
16045
+ }
16046
+ }
16047
+ ]);
16048
+ }));
16049
+ /**
16050
+ * [99] PathOneInPropertySet ::= iri | 'a' | '^' (iri | 'a')
16051
+ */
16052
+ __publicField(this, "pathOneInPropertySet", this.RULE("pathOneInPropertySet", () => {
16053
+ this.OR([
16054
+ { ALT: () => this.SUBRULE(this.iri) },
16055
+ { ALT: () => this.CONSUME(RdfToken.A) },
16056
+ {
16057
+ ALT: () => {
16058
+ this.CONSUME(RdfToken.CARET);
16059
+ this.OR2([
16060
+ { ALT: () => this.SUBRULE2(this.iri) },
16061
+ { ALT: () => this.CONSUME2(RdfToken.A) }
16062
+ ]);
16063
+ }
16064
+ }
16065
+ ]);
16066
+ }));
16067
+ // ==========================================
16068
+ // RDF 1.2 reification / annotation / triple term [100]-[125]
16069
+ // ==========================================
16070
+ /**
16071
+ * [58] ReifiedTripleBlock ::= ReifiedTriple PropertyList
16072
+ */
16073
+ __publicField(this, "reifiedTripleBlock", this.RULE("reifiedTripleBlock", () => {
16074
+ this.SUBRULE(this.reifiedTriple);
16075
+ this.SUBRULE(this.propertyList);
16076
+ }));
16077
+ /**
16078
+ * [101] ReifiedTriplePathBlock ::= ReifiedTriplePath PropertyListPathNotEmpty
16079
+ */
16080
+ __publicField(this, "reifiedTriplePathBlock", this.RULE("reifiedTriplePathBlock", () => {
16081
+ this.SUBRULE(this.reifiedTriplePath);
16082
+ this.SUBRULE(this.propertyListPathNotEmpty);
16083
+ }));
16084
+ /**
16085
+ * [102] ReifiedTriple ::= '<<' ReifiedTripleSubject Verb ReifiedTripleObject Reifier? '>>'
16086
+ */
16087
+ __publicField(this, "reifiedTriple", this.RULE("reifiedTriple", () => {
16088
+ this.CONSUME(RdfToken.OPEN_REIFIED_TRIPLE);
16089
+ this.SUBRULE(this.reifiedTripleSubject);
16090
+ this.SUBRULE(this.verb);
16091
+ this.SUBRULE(this.reifiedTripleObject);
16092
+ this.OPTION(() => this.SUBRULE(this.reifier));
16093
+ this.CONSUME(RdfToken.CLOSE_REIFIED_TRIPLE);
16094
+ }));
16095
+ /**
16096
+ * [103] ReifiedTriplePath ::= '<<' ReifiedTripleSubject VerbPath ReifiedTripleObjectPath Reifier? '>>'
16097
+ */
16098
+ __publicField(this, "reifiedTriplePath", this.RULE("reifiedTriplePath", () => {
16099
+ this.CONSUME(RdfToken.OPEN_REIFIED_TRIPLE);
16100
+ this.SUBRULE(this.reifiedTripleSubject);
16101
+ this.SUBRULE(this.verbPath);
16102
+ this.SUBRULE(this.reifiedTripleObjectPath);
16103
+ this.OPTION(() => this.SUBRULE(this.reifier));
16104
+ this.CONSUME(RdfToken.CLOSE_REIFIED_TRIPLE);
16105
+ }));
16106
+ /**
16107
+ * [117] ReifiedTripleSubject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | ReifiedTriple | TripleTerm
16108
+ * Note: Unlike VarOrTerm, this does NOT include NIL.
16109
+ */
16110
+ __publicField(this, "reifiedTripleSubject", this.RULE("reifiedTripleSubject", () => {
16111
+ this.OR([
16112
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.reifiedTriple) },
16113
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.tripleTerm) },
16114
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.var) },
16115
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.iri) },
16116
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.rdfLiteral) },
16117
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.numericLiteral) },
16118
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.booleanLiteral) },
16119
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.blankNode) }
16120
+ ]);
16121
+ }));
16122
+ /**
16123
+ * [118] ReifiedTripleObject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | ReifiedTriple | TripleTerm
16124
+ * Note: Unlike VarOrTerm, this does NOT include NIL.
16125
+ */
16126
+ __publicField(this, "reifiedTripleObject", this.RULE("reifiedTripleObject", () => {
16127
+ this.OR([
16128
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.tripleTerm) },
16129
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.reifiedTriple) },
16130
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.var) },
16131
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.iri) },
16132
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.rdfLiteral) },
16133
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.numericLiteral) },
16134
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.booleanLiteral) },
16135
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.blankNode) }
16136
+ ]);
16137
+ }));
16138
+ /**
16139
+ * [118] ReifiedTripleObjectPath ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | ReifiedTriplePath | TripleTerm
16140
+ * Note: Unlike VarOrTerm, this does NOT include NIL.
16141
+ */
16142
+ __publicField(this, "reifiedTripleObjectPath", this.RULE("reifiedTripleObjectPath", () => {
16143
+ this.OR([
16144
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.tripleTerm) },
16145
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.reifiedTriplePath) },
16146
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.var) },
16147
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.iri) },
16148
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.rdfLiteral) },
16149
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.numericLiteral) },
16150
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.booleanLiteral) },
16151
+ { IGNORE_AMBIGUITIES: true, ALT: () => this.SUBRULE(this.blankNode) }
16152
+ ]);
16153
+ }));
16154
+ /**
16155
+ * [107] AnnotationPath ::= (Reifier | AnnotationBlockPath)*
16156
+ *
16157
+ * Per spec note 16: annotations and reifiers are only permitted when the
16158
+ * predicate is a simple path (IRI, 'a', or variable), not for complex path
16159
+ * expressions (sequence, alternative, inverse, modifiers, negation, grouping).
16160
+ */
16161
+ __publicField(this, "annotationPath", this.RULE("annotationPath", () => {
16162
+ this.MANY({
16163
+ GATE: () => this._verbIsSimplePath,
16164
+ DEF: () => {
16165
+ this.OR([
16166
+ { ALT: () => this.SUBRULE(this.reifier) },
16167
+ { ALT: () => this.SUBRULE(this.annotationBlockPath) }
16168
+ ]);
16169
+ }
16170
+ });
16171
+ }));
16172
+ /**
16173
+ * [108] AnnotationBlockPath ::= '{|' PropertyListPathNotEmpty '|}'
16174
+ */
16175
+ __publicField(this, "annotationBlockPath", this.RULE("annotationBlockPath", () => {
16176
+ this.CONSUME(RdfToken.OPEN_ANNOTATION);
16177
+ this.SUBRULE(this.propertyListPathNotEmpty);
16178
+ this.CONSUME(RdfToken.CLOSE_ANNOTATION);
16179
+ }));
16180
+ /**
16181
+ * [109] Annotation ::= (Reifier | AnnotationBlock)*
16182
+ *
16183
+ * In delete contexts (DELETE DATA, DELETE WHERE, DeleteClause), annotation
16184
+ * blocks without a preceding named reifier are rejected because they create
16185
+ * anonymous reifiers (blank nodes), which are disallowed per grammar note 7.
16186
+ */
16187
+ __publicField(this, "annotation", this.RULE("annotation", () => {
16188
+ let hasNamedReifier = false;
16189
+ this.MANY(() => {
16190
+ this.OR([
16191
+ {
16192
+ ALT: () => {
16193
+ this.SUBRULE(this.reifier);
16194
+ hasNamedReifier = true;
16195
+ }
16196
+ },
16197
+ {
16198
+ ALT: () => {
16199
+ if (this._insideDeleteBlock && !hasNamedReifier) {
16200
+ throw new Error("Anonymous reifiers (annotation blocks without a named reifier) are not allowed in DELETE blocks (grammar note 7: no blank nodes)");
16201
+ }
16202
+ this.SUBRULE(this.annotationBlock);
16203
+ hasNamedReifier = false;
16204
+ }
16205
+ }
16206
+ ]);
16207
+ });
16208
+ }));
16209
+ /**
16210
+ * [110] AnnotationBlock ::= '{|' PropertyListNotEmpty '|}'
16211
+ */
16212
+ __publicField(this, "annotationBlock", this.RULE("annotationBlock", () => {
16213
+ this.CONSUME(RdfToken.OPEN_ANNOTATION);
16214
+ this.SUBRULE(this.propertyListNotEmpty);
16215
+ this.CONSUME(RdfToken.CLOSE_ANNOTATION);
16216
+ }));
16217
+ /**
16218
+ * [111] Reifier ::= '~' VarOrReifierId?
16219
+ */
16220
+ __publicField(this, "reifier", this.RULE("reifier", () => {
16221
+ this.CONSUME(RdfToken.TILDE);
16222
+ this.OPTION(() => this.SUBRULE(this.varOrReifierId));
16223
+ }));
16224
+ /**
16225
+ * [112] VarOrReifierId ::= Var | iri | BlankNode
16226
+ */
16227
+ __publicField(this, "varOrReifierId", this.RULE("varOrReifierId", () => {
16228
+ this.OR([
16229
+ { ALT: () => this.SUBRULE(this.var) },
16230
+ { ALT: () => this.SUBRULE(this.iri) },
16231
+ { ALT: () => this.SUBRULE(this.blankNode) }
16232
+ ]);
16233
+ }));
16234
+ /**
16235
+ * [113] TripleTerm ::= '<<(' TripleTermSubject Verb TripleTermObject ')>>'
16236
+ */
16237
+ __publicField(this, "tripleTerm", this.RULE("tripleTerm", () => {
16238
+ this.CONSUME(RdfToken.OPEN_TRIPLE_TERM);
16239
+ this.SUBRULE(this.tripleTermSubject);
16240
+ this.SUBRULE(this.verb);
16241
+ this.SUBRULE(this.tripleTermObject);
16242
+ this.CONSUME(RdfToken.CLOSE_TRIPLE_TERM);
16243
+ }));
16244
+ /**
16245
+ * [120] TripleTermSubject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | TripleTerm
16246
+ */
16247
+ __publicField(this, "tripleTermSubject", this.RULE("tripleTermSubject", () => {
16248
+ this.OR([
16249
+ { ALT: () => this.SUBRULE(this.var) },
16250
+ { ALT: () => this.SUBRULE(this.iri) },
16251
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
16252
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
16253
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
16254
+ { ALT: () => this.SUBRULE(this.blankNode) },
16255
+ { ALT: () => this.SUBRULE(this.tripleTerm) }
16256
+ ]);
16257
+ }));
16258
+ /**
16259
+ * [121] TripleTermObject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | TripleTerm
16260
+ */
16261
+ __publicField(this, "tripleTermObject", this.RULE("tripleTermObject", () => {
16262
+ this.OR([
16263
+ { ALT: () => this.SUBRULE(this.var) },
16264
+ { ALT: () => this.SUBRULE(this.iri) },
16265
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
16266
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
16267
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
16268
+ { ALT: () => this.SUBRULE(this.blankNode) },
16269
+ { ALT: () => this.SUBRULE(this.tripleTerm) }
16270
+ ]);
16271
+ }));
16272
+ /**
16273
+ * [116] TripleTermData ::= '<<(' TripleTermDataSubject (iri | 'a') TripleTermDataObject ')>>'
16274
+ */
16275
+ __publicField(this, "tripleTermData", this.RULE("tripleTermData", () => {
16276
+ this.CONSUME(RdfToken.OPEN_TRIPLE_TERM);
16277
+ this.SUBRULE(this.tripleTermDataSubject);
16278
+ this.OR([
16279
+ { ALT: () => this.SUBRULE1(this.iri) },
16280
+ { ALT: () => this.CONSUME(RdfToken.A) }
16281
+ ]);
16282
+ this.SUBRULE(this.tripleTermDataObject);
16283
+ this.CONSUME(RdfToken.CLOSE_TRIPLE_TERM);
16284
+ }));
16285
+ /**
16286
+ * [123] TripleTermDataSubject ::= iri
16287
+ */
16288
+ __publicField(this, "tripleTermDataSubject", this.RULE("tripleTermDataSubject", () => {
16289
+ this.SUBRULE(this.iri);
16290
+ }));
16291
+ /**
16292
+ * [124] TripleTermDataObject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | TripleTermData
16293
+ */
16294
+ __publicField(this, "tripleTermDataObject", this.RULE("tripleTermDataObject", () => {
16295
+ this.OR([
16296
+ { ALT: () => this.SUBRULE(this.iri) },
16297
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
16298
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
16299
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
16300
+ { ALT: () => this.SUBRULE(this.tripleTermData) }
16301
+ ]);
16302
+ }));
16303
+ // ==========================================
16304
+ // Expression productions [119]-[143]
16305
+ // ==========================================
16306
+ /**
16307
+ * [119] Expression ::= ConditionalOrExpression
16308
+ */
16309
+ __publicField(this, "expression", this.RULE("expression", () => {
16310
+ this.SUBRULE(this.conditionalOrExpression);
16311
+ }));
16312
+ /**
16313
+ * [120] ConditionalOrExpression ::= ConditionalAndExpression ('||' ConditionalAndExpression)*
16314
+ */
16315
+ __publicField(this, "conditionalOrExpression", this.RULE("conditionalOrExpression", () => {
16316
+ this.SUBRULE1(this.conditionalAndExpression);
16317
+ this.MANY(() => {
16318
+ this.CONSUME(RdfToken.OR);
16319
+ this.SUBRULE2(this.conditionalAndExpression);
16320
+ });
16321
+ }));
16322
+ /**
16323
+ * [121] ConditionalAndExpression ::= ValueLogical ('&&' ValueLogical)*
16324
+ */
16325
+ __publicField(this, "conditionalAndExpression", this.RULE("conditionalAndExpression", () => {
16326
+ this.SUBRULE1(this.valueLogical);
16327
+ this.MANY(() => {
16328
+ this.CONSUME(RdfToken.AND);
16329
+ this.SUBRULE2(this.valueLogical);
16330
+ });
16331
+ }));
16332
+ /**
16333
+ * [122] ValueLogical ::= RelationalExpression
16334
+ */
16335
+ __publicField(this, "valueLogical", this.RULE("valueLogical", () => {
16336
+ this.SUBRULE(this.relationalExpression);
16337
+ }));
16338
+ /**
16339
+ * [123] RelationalExpression ::= NumericExpression
16340
+ * ('=' NumericExpression | '!=' NumericExpression | '<' NumericExpression
16341
+ * | '>' NumericExpression | '<=' NumericExpression | '>=' NumericExpression
16342
+ * | 'IN' ExpressionList | 'NOT' 'IN' ExpressionList)?
16343
+ */
16344
+ __publicField(this, "relationalExpression", this.RULE("relationalExpression", () => {
16345
+ this.SUBRULE1(this.numericExpression);
16346
+ this.OPTION(() => {
16347
+ this.OR([
16348
+ { ALT: () => {
16349
+ this.CONSUME(RdfToken.EQ);
16350
+ this.SUBRULE2(this.numericExpression);
16351
+ } },
16352
+ { ALT: () => {
16353
+ this.CONSUME(RdfToken.NEQ);
16354
+ this.SUBRULE3(this.numericExpression);
16355
+ } },
16356
+ { ALT: () => {
16357
+ this.CONSUME(RdfToken.LT);
16358
+ this.SUBRULE4(this.numericExpression);
16359
+ } },
16360
+ { ALT: () => {
16361
+ this.CONSUME(RdfToken.GT);
16362
+ this.SUBRULE5(this.numericExpression);
16363
+ } },
16364
+ { ALT: () => {
16365
+ this.CONSUME(RdfToken.LTE);
16366
+ this.SUBRULE6(this.numericExpression);
16367
+ } },
16368
+ { ALT: () => {
16369
+ this.CONSUME(RdfToken.GTE);
16370
+ this.SUBRULE7(this.numericExpression);
16371
+ } },
16372
+ { ALT: () => {
16373
+ this.CONSUME(RdfToken.IN_KW);
16374
+ this.SUBRULE1(this.expressionList);
16375
+ } },
16376
+ { ALT: () => {
16377
+ this.CONSUME(RdfToken.NOT);
16378
+ this.CONSUME2(RdfToken.IN_KW);
16379
+ this.SUBRULE2(this.expressionList);
16380
+ } }
16381
+ ]);
16382
+ });
16383
+ }));
16384
+ /**
16385
+ * [124] NumericExpression ::= AdditiveExpression
16386
+ */
16387
+ __publicField(this, "numericExpression", this.RULE("numericExpression", () => {
16388
+ this.SUBRULE(this.additiveExpression);
16389
+ }));
16390
+ /**
16391
+ * [125] AdditiveExpression ::= MultiplicativeExpression
16392
+ * ('+' MultiplicativeExpression | '-' MultiplicativeExpression
16393
+ * | (NumericLiteralPositive | NumericLiteralNegative) (('*' UnaryExpression) | ('/' UnaryExpression))?)*
16394
+ */
16395
+ __publicField(this, "additiveExpression", this.RULE("additiveExpression", () => {
16396
+ this.SUBRULE1(this.multiplicativeExpression);
16397
+ this.MANY(() => {
16398
+ this.OR([
16399
+ {
16400
+ ALT: () => {
16401
+ this.CONSUME(RdfToken.PLUS_SIGN);
16402
+ this.SUBRULE2(this.multiplicativeExpression);
16403
+ }
16404
+ },
16405
+ {
16406
+ ALT: () => {
16407
+ this.CONSUME(RdfToken.MINUS_SIGN);
16408
+ this.SUBRULE3(this.multiplicativeExpression);
16409
+ }
16410
+ },
16411
+ {
16412
+ ALT: () => {
16413
+ this.OR2([
16414
+ { ALT: () => this.SUBRULE1(this.numericLiteralPositive) },
16415
+ { ALT: () => this.SUBRULE1(this.numericLiteralNegative) }
16416
+ ]);
16417
+ this.OPTION(() => {
16418
+ this.OR3([
16419
+ { ALT: () => {
16420
+ this.CONSUME(RdfToken.STAR);
16421
+ this.SUBRULE1(this.unaryExpression);
16422
+ } },
16423
+ { ALT: () => {
16424
+ this.CONSUME(RdfToken.SLASH);
16425
+ this.SUBRULE2(this.unaryExpression);
16426
+ } }
16427
+ ]);
16428
+ });
16429
+ }
16430
+ }
16431
+ ]);
16432
+ });
16433
+ }));
16434
+ /**
16435
+ * [126] MultiplicativeExpression ::= UnaryExpression (('*' UnaryExpression) | ('/' UnaryExpression))*
16436
+ */
16437
+ __publicField(this, "multiplicativeExpression", this.RULE("multiplicativeExpression", () => {
16438
+ this.SUBRULE1(this.unaryExpression);
16439
+ this.MANY(() => {
16440
+ this.OR([
16441
+ { ALT: () => {
16442
+ this.CONSUME(RdfToken.STAR);
16443
+ this.SUBRULE2(this.unaryExpression);
16444
+ } },
16445
+ { ALT: () => {
16446
+ this.CONSUME(RdfToken.SLASH);
16447
+ this.SUBRULE3(this.unaryExpression);
16448
+ } }
16449
+ ]);
16450
+ });
16451
+ }));
16452
+ /**
16453
+ * [135] UnaryExpression ::= '!' UnaryExpression | '+' PrimaryExpression | '-' PrimaryExpression | PrimaryExpression
16454
+ */
16455
+ __publicField(this, "unaryExpression", this.RULE("unaryExpression", () => {
16456
+ this.OR([
16457
+ { ALT: () => {
16458
+ this.CONSUME(RdfToken.BANG);
16459
+ this.SUBRULE1(this.unaryExpression);
16460
+ } },
16461
+ { ALT: () => {
16462
+ this.CONSUME(RdfToken.PLUS_SIGN);
16463
+ this.SUBRULE2(this.primaryExpression);
16464
+ } },
16465
+ { ALT: () => {
16466
+ this.CONSUME(RdfToken.MINUS_SIGN);
16467
+ this.SUBRULE3(this.primaryExpression);
16468
+ } },
16469
+ { ALT: () => this.SUBRULE4(this.primaryExpression) }
16470
+ ]);
16471
+ }));
16472
+ /**
16473
+ * [128] PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral
16474
+ * | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm
16475
+ */
16476
+ __publicField(this, "primaryExpression", this.RULE("primaryExpression", () => {
16477
+ this.OR([
16478
+ { ALT: () => this.SUBRULE(this.brackettedExpression) },
16479
+ { ALT: () => this.SUBRULE(this.builtInCall) },
16480
+ { ALT: () => this.SUBRULE(this.iriOrFunction) },
16481
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
16482
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
16483
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
16484
+ { ALT: () => this.SUBRULE(this.var) },
16485
+ { ALT: () => this.SUBRULE(this.exprTripleTerm) }
16486
+ ]);
16487
+ }));
16488
+ /**
16489
+ * [129] BrackettedExpression ::= '(' Expression ')'
16490
+ */
16491
+ __publicField(this, "brackettedExpression", this.RULE("brackettedExpression", () => {
16492
+ this.CONSUME(RdfToken.LPARENT);
16493
+ this.SUBRULE(this.expression);
16494
+ this.CONSUME(RdfToken.RPARENT);
16495
+ }));
16496
+ /**
16497
+ * [137] ExprTripleTerm ::= '<<(' ExprTripleTermSubject Verb ExprTripleTermObject ')>>'
16498
+ */
16499
+ __publicField(this, "exprTripleTerm", this.RULE("exprTripleTerm", () => {
16500
+ this.CONSUME(RdfToken.OPEN_TRIPLE_TERM);
16501
+ this.SUBRULE(this.exprTripleTermSubject);
16502
+ this.SUBRULE(this.verb);
16503
+ this.SUBRULE(this.exprTripleTermObject);
16504
+ this.CONSUME(RdfToken.CLOSE_TRIPLE_TERM);
16505
+ }));
16506
+ /**
16507
+ * [138] ExprTripleTermSubject ::= iri | Var
16508
+ */
16509
+ __publicField(this, "exprTripleTermSubject", this.RULE("exprTripleTermSubject", () => {
16510
+ this.OR([
16511
+ { ALT: () => this.SUBRULE(this.iri) },
16512
+ { ALT: () => this.SUBRULE(this.var) }
16513
+ ]);
16514
+ }));
16515
+ /**
16516
+ * [139] ExprTripleTermObject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm
16517
+ */
16518
+ __publicField(this, "exprTripleTermObject", this.RULE("exprTripleTermObject", () => {
16519
+ this.OR([
16520
+ { ALT: () => this.SUBRULE(this.iri) },
16521
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
16522
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
16523
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
16524
+ { ALT: () => this.SUBRULE(this.var) },
16525
+ { ALT: () => this.SUBRULE(this.exprTripleTerm) }
16526
+ ]);
16527
+ }));
16528
+ // ==========================================
16529
+ // Built-in calls [131]
16530
+ // ==========================================
16531
+ /**
16532
+ * [131] BuiltInCall - dispatches to sub-groups to stay within Chevrotain's CONSUME index limits
16533
+ */
16534
+ __publicField(this, "builtInCall", this.RULE("builtInCall", () => {
16535
+ this.OR([
16536
+ { ALT: () => this.SUBRULE(this.aggregate) },
16537
+ { ALT: () => this.SUBRULE(this.builtInCallTermAccessors) },
16538
+ { ALT: () => this.SUBRULE(this.builtInCallStringFuncs) },
16539
+ { ALT: () => this.SUBRULE(this.builtInCallNumericFuncs) },
16540
+ { ALT: () => this.SUBRULE(this.builtInCallDateTimeFuncs) },
16541
+ { ALT: () => this.SUBRULE(this.builtInCallHashFuncs) },
16542
+ { ALT: () => this.SUBRULE(this.builtInCallTestFuncs) },
16543
+ { ALT: () => this.SUBRULE(this.builtInCallMiscFuncs) },
16544
+ { ALT: () => this.SUBRULE(this.builtInCallRdf12Funcs) },
16545
+ { ALT: () => this.SUBRULE(this.regexExpression) },
16546
+ { ALT: () => this.SUBRULE(this.substringExpression) },
16547
+ { ALT: () => this.SUBRULE(this.strReplaceExpression) },
16548
+ { ALT: () => this.SUBRULE(this.existsFunc) },
16549
+ { ALT: () => this.SUBRULE(this.notExistsFunc) }
16550
+ ]);
16551
+ }));
16552
+ /**
16553
+ * Term accessor built-ins: STR, LANG, LANGDIR, DATATYPE, IRI, URI, BNODE
16554
+ */
16555
+ __publicField(this, "builtInCallTermAccessors", this.RULE("builtInCallTermAccessors", () => {
16556
+ this.OR([
16557
+ {
16558
+ ALT: () => {
16559
+ this.CONSUME(RdfToken.STR);
16560
+ this.CONSUME1(RdfToken.LPARENT);
16561
+ this.SUBRULE1(this.expression);
16562
+ this.CONSUME1(RdfToken.RPARENT);
16563
+ }
16564
+ },
16565
+ {
16566
+ ALT: () => {
16567
+ this.CONSUME(RdfToken.LANG_KW);
16568
+ this.CONSUME2(RdfToken.LPARENT);
16569
+ this.SUBRULE2(this.expression);
16570
+ this.CONSUME2(RdfToken.RPARENT);
16571
+ }
16572
+ },
16573
+ {
16574
+ ALT: () => {
16575
+ this.CONSUME(RdfToken.LANGMATCHES);
16576
+ this.CONSUME3(RdfToken.LPARENT);
16577
+ this.SUBRULE3(this.expression);
16578
+ this.CONSUME1(RdfToken.COMMA);
16579
+ this.SUBRULE4(this.expression);
16580
+ this.CONSUME3(RdfToken.RPARENT);
16581
+ }
16582
+ },
16583
+ {
16584
+ ALT: () => {
16585
+ this.CONSUME(RdfToken.LANGDIR);
16586
+ this.CONSUME4(RdfToken.LPARENT);
16587
+ this.SUBRULE5(this.expression);
16588
+ this.CONSUME4(RdfToken.RPARENT);
16589
+ }
16590
+ },
16591
+ {
16592
+ ALT: () => {
16593
+ this.CONSUME(RdfToken.DATATYPE);
16594
+ this.CONSUME5(RdfToken.LPARENT);
16595
+ this.SUBRULE6(this.expression);
16596
+ this.CONSUME5(RdfToken.RPARENT);
16597
+ }
16598
+ },
16599
+ {
16600
+ ALT: () => {
16601
+ this.CONSUME(RdfToken.IRI_KW);
16602
+ this.CONSUME6(RdfToken.LPARENT);
16603
+ this.SUBRULE7(this.expression);
16604
+ this.CONSUME6(RdfToken.RPARENT);
16605
+ }
16606
+ },
16607
+ {
16608
+ ALT: () => {
16609
+ this.CONSUME(RdfToken.URI_KW);
16610
+ this.CONSUME7(RdfToken.LPARENT);
16611
+ this.SUBRULE8(this.expression);
16612
+ this.CONSUME7(RdfToken.RPARENT);
16613
+ }
16614
+ },
16615
+ {
16616
+ ALT: () => {
16617
+ this.CONSUME(RdfToken.BNODE_KW);
16618
+ this.OR2([
16619
+ {
16620
+ ALT: () => {
16621
+ this.CONSUME8(RdfToken.LPARENT);
16622
+ this.SUBRULE9(this.expression);
16623
+ this.CONSUME8(RdfToken.RPARENT);
16624
+ }
16625
+ },
16626
+ { ALT: () => this.CONSUME1(RdfToken.NIL) }
16627
+ ]);
16628
+ }
16629
+ },
16630
+ {
16631
+ ALT: () => {
16632
+ this.CONSUME(RdfToken.BOUND);
16633
+ this.CONSUME9(RdfToken.LPARENT);
16634
+ this.SUBRULE1(this.var);
16635
+ this.CONSUME9(RdfToken.RPARENT);
16636
+ }
16637
+ }
16638
+ ]);
16639
+ }));
16640
+ /**
16641
+ * String built-ins part 1: STRLEN, UCASE, LCASE, ENCODE_FOR_URI, CONTAINS, STRSTARTS, CONCAT
16642
+ */
16643
+ __publicField(this, "builtInCallStringFuncs", this.RULE("builtInCallStringFuncs", () => {
16644
+ this.OR([
16645
+ {
16646
+ ALT: () => {
16647
+ this.CONSUME(RdfToken.STRLEN);
16648
+ this.CONSUME1(RdfToken.LPARENT);
16649
+ this.SUBRULE1(this.expression);
16650
+ this.CONSUME1(RdfToken.RPARENT);
16651
+ }
16652
+ },
16653
+ {
16654
+ ALT: () => {
16655
+ this.CONSUME(RdfToken.UCASE);
16656
+ this.CONSUME2(RdfToken.LPARENT);
16657
+ this.SUBRULE2(this.expression);
16658
+ this.CONSUME2(RdfToken.RPARENT);
16659
+ }
16660
+ },
16661
+ {
16662
+ ALT: () => {
16663
+ this.CONSUME(RdfToken.LCASE);
16664
+ this.CONSUME3(RdfToken.LPARENT);
16665
+ this.SUBRULE3(this.expression);
16666
+ this.CONSUME3(RdfToken.RPARENT);
16667
+ }
16668
+ },
16669
+ {
16670
+ ALT: () => {
16671
+ this.CONSUME(RdfToken.ENCODE_FOR_URI);
16672
+ this.CONSUME4(RdfToken.LPARENT);
16673
+ this.SUBRULE4(this.expression);
16674
+ this.CONSUME4(RdfToken.RPARENT);
16675
+ }
16676
+ },
16677
+ {
16678
+ ALT: () => {
16679
+ this.CONSUME(RdfToken.CONTAINS);
16680
+ this.CONSUME5(RdfToken.LPARENT);
16681
+ this.SUBRULE5(this.expression);
16682
+ this.CONSUME1(RdfToken.COMMA);
16683
+ this.SUBRULE6(this.expression);
16684
+ this.CONSUME5(RdfToken.RPARENT);
16685
+ }
16686
+ },
16687
+ {
16688
+ ALT: () => {
16689
+ this.CONSUME(RdfToken.STRSTARTS);
16690
+ this.CONSUME6(RdfToken.LPARENT);
16691
+ this.SUBRULE7(this.expression);
16692
+ this.CONSUME2(RdfToken.COMMA);
16693
+ this.SUBRULE8(this.expression);
16694
+ this.CONSUME6(RdfToken.RPARENT);
16695
+ }
16696
+ },
16697
+ {
16698
+ ALT: () => {
16699
+ this.CONSUME(RdfToken.CONCAT);
16700
+ this.SUBRULE1(this.expressionList);
16701
+ }
16702
+ },
16703
+ { ALT: () => this.SUBRULE(this.builtInCallStringFuncs2) }
16704
+ ]);
16705
+ }));
16706
+ /**
16707
+ * String built-ins part 2: STRENDS, STRBEFORE, STRAFTER
16708
+ */
16709
+ __publicField(this, "builtInCallStringFuncs2", this.RULE("builtInCallStringFuncs2", () => {
16710
+ this.OR([
16711
+ {
16712
+ ALT: () => {
16713
+ this.CONSUME(RdfToken.STRENDS);
16714
+ this.CONSUME1(RdfToken.LPARENT);
16715
+ this.SUBRULE1(this.expression);
16716
+ this.CONSUME1(RdfToken.COMMA);
16717
+ this.SUBRULE2(this.expression);
16718
+ this.CONSUME1(RdfToken.RPARENT);
16719
+ }
16720
+ },
16721
+ {
16722
+ ALT: () => {
16723
+ this.CONSUME(RdfToken.STRBEFORE);
16724
+ this.CONSUME2(RdfToken.LPARENT);
16725
+ this.SUBRULE3(this.expression);
16726
+ this.CONSUME2(RdfToken.COMMA);
16727
+ this.SUBRULE4(this.expression);
16728
+ this.CONSUME2(RdfToken.RPARENT);
16729
+ }
16730
+ },
16731
+ {
16732
+ ALT: () => {
16733
+ this.CONSUME(RdfToken.STRAFTER);
16734
+ this.CONSUME3(RdfToken.LPARENT);
16735
+ this.SUBRULE5(this.expression);
16736
+ this.CONSUME3(RdfToken.COMMA);
16737
+ this.SUBRULE6(this.expression);
16738
+ this.CONSUME3(RdfToken.RPARENT);
16739
+ }
16740
+ },
16741
+ { ALT: () => this.SUBRULE(this.builtInCallStringFuncs3) }
16742
+ ]);
16743
+ }));
16744
+ /**
16745
+ * String built-ins part 3: STRLANG, STRLANGDIR, STRDT
16746
+ */
16747
+ __publicField(this, "builtInCallStringFuncs3", this.RULE("builtInCallStringFuncs3", () => {
16748
+ this.OR([
16749
+ {
16750
+ ALT: () => {
16751
+ this.CONSUME(RdfToken.STRLANG);
16752
+ this.CONSUME1(RdfToken.LPARENT);
16753
+ this.SUBRULE1(this.expression);
16754
+ this.CONSUME1(RdfToken.COMMA);
16755
+ this.SUBRULE2(this.expression);
16756
+ this.CONSUME1(RdfToken.RPARENT);
16757
+ }
16758
+ },
16759
+ {
16760
+ ALT: () => {
16761
+ this.CONSUME(RdfToken.STRLANGDIR);
16762
+ this.CONSUME2(RdfToken.LPARENT);
16763
+ this.SUBRULE3(this.expression);
16764
+ this.CONSUME2(RdfToken.COMMA);
16765
+ this.SUBRULE4(this.expression);
16766
+ this.CONSUME3(RdfToken.COMMA);
16767
+ this.SUBRULE5(this.expression);
16768
+ this.CONSUME2(RdfToken.RPARENT);
16769
+ }
16770
+ },
16771
+ {
16772
+ ALT: () => {
16773
+ this.CONSUME(RdfToken.STRDT);
16774
+ this.CONSUME3(RdfToken.LPARENT);
16775
+ this.SUBRULE6(this.expression);
16776
+ this.CONSUME4(RdfToken.COMMA);
16777
+ this.SUBRULE7(this.expression);
16778
+ this.CONSUME3(RdfToken.RPARENT);
16779
+ }
16780
+ }
16781
+ ]);
16782
+ }));
16783
+ /**
16784
+ * Numeric built-ins: ABS, CEIL, FLOOR, ROUND, RAND
16785
+ */
16786
+ __publicField(this, "builtInCallNumericFuncs", this.RULE("builtInCallNumericFuncs", () => {
16787
+ this.OR([
16788
+ {
16789
+ ALT: () => {
16790
+ this.CONSUME(RdfToken.ABS_KW);
16791
+ this.CONSUME1(RdfToken.LPARENT);
16792
+ this.SUBRULE1(this.expression);
16793
+ this.CONSUME1(RdfToken.RPARENT);
16794
+ }
16795
+ },
16796
+ {
16797
+ ALT: () => {
16798
+ this.CONSUME(RdfToken.CEIL);
16799
+ this.CONSUME2(RdfToken.LPARENT);
16800
+ this.SUBRULE2(this.expression);
16801
+ this.CONSUME2(RdfToken.RPARENT);
16802
+ }
16803
+ },
16804
+ {
16805
+ ALT: () => {
16806
+ this.CONSUME(RdfToken.FLOOR);
16807
+ this.CONSUME3(RdfToken.LPARENT);
16808
+ this.SUBRULE3(this.expression);
16809
+ this.CONSUME3(RdfToken.RPARENT);
16810
+ }
16811
+ },
16812
+ {
16813
+ ALT: () => {
16814
+ this.CONSUME(RdfToken.ROUND);
16815
+ this.CONSUME4(RdfToken.LPARENT);
16816
+ this.SUBRULE4(this.expression);
16817
+ this.CONSUME4(RdfToken.RPARENT);
16818
+ }
16819
+ },
16820
+ {
16821
+ ALT: () => {
16822
+ this.CONSUME(RdfToken.RAND);
16823
+ this.CONSUME1(RdfToken.NIL);
16824
+ }
16825
+ }
16826
+ ]);
16827
+ }));
16828
+ /**
16829
+ * Date/time built-ins: YEAR, MONTH, DAY, HOURS, MINUTES, SECONDS, TIMEZONE, TZ, NOW
16830
+ */
16831
+ __publicField(this, "builtInCallDateTimeFuncs", this.RULE("builtInCallDateTimeFuncs", () => {
16832
+ this.OR([
16833
+ {
16834
+ ALT: () => {
16835
+ this.CONSUME(RdfToken.YEAR);
16836
+ this.CONSUME1(RdfToken.LPARENT);
16837
+ this.SUBRULE1(this.expression);
16838
+ this.CONSUME1(RdfToken.RPARENT);
16839
+ }
16840
+ },
16841
+ {
16842
+ ALT: () => {
16843
+ this.CONSUME(RdfToken.MONTH);
16844
+ this.CONSUME2(RdfToken.LPARENT);
16845
+ this.SUBRULE2(this.expression);
16846
+ this.CONSUME2(RdfToken.RPARENT);
16847
+ }
16848
+ },
16849
+ {
16850
+ ALT: () => {
16851
+ this.CONSUME(RdfToken.DAY);
16852
+ this.CONSUME3(RdfToken.LPARENT);
16853
+ this.SUBRULE3(this.expression);
16854
+ this.CONSUME3(RdfToken.RPARENT);
16855
+ }
16856
+ },
16857
+ {
16858
+ ALT: () => {
16859
+ this.CONSUME(RdfToken.HOURS);
16860
+ this.CONSUME4(RdfToken.LPARENT);
16861
+ this.SUBRULE4(this.expression);
16862
+ this.CONSUME4(RdfToken.RPARENT);
16863
+ }
16864
+ },
16865
+ {
16866
+ ALT: () => {
16867
+ this.CONSUME(RdfToken.MINUTES);
16868
+ this.CONSUME5(RdfToken.LPARENT);
16869
+ this.SUBRULE5(this.expression);
16870
+ this.CONSUME5(RdfToken.RPARENT);
16871
+ }
16872
+ },
16873
+ {
16874
+ ALT: () => {
16875
+ this.CONSUME(RdfToken.SECONDS);
16876
+ this.CONSUME6(RdfToken.LPARENT);
16877
+ this.SUBRULE6(this.expression);
16878
+ this.CONSUME6(RdfToken.RPARENT);
16879
+ }
16880
+ },
16881
+ {
16882
+ ALT: () => {
16883
+ this.CONSUME(RdfToken.TIMEZONE);
16884
+ this.CONSUME7(RdfToken.LPARENT);
16885
+ this.SUBRULE7(this.expression);
16886
+ this.CONSUME7(RdfToken.RPARENT);
16887
+ }
16888
+ },
16889
+ {
16890
+ ALT: () => {
16891
+ this.CONSUME(RdfToken.TZ_KW);
16892
+ this.CONSUME8(RdfToken.LPARENT);
16893
+ this.SUBRULE8(this.expression);
16894
+ this.CONSUME8(RdfToken.RPARENT);
16895
+ }
16896
+ },
16897
+ {
16898
+ ALT: () => {
16899
+ this.CONSUME(RdfToken.NOW);
16900
+ this.CONSUME2(RdfToken.NIL);
16901
+ }
16902
+ }
16903
+ ]);
16904
+ }));
16905
+ /**
16906
+ * Hash built-ins: MD5, SHA1, SHA256, SHA384, SHA512
16907
+ */
16908
+ __publicField(this, "builtInCallHashFuncs", this.RULE("builtInCallHashFuncs", () => {
16909
+ this.OR([
16910
+ {
16911
+ ALT: () => {
16912
+ this.CONSUME(RdfToken.MD5);
16913
+ this.CONSUME1(RdfToken.LPARENT);
16914
+ this.SUBRULE1(this.expression);
16915
+ this.CONSUME1(RdfToken.RPARENT);
16916
+ }
16917
+ },
16918
+ {
16919
+ ALT: () => {
16920
+ this.CONSUME(RdfToken.SHA1);
16921
+ this.CONSUME2(RdfToken.LPARENT);
16922
+ this.SUBRULE2(this.expression);
16923
+ this.CONSUME2(RdfToken.RPARENT);
16924
+ }
16925
+ },
16926
+ {
16927
+ ALT: () => {
16928
+ this.CONSUME(RdfToken.SHA256);
16929
+ this.CONSUME3(RdfToken.LPARENT);
16930
+ this.SUBRULE3(this.expression);
16931
+ this.CONSUME3(RdfToken.RPARENT);
16932
+ }
16933
+ },
16934
+ {
16935
+ ALT: () => {
16936
+ this.CONSUME(RdfToken.SHA384);
16937
+ this.CONSUME4(RdfToken.LPARENT);
16938
+ this.SUBRULE4(this.expression);
16939
+ this.CONSUME4(RdfToken.RPARENT);
16940
+ }
16941
+ },
16942
+ {
16943
+ ALT: () => {
16944
+ this.CONSUME(RdfToken.SHA512);
16945
+ this.CONSUME5(RdfToken.LPARENT);
16946
+ this.SUBRULE5(this.expression);
16947
+ this.CONSUME5(RdfToken.RPARENT);
16948
+ }
16949
+ }
16950
+ ]);
16951
+ }));
16952
+ /**
16953
+ * Test built-ins: sameTerm, isIRI, isURI, isBLANK, isLITERAL, isNUMERIC
16954
+ */
16955
+ __publicField(this, "builtInCallTestFuncs", this.RULE("builtInCallTestFuncs", () => {
16956
+ this.OR([
16957
+ {
16958
+ ALT: () => {
16959
+ this.CONSUME(RdfToken.SAMETERM);
16960
+ this.CONSUME1(RdfToken.LPARENT);
16961
+ this.SUBRULE1(this.expression);
16962
+ this.CONSUME1(RdfToken.COMMA);
16963
+ this.SUBRULE2(this.expression);
16964
+ this.CONSUME1(RdfToken.RPARENT);
16965
+ }
16966
+ },
16967
+ {
16968
+ ALT: () => {
16969
+ this.CONSUME(RdfToken.ISIRI);
16970
+ this.CONSUME2(RdfToken.LPARENT);
16971
+ this.SUBRULE3(this.expression);
16972
+ this.CONSUME2(RdfToken.RPARENT);
16973
+ }
16974
+ },
16975
+ {
16976
+ ALT: () => {
16977
+ this.CONSUME(RdfToken.ISURI);
16978
+ this.CONSUME3(RdfToken.LPARENT);
16979
+ this.SUBRULE4(this.expression);
16980
+ this.CONSUME3(RdfToken.RPARENT);
16981
+ }
16982
+ },
16983
+ {
16984
+ ALT: () => {
16985
+ this.CONSUME(RdfToken.ISBLANK);
16986
+ this.CONSUME4(RdfToken.LPARENT);
16987
+ this.SUBRULE5(this.expression);
16988
+ this.CONSUME4(RdfToken.RPARENT);
16989
+ }
16990
+ },
16991
+ {
16992
+ ALT: () => {
16993
+ this.CONSUME(RdfToken.ISLITERAL);
16994
+ this.CONSUME5(RdfToken.LPARENT);
16995
+ this.SUBRULE6(this.expression);
16996
+ this.CONSUME5(RdfToken.RPARENT);
16997
+ }
16998
+ },
16999
+ {
17000
+ ALT: () => {
17001
+ this.CONSUME(RdfToken.ISNUMERIC);
17002
+ this.CONSUME6(RdfToken.LPARENT);
17003
+ this.SUBRULE7(this.expression);
17004
+ this.CONSUME6(RdfToken.RPARENT);
17005
+ }
17006
+ }
17007
+ ]);
17008
+ }));
17009
+ /**
17010
+ * Miscellaneous built-ins: COALESCE, IF, UUID, STRUUID
17011
+ */
17012
+ __publicField(this, "builtInCallMiscFuncs", this.RULE("builtInCallMiscFuncs", () => {
17013
+ this.OR([
17014
+ {
17015
+ ALT: () => {
17016
+ this.CONSUME(RdfToken.COALESCE);
17017
+ this.SUBRULE1(this.expressionList);
17018
+ }
17019
+ },
17020
+ {
17021
+ ALT: () => {
17022
+ this.CONSUME(RdfToken.IF_KW);
17023
+ this.CONSUME1(RdfToken.LPARENT);
17024
+ this.SUBRULE1(this.expression);
17025
+ this.CONSUME1(RdfToken.COMMA);
17026
+ this.SUBRULE2(this.expression);
17027
+ this.CONSUME2(RdfToken.COMMA);
17028
+ this.SUBRULE3(this.expression);
17029
+ this.CONSUME1(RdfToken.RPARENT);
17030
+ }
17031
+ },
17032
+ {
17033
+ ALT: () => {
17034
+ this.CONSUME(RdfToken.UUID_KW);
17035
+ this.CONSUME1(RdfToken.NIL);
17036
+ }
17037
+ },
17038
+ {
17039
+ ALT: () => {
17040
+ this.CONSUME(RdfToken.STRUUID);
17041
+ this.CONSUME2(RdfToken.NIL);
17042
+ }
17043
+ }
17044
+ ]);
17045
+ }));
17046
+ /**
17047
+ * RDF 1.2 built-ins: isTRIPLE, TRIPLE, SUBJECT, PREDICATE, OBJECT, hasLANG, hasLANGDIR
17048
+ */
17049
+ __publicField(this, "builtInCallRdf12Funcs", this.RULE("builtInCallRdf12Funcs", () => {
17050
+ this.OR([
17051
+ {
17052
+ ALT: () => {
17053
+ this.CONSUME(RdfToken.ISTRIPLE);
17054
+ this.CONSUME1(RdfToken.LPARENT);
17055
+ this.SUBRULE1(this.expression);
17056
+ this.CONSUME1(RdfToken.RPARENT);
17057
+ }
17058
+ },
17059
+ {
17060
+ ALT: () => {
17061
+ this.CONSUME(RdfToken.TRIPLE_KW);
17062
+ this.CONSUME2(RdfToken.LPARENT);
17063
+ this.SUBRULE2(this.expression);
17064
+ this.CONSUME1(RdfToken.COMMA);
17065
+ this.SUBRULE3(this.expression);
17066
+ this.CONSUME2(RdfToken.COMMA);
17067
+ this.SUBRULE4(this.expression);
17068
+ this.CONSUME2(RdfToken.RPARENT);
17069
+ }
17070
+ },
17071
+ {
17072
+ ALT: () => {
17073
+ this.CONSUME(RdfToken.SUBJECT_KW);
17074
+ this.CONSUME3(RdfToken.LPARENT);
17075
+ this.SUBRULE5(this.expression);
17076
+ this.CONSUME3(RdfToken.RPARENT);
17077
+ }
17078
+ },
17079
+ {
17080
+ ALT: () => {
17081
+ this.CONSUME(RdfToken.PREDICATE_KW);
17082
+ this.CONSUME4(RdfToken.LPARENT);
17083
+ this.SUBRULE6(this.expression);
17084
+ this.CONSUME4(RdfToken.RPARENT);
17085
+ }
17086
+ },
17087
+ {
17088
+ ALT: () => {
17089
+ this.CONSUME(RdfToken.OBJECT_KW);
17090
+ this.CONSUME5(RdfToken.LPARENT);
17091
+ this.SUBRULE7(this.expression);
17092
+ this.CONSUME5(RdfToken.RPARENT);
17093
+ }
17094
+ },
17095
+ {
17096
+ ALT: () => {
17097
+ this.CONSUME(RdfToken.HASLANG);
17098
+ this.CONSUME6(RdfToken.LPARENT);
17099
+ this.SUBRULE8(this.expression);
17100
+ this.CONSUME6(RdfToken.RPARENT);
17101
+ }
17102
+ },
17103
+ {
17104
+ ALT: () => {
17105
+ this.CONSUME(RdfToken.HASLANGDIR);
17106
+ this.CONSUME7(RdfToken.LPARENT);
17107
+ this.SUBRULE9(this.expression);
17108
+ this.CONSUME7(RdfToken.RPARENT);
17109
+ }
17110
+ }
17111
+ ]);
17112
+ }));
17113
+ /**
17114
+ * [132] RegexExpression ::= 'REGEX' '(' Expression ',' Expression (',' Expression)? ')'
17115
+ */
17116
+ __publicField(this, "regexExpression", this.RULE("regexExpression", () => {
17117
+ this.CONSUME(RdfToken.REGEX);
17118
+ this.CONSUME(RdfToken.LPARENT);
17119
+ this.SUBRULE1(this.expression);
17120
+ this.CONSUME1(RdfToken.COMMA);
17121
+ this.SUBRULE2(this.expression);
17122
+ this.OPTION(() => {
17123
+ this.CONSUME2(RdfToken.COMMA);
17124
+ this.SUBRULE3(this.expression);
17125
+ });
17126
+ this.CONSUME(RdfToken.RPARENT);
17127
+ }));
17128
+ /**
17129
+ * [133] SubstringExpression ::= 'SUBSTR' '(' Expression ',' Expression (',' Expression)? ')'
17130
+ */
17131
+ __publicField(this, "substringExpression", this.RULE("substringExpression", () => {
17132
+ this.CONSUME(RdfToken.SUBSTR);
17133
+ this.CONSUME(RdfToken.LPARENT);
17134
+ this.SUBRULE1(this.expression);
17135
+ this.CONSUME1(RdfToken.COMMA);
17136
+ this.SUBRULE2(this.expression);
17137
+ this.OPTION(() => {
17138
+ this.CONSUME2(RdfToken.COMMA);
17139
+ this.SUBRULE3(this.expression);
17140
+ });
17141
+ this.CONSUME(RdfToken.RPARENT);
17142
+ }));
17143
+ /**
17144
+ * [134] StrReplaceExpression ::= 'REPLACE' '(' Expression ',' Expression ',' Expression (',' Expression)? ')'
17145
+ */
17146
+ __publicField(this, "strReplaceExpression", this.RULE("strReplaceExpression", () => {
17147
+ this.CONSUME(RdfToken.REPLACE_KW);
17148
+ this.CONSUME(RdfToken.LPARENT);
17149
+ this.SUBRULE1(this.expression);
17150
+ this.CONSUME1(RdfToken.COMMA);
17151
+ this.SUBRULE2(this.expression);
17152
+ this.CONSUME2(RdfToken.COMMA);
17153
+ this.SUBRULE3(this.expression);
17154
+ this.OPTION(() => {
17155
+ this.CONSUME3(RdfToken.COMMA);
17156
+ this.SUBRULE4(this.expression);
17157
+ });
17158
+ this.CONSUME(RdfToken.RPARENT);
17159
+ }));
17160
+ /**
17161
+ * [135] ExistsFunc ::= 'EXISTS' GroupGraphPattern
17162
+ */
17163
+ __publicField(this, "existsFunc", this.RULE("existsFunc", () => {
17164
+ this.CONSUME(RdfToken.EXISTS);
17165
+ this.SUBRULE(this.groupGraphPattern);
17166
+ }));
17167
+ /**
17168
+ * [136] NotExistsFunc ::= 'NOT' 'EXISTS' GroupGraphPattern
17169
+ */
17170
+ __publicField(this, "notExistsFunc", this.RULE("notExistsFunc", () => {
17171
+ this.CONSUME(RdfToken.NOT);
17172
+ this.CONSUME(RdfToken.EXISTS);
17173
+ this.SUBRULE(this.groupGraphPattern);
17174
+ }));
17175
+ // ==========================================
17176
+ // Aggregate [137]
17177
+ // ==========================================
17178
+ /**
17179
+ * [137] Aggregate ::= 'COUNT' '(' 'DISTINCT'? ('*' | Expression) ')'
17180
+ * | 'SUM' '(' 'DISTINCT'? Expression ')'
17181
+ * | 'MIN' '(' 'DISTINCT'? Expression ')'
17182
+ * | 'MAX' '(' 'DISTINCT'? Expression ')'
17183
+ * | 'AVG' '(' 'DISTINCT'? Expression ')'
17184
+ * | 'SAMPLE' '(' 'DISTINCT'? Expression ')'
17185
+ * | 'GROUP_CONCAT' '(' 'DISTINCT'? Expression (';' 'SEPARATOR' '=' String)? ')'
17186
+ */
17187
+ __publicField(this, "aggregate", this.RULE("aggregate", () => {
17188
+ this.OR([
17189
+ {
17190
+ ALT: () => {
17191
+ this.CONSUME(RdfToken.COUNT);
17192
+ this.CONSUME1(RdfToken.LPARENT);
17193
+ this.OPTION1(() => this.CONSUME1(RdfToken.DISTINCT));
17194
+ this.OR2([
17195
+ { ALT: () => this.CONSUME(RdfToken.STAR) },
17196
+ { ALT: () => this.SUBRULE1(this.expression) }
17197
+ ]);
17198
+ this.CONSUME1(RdfToken.RPARENT);
17199
+ }
17200
+ },
17201
+ {
17202
+ ALT: () => {
17203
+ this.CONSUME(RdfToken.SUM);
17204
+ this.CONSUME2(RdfToken.LPARENT);
17205
+ this.OPTION2(() => this.CONSUME2(RdfToken.DISTINCT));
17206
+ this.SUBRULE2(this.expression);
17207
+ this.CONSUME2(RdfToken.RPARENT);
17208
+ }
17209
+ },
17210
+ {
17211
+ ALT: () => {
17212
+ this.CONSUME(RdfToken.MIN_KW);
17213
+ this.CONSUME3(RdfToken.LPARENT);
17214
+ this.OPTION3(() => this.CONSUME3(RdfToken.DISTINCT));
17215
+ this.SUBRULE3(this.expression);
17216
+ this.CONSUME3(RdfToken.RPARENT);
17217
+ }
17218
+ },
17219
+ {
17220
+ ALT: () => {
17221
+ this.CONSUME(RdfToken.MAX_KW);
17222
+ this.CONSUME4(RdfToken.LPARENT);
17223
+ this.OPTION4(() => this.CONSUME4(RdfToken.DISTINCT));
17224
+ this.SUBRULE4(this.expression);
17225
+ this.CONSUME4(RdfToken.RPARENT);
17226
+ }
17227
+ },
17228
+ {
17229
+ ALT: () => {
17230
+ this.CONSUME(RdfToken.AVG);
17231
+ this.CONSUME5(RdfToken.LPARENT);
17232
+ this.OPTION5(() => this.CONSUME5(RdfToken.DISTINCT));
17233
+ this.SUBRULE5(this.expression);
17234
+ this.CONSUME5(RdfToken.RPARENT);
17235
+ }
17236
+ },
17237
+ {
17238
+ ALT: () => {
17239
+ this.CONSUME(RdfToken.SAMPLE);
17240
+ this.CONSUME6(RdfToken.LPARENT);
17241
+ this.OPTION6(() => this.CONSUME6(RdfToken.DISTINCT));
17242
+ this.SUBRULE6(this.expression);
17243
+ this.CONSUME6(RdfToken.RPARENT);
17244
+ }
17245
+ },
17246
+ {
17247
+ ALT: () => {
17248
+ this.CONSUME(RdfToken.GROUP_CONCAT);
17249
+ this.CONSUME7(RdfToken.LPARENT);
17250
+ this.OPTION7(() => this.CONSUME7(RdfToken.DISTINCT));
17251
+ this.SUBRULE7(this.expression);
17252
+ this.OPTION8(() => {
17253
+ this.CONSUME(RdfToken.SEMICOLON);
17254
+ this.CONSUME(RdfToken.SEPARATOR);
17255
+ this.CONSUME(RdfToken.EQ);
17256
+ this.SUBRULE(this.string);
17257
+ });
17258
+ this.CONSUME7(RdfToken.RPARENT);
17259
+ }
17260
+ }
17261
+ ]);
17262
+ }));
17263
+ // ==========================================
17264
+ // iri / function call [138]-[139]
17265
+ // ==========================================
17266
+ /**
17267
+ * [138] iriOrFunction ::= iri ArgList?
17268
+ */
17269
+ __publicField(this, "iriOrFunction", this.RULE("iriOrFunction", () => {
17270
+ this.SUBRULE(this.iri);
17271
+ this.OPTION(() => this.SUBRULE(this.argList));
17272
+ }));
17273
+ // ==========================================
17274
+ // RDF literal / numeric / boolean [139]-[145]
17275
+ // ==========================================
17276
+ /**
17277
+ * [139] RDFLiteral ::= String (LANG_DIR | '^^' iri)?
17278
+ */
17279
+ __publicField(this, "rdfLiteral", this.RULE("rdfLiteral", () => {
17280
+ this.SUBRULE(this.string);
17281
+ this.OPTION(() => {
17282
+ this.OR([
17283
+ { ALT: () => this.CONSUME(RdfToken.LANGTAG) },
17284
+ {
17285
+ ALT: () => {
17286
+ this.CONSUME(RdfToken.DCARET);
17287
+ this.SUBRULE(this.iri);
17288
+ }
17289
+ }
17290
+ ]);
17291
+ });
17292
+ }));
17293
+ /**
17294
+ * [140] NumericLiteral ::= NumericLiteralUnsigned | NumericLiteralPositive | NumericLiteralNegative
17295
+ */
17296
+ __publicField(this, "numericLiteral", this.RULE("numericLiteral", () => {
17297
+ this.OR([
17298
+ { ALT: () => this.SUBRULE(this.numericLiteralUnsigned) },
17299
+ { ALT: () => this.SUBRULE(this.numericLiteralPositive) },
17300
+ { ALT: () => this.SUBRULE(this.numericLiteralNegative) }
17301
+ ]);
17302
+ }));
17303
+ /**
17304
+ * [141] NumericLiteralUnsigned ::= INTEGER | DECIMAL | DOUBLE
17305
+ */
17306
+ __publicField(this, "numericLiteralUnsigned", this.RULE("numericLiteralUnsigned", () => {
17307
+ this.OR([
17308
+ { ALT: () => this.CONSUME(RdfToken.INTEGER) },
17309
+ { ALT: () => this.CONSUME(RdfToken.DECIMAL) },
17310
+ { ALT: () => this.CONSUME(RdfToken.DOUBLE) }
17311
+ ]);
17312
+ }));
17313
+ /**
17314
+ * [142] NumericLiteralPositive ::= INTEGER_POSITIVE | DECIMAL_POSITIVE | DOUBLE_POSITIVE
17315
+ */
17316
+ __publicField(this, "numericLiteralPositive", this.RULE("numericLiteralPositive", () => {
17317
+ this.OR([
17318
+ { ALT: () => this.CONSUME(RdfToken.INTEGER_POSITIVE) },
17319
+ { ALT: () => this.CONSUME(RdfToken.DECIMAL_POSITIVE) },
17320
+ { ALT: () => this.CONSUME(RdfToken.DOUBLE_POSITIVE) }
17321
+ ]);
17322
+ }));
17323
+ /**
17324
+ * [143] NumericLiteralNegative ::= INTEGER_NEGATIVE | DECIMAL_NEGATIVE | DOUBLE_NEGATIVE
17325
+ */
17326
+ __publicField(this, "numericLiteralNegative", this.RULE("numericLiteralNegative", () => {
17327
+ this.OR([
17328
+ { ALT: () => this.CONSUME(RdfToken.INTEGER_NEGATIVE) },
17329
+ { ALT: () => this.CONSUME(RdfToken.DECIMAL_NEGATIVE) },
17330
+ { ALT: () => this.CONSUME(RdfToken.DOUBLE_NEGATIVE) }
17331
+ ]);
17332
+ }));
17333
+ /**
17334
+ * [144] BooleanLiteral ::= 'true' | 'false'
17335
+ */
17336
+ __publicField(this, "booleanLiteral", this.RULE("booleanLiteral", () => {
17337
+ this.OR([
17338
+ { ALT: () => this.CONSUME(RdfToken.TRUE) },
17339
+ { ALT: () => this.CONSUME(RdfToken.FALSE) }
17340
+ ]);
17341
+ }));
17342
+ /**
17343
+ * [145] String ::= STRING_LITERAL_QUOTE | STRING_LITERAL_SINGLE_QUOTE | STRING_LITERAL_LONG_QUOTE | STRING_LITERAL_LONG_SINGLE_QUOTE
17344
+ */
17345
+ __publicField(this, "string", this.RULE("string", () => {
17346
+ this.OR([
17347
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_QUOTE) },
17348
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_SINGLE_QUOTE) },
17349
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_LONG_QUOTE) },
17350
+ { ALT: () => this.CONSUME(RdfToken.STRING_LITERAL_LONG_SINGLE_QUOTE) }
17351
+ ]);
17352
+ }));
17353
+ // ==========================================
17354
+ // IRI / prefixed name [146]-[147]
17355
+ // ==========================================
17356
+ /**
17357
+ * [146] iri ::= IRIREF | PrefixedName
17358
+ */
17359
+ __publicField(this, "iri", this.RULE("iri", () => {
17360
+ this.OR([
17361
+ { ALT: () => this.CONSUME(RdfToken.IRIREF) },
17362
+ { ALT: () => this.SUBRULE(this.prefixedName) }
17363
+ ]);
17364
+ }));
17365
+ /**
17366
+ * [147] PrefixedName ::= PNAME_LN | PNAME_NS
17367
+ */
17368
+ __publicField(this, "prefixedName", this.RULE("prefixedName", () => {
17369
+ const token = this.OR([
17370
+ { ALT: () => this.CONSUME(RdfToken.PNAME_LN) },
17371
+ { ALT: () => this.CONSUME(RdfToken.PNAME_NS) }
17372
+ ]);
17373
+ if (token?.image) {
17374
+ const { prefix } = splitPrefixedName(token.image, true);
17375
+ if (this.namespaces[prefix] === void 0) {
17376
+ const error = new Error(`Undefined prefix: ${prefix}`);
17377
+ error.name = "UndefinedNamespacePrefixError";
17378
+ error.token = token;
17379
+ error.ruleStack = [...this.RULE_OCCURRENCE_STACK];
17380
+ if (this._throwOnErrors) {
17381
+ throw error;
17382
+ } else {
17383
+ this.semanticErrors.push(error);
17384
+ }
17385
+ }
17386
+ }
17387
+ }));
17388
+ /**
17389
+ * [148] BlankNode ::= BLANK_NODE_LABEL | ANON
17390
+ */
17391
+ __publicField(this, "blankNode", this.RULE("blankNode", () => {
17392
+ this.OR([
17393
+ { ALT: () => this.CONSUME(RdfToken.BLANK_NODE_LABEL) },
17394
+ { ALT: () => this.SUBRULE(this.anon) }
17395
+ ]);
17396
+ }));
17397
+ __publicField(this, "anon", this.RULE("anon", () => {
17398
+ this.CONSUME(RdfToken.LBRACKET);
17399
+ this.CONSUME(RdfToken.RBRACKET);
17400
+ }));
17401
+ // ==========================================
17402
+ // Var and helper productions
17403
+ // ==========================================
17404
+ /**
17405
+ * Var ::= VAR1 | VAR2
17406
+ */
17407
+ __publicField(this, "var", this.RULE("var", () => {
17408
+ this.OR([
17409
+ { ALT: () => this.CONSUME(RdfToken.VAR1) },
17410
+ { ALT: () => this.CONSUME(RdfToken.VAR2) }
17411
+ ]);
17412
+ }));
17413
+ /**
17414
+ * VarOrTerm ::= Var | GraphTerm
17415
+ */
17416
+ __publicField(this, "varOrTerm", this.RULE("varOrTerm", () => {
17417
+ this.OR([
17418
+ { ALT: () => this.SUBRULE(this.var) },
17419
+ { ALT: () => this.SUBRULE(this.graphTerm) }
17420
+ ]);
17421
+ }));
17422
+ /**
17423
+ * VarOrIri ::= Var | iri
17424
+ */
17425
+ __publicField(this, "varOrIri", this.RULE("varOrIri", () => {
17426
+ this.OR([
17427
+ { ALT: () => this.SUBRULE(this.var) },
17428
+ { ALT: () => this.SUBRULE(this.iri) }
17429
+ ]);
17430
+ }));
17431
+ /**
17432
+ * GraphTerm ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | NIL | TripleTerm
17433
+ */
17434
+ __publicField(this, "graphTerm", this.RULE("graphTerm", () => {
17435
+ this.OR([
17436
+ { ALT: () => this.SUBRULE(this.iri) },
17437
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
17438
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
17439
+ { ALT: () => this.SUBRULE(this.booleanLiteral) },
17440
+ { ALT: () => this.SUBRULE(this.blankNode) },
17441
+ { ALT: () => this.CONSUME(RdfToken.NIL) },
17442
+ { ALT: () => this.SUBRULE(this.tripleTerm) }
17443
+ ]);
17444
+ }));
17445
+ /**
17446
+ * Literal ::= RDFLiteral | NumericLiteral | BooleanLiteral
17447
+ */
17448
+ __publicField(this, "literal", this.RULE("literal", () => {
17449
+ this.OR([
17450
+ { ALT: () => this.SUBRULE(this.rdfLiteral) },
17451
+ { ALT: () => this.SUBRULE(this.numericLiteral) },
17452
+ { ALT: () => this.SUBRULE(this.booleanLiteral) }
17453
+ ]);
17454
+ }));
17455
+ // ==========================================
17456
+ // Graph node productions
17457
+ // ==========================================
17458
+ /**
17459
+ * [113] GraphNode ::= VarOrTerm | TriplesNode | ReifiedTriple
17460
+ */
17461
+ __publicField(this, "graphNode", this.RULE("graphNode", () => {
17462
+ this.OR([
17463
+ { ALT: () => this.SUBRULE(this.varOrTerm) },
17464
+ { ALT: () => this.SUBRULE(this.triplesNode) },
17465
+ { ALT: () => this.SUBRULE(this.reifiedTriple) }
17466
+ ]);
17467
+ }));
17468
+ /**
17469
+ * [114] GraphNodePath ::= VarOrTerm | TriplesNodePath | ReifiedTriple
17470
+ */
17471
+ __publicField(this, "graphNodePath", this.RULE("graphNodePath", () => {
17472
+ this.OR([
17473
+ { ALT: () => this.SUBRULE(this.varOrTerm) },
17474
+ { ALT: () => this.SUBRULE(this.triplesNodePath) },
17475
+ { ALT: () => this.SUBRULE(this.reifiedTriple) }
17476
+ ]);
17477
+ }));
17478
+ /**
17479
+ * TriplesNode ::= Collection | BlankNodePropertyList
17480
+ */
17481
+ __publicField(this, "triplesNode", this.RULE("triplesNode", () => {
17482
+ this.OR([
17483
+ { ALT: () => this.SUBRULE(this.collection) },
17484
+ { ALT: () => this.SUBRULE(this.blankNodePropertyList) }
17485
+ ]);
17486
+ }));
17487
+ /**
17488
+ * BlankNodePropertyList ::= '[' PropertyListNotEmpty ']'
17489
+ */
17490
+ __publicField(this, "blankNodePropertyList", this.RULE("blankNodePropertyList", () => {
17491
+ this.CONSUME(RdfToken.LBRACKET);
17492
+ this.SUBRULE(this.propertyListNotEmpty);
17493
+ this.CONSUME(RdfToken.RBRACKET);
17494
+ }));
17495
+ /**
17496
+ * TriplesNodePath ::= CollectionPath | BlankNodePropertyListPath
17497
+ */
17498
+ __publicField(this, "triplesNodePath", this.RULE("triplesNodePath", () => {
17499
+ this.OR([
17500
+ { ALT: () => this.SUBRULE(this.collectionPath) },
17501
+ { ALT: () => this.SUBRULE(this.blankNodePropertyListPath) }
17502
+ ]);
17503
+ }));
17504
+ /**
17505
+ * BlankNodePropertyListPath ::= '[' PropertyListPathNotEmpty ']'
17506
+ */
17507
+ __publicField(this, "blankNodePropertyListPath", this.RULE("blankNodePropertyListPath", () => {
17508
+ this.CONSUME(RdfToken.LBRACKET);
17509
+ this.SUBRULE(this.propertyListPathNotEmpty);
17510
+ this.CONSUME(RdfToken.RBRACKET);
17511
+ }));
17512
+ /**
17513
+ * Collection ::= '(' GraphNode+ ')'
17514
+ */
17515
+ __publicField(this, "collection", this.RULE("collection", () => {
17516
+ this.CONSUME(RdfToken.LPARENT);
17517
+ this.AT_LEAST_ONE(() => this.SUBRULE(this.graphNode));
17518
+ this.CONSUME(RdfToken.RPARENT);
17519
+ }));
17520
+ /**
17521
+ * CollectionPath ::= '(' GraphNodePath+ ')'
17522
+ */
17523
+ __publicField(this, "collectionPath", this.RULE("collectionPath", () => {
17524
+ this.CONSUME(RdfToken.LPARENT);
17525
+ this.AT_LEAST_ONE(() => this.SUBRULE(this.graphNodePath));
17526
+ this.CONSUME(RdfToken.RPARENT);
17527
+ }));
17528
+ /**
17529
+ * ValuesClause ::= ('VALUES' DataBlock)?
17530
+ */
17531
+ __publicField(this, "valuesClause", this.RULE("valuesClause", () => {
17532
+ this.OPTION(() => {
17533
+ this.CONSUME(RdfToken.VALUES);
17534
+ this.SUBRULE(this.dataBlock);
17535
+ });
17536
+ }));
17537
+ this.performSelfAnalysis();
17538
+ }
17539
+ registerNamespace(prefixToken, iriToken) {
17540
+ const prefix = prefixToken.image.slice(0, -1);
17541
+ const iri = iriToken.image.slice(1, -1);
17542
+ this.namespaces[prefix] = iri;
17543
+ }
17544
+ /**
17545
+ * Parses a set of tokens created by the lexer into a concrete syntax tree (CST) representing the parsed document.
17546
+ * @param tokens A set of tokens created by the lexer.
17547
+ * @param throwOnErrors Whether to throw an error if any parsing errors are detected. Defaults to true.
17548
+ * @returns A concrete syntax tree (CST) object.
17549
+ */
17550
+ parse(tokens, throwOnErrors = true) {
17551
+ this._throwOnErrors = throwOnErrors;
17552
+ this.semanticErrors = [];
17553
+ this.namespaces = {};
17554
+ this.input = withoutCommentTokens(tokens);
17555
+ const cst = this.queryOrUpdate();
17556
+ if (throwOnErrors && this.errors.length > 0) {
17557
+ throw new Error("Parsing errors detected:\n" + JSON.stringify(this.errors));
17558
+ }
17559
+ return cst;
17560
+ }
17561
+ };
14892
17562
 
14893
17563
  // ../mentor-rdf-parsers/dist/utils.js
14894
17564
  var BLANK_NODE_TOKEN_NAMES = /* @__PURE__ */ new Set([
@@ -16002,6 +18672,286 @@ var NQuadsReader = class extends BaseVisitor2 {
16002
18672
  // ../mentor-rdf-parsers/dist/ntriples/reader.js
16003
18673
  var BaseVisitor3 = new NTriplesParser().getBaseCstVisitorConstructor();
16004
18674
 
18675
+ // ../mentor-rdf-parsers/dist/sparql/vocabulary.js
18676
+ var SPARQL_SYNTAX_NS = "https://w3id.org/sparql-syntax#";
18677
+ var ns = (localName) => data_model_default.namedNode(SPARQL_SYNTAX_NS + localName);
18678
+ var sps = {
18679
+ // Query forms
18680
+ Query: ns("Query"),
18681
+ SelectQuery: ns("SelectQuery"),
18682
+ ConstructQuery: ns("ConstructQuery"),
18683
+ DescribeQuery: ns("DescribeQuery"),
18684
+ AskQuery: ns("AskQuery"),
18685
+ SubSelect: ns("SubSelect"),
18686
+ // Update operations
18687
+ Update: ns("Update"),
18688
+ Load: ns("Load"),
18689
+ Clear: ns("Clear"),
18690
+ Drop: ns("Drop"),
18691
+ Create: ns("Create"),
18692
+ Add: ns("Add"),
18693
+ Move: ns("Move"),
18694
+ Copy: ns("Copy"),
18695
+ InsertData: ns("InsertData"),
18696
+ DeleteData: ns("DeleteData"),
18697
+ DeleteWhere: ns("DeleteWhere"),
18698
+ Modify: ns("Modify"),
18699
+ // Terms
18700
+ Variable: ns("Variable"),
18701
+ BlankNode: ns("BlankNode"),
18702
+ TripleTerm: ns("TripleTerm"),
18703
+ // Graph pattern elements
18704
+ TriplePattern: ns("TriplePattern"),
18705
+ Group: ns("Group"),
18706
+ Optional: ns("Optional"),
18707
+ Union: ns("Union"),
18708
+ Minus: ns("Minus"),
18709
+ Graph: ns("Graph"),
18710
+ Service: ns("Service"),
18711
+ Filter: ns("Filter"),
18712
+ Bind: ns("Bind"),
18713
+ Values: ns("Values"),
18714
+ Exists: ns("Exists"),
18715
+ NotExists: ns("NotExists"),
18716
+ // Property paths
18717
+ SeqPath: ns("SeqPath"),
18718
+ AltPath: ns("AltPath"),
18719
+ InversePath: ns("InversePath"),
18720
+ ZeroOrMorePath: ns("ZeroOrMorePath"),
18721
+ OneOrMorePath: ns("OneOrMorePath"),
18722
+ ZeroOrOnePath: ns("ZeroOrOnePath"),
18723
+ NegatedPath: ns("NegatedPath"),
18724
+ // Expressions
18725
+ Expression: ns("Expression"),
18726
+ Or: ns("Or"),
18727
+ And: ns("And"),
18728
+ Eq: ns("Eq"),
18729
+ Neq: ns("Neq"),
18730
+ Lt: ns("Lt"),
18731
+ Gt: ns("Gt"),
18732
+ Leq: ns("Leq"),
18733
+ Geq: ns("Geq"),
18734
+ In: ns("In"),
18735
+ NotIn: ns("NotIn"),
18736
+ Addition: ns("Addition"),
18737
+ Subtraction: ns("Subtraction"),
18738
+ Multiplication: ns("Multiplication"),
18739
+ Division: ns("Division"),
18740
+ UnaryNot: ns("UnaryNot"),
18741
+ UnaryPlus: ns("UnaryPlus"),
18742
+ UnaryMinus: ns("UnaryMinus"),
18743
+ FunctionCall: ns("FunctionCall"),
18744
+ BuiltInCall: ns("BuiltInCall"),
18745
+ BuiltInFunction: ns("BuiltInFunction"),
18746
+ // Aggregates
18747
+ Aggregate: ns("Aggregate"),
18748
+ Count: ns("Count"),
18749
+ Sum: ns("Sum"),
18750
+ Min: ns("Min"),
18751
+ Max: ns("Max"),
18752
+ Avg: ns("Avg"),
18753
+ Sample: ns("Sample"),
18754
+ GroupConcat: ns("GroupConcat"),
18755
+ // Miscellaneous structure
18756
+ Alias: ns("Alias"),
18757
+ Asc: ns("Asc"),
18758
+ Desc: ns("Desc"),
18759
+ // Named individuals
18760
+ undef: ns("undef"),
18761
+ DefaultGraph: ns("DefaultGraph"),
18762
+ NamedGraphs: ns("NamedGraphs"),
18763
+ AllGraphs: ns("AllGraphs"),
18764
+ // Properties
18765
+ version: ns("version"),
18766
+ where: ns("where"),
18767
+ projection: ns("projection"),
18768
+ star: ns("star"),
18769
+ distinct: ns("distinct"),
18770
+ reduced: ns("reduced"),
18771
+ template: ns("template"),
18772
+ describeTargets: ns("describeTargets"),
18773
+ from: ns("from"),
18774
+ fromNamed: ns("fromNamed"),
18775
+ subject: ns("subject"),
18776
+ predicate: ns("predicate"),
18777
+ object: ns("object"),
18778
+ elements: ns("elements"),
18779
+ graph: ns("graph"),
18780
+ endpoint: ns("endpoint"),
18781
+ silent: ns("silent"),
18782
+ expression: ns("expression"),
18783
+ variable: ns("variable"),
18784
+ varName: ns("varName"),
18785
+ label: ns("label"),
18786
+ arg: ns("arg"),
18787
+ arg1: ns("arg1"),
18788
+ arg2: ns("arg2"),
18789
+ args: ns("args"),
18790
+ function: ns("function"),
18791
+ groupBy: ns("groupBy"),
18792
+ having: ns("having"),
18793
+ orderBy: ns("orderBy"),
18794
+ limit: ns("limit"),
18795
+ offset: ns("offset"),
18796
+ values: ns("values"),
18797
+ variables: ns("variables"),
18798
+ bindings: ns("bindings"),
18799
+ pathElements: ns("pathElements"),
18800
+ path: ns("path"),
18801
+ countStar: ns("countStar"),
18802
+ separator: ns("separator"),
18803
+ operations: ns("operations"),
18804
+ source: ns("source"),
18805
+ into: ns("into"),
18806
+ graphTarget: ns("graphTarget"),
18807
+ fromGraph: ns("fromGraph"),
18808
+ toGraph: ns("toGraph"),
18809
+ data: ns("data"),
18810
+ deleteTemplate: ns("deleteTemplate"),
18811
+ insertTemplate: ns("insertTemplate"),
18812
+ withGraph: ns("withGraph"),
18813
+ using: ns("using"),
18814
+ usingNamed: ns("usingNamed"),
18815
+ // Built-in function individuals
18816
+ STR: ns("STR"),
18817
+ LANG: ns("LANG"),
18818
+ LANGMATCHES: ns("LANGMATCHES"),
18819
+ LANGDIR: ns("LANGDIR"),
18820
+ DATATYPE: ns("DATATYPE"),
18821
+ IRI: ns("IRI"),
18822
+ URI: ns("URI"),
18823
+ BNODE: ns("BNODE"),
18824
+ BOUND: ns("BOUND"),
18825
+ STRLEN: ns("STRLEN"),
18826
+ UCASE: ns("UCASE"),
18827
+ LCASE: ns("LCASE"),
18828
+ ENCODE_FOR_URI: ns("ENCODE_FOR_URI"),
18829
+ CONTAINS: ns("CONTAINS"),
18830
+ STRSTARTS: ns("STRSTARTS"),
18831
+ CONCAT: ns("CONCAT"),
18832
+ STRENDS: ns("STRENDS"),
18833
+ STRBEFORE: ns("STRBEFORE"),
18834
+ STRAFTER: ns("STRAFTER"),
18835
+ STRLANG: ns("STRLANG"),
18836
+ STRLANGDIR: ns("STRLANGDIR"),
18837
+ STRDT: ns("STRDT"),
18838
+ ABS: ns("ABS"),
18839
+ CEIL: ns("CEIL"),
18840
+ FLOOR: ns("FLOOR"),
18841
+ ROUND: ns("ROUND"),
18842
+ RAND: ns("RAND"),
18843
+ YEAR: ns("YEAR"),
18844
+ MONTH: ns("MONTH"),
18845
+ DAY: ns("DAY"),
18846
+ HOURS: ns("HOURS"),
18847
+ MINUTES: ns("MINUTES"),
18848
+ SECONDS: ns("SECONDS"),
18849
+ TIMEZONE: ns("TIMEZONE"),
18850
+ TZ: ns("TZ"),
18851
+ NOW: ns("NOW"),
18852
+ MD5: ns("MD5"),
18853
+ SHA1: ns("SHA1"),
18854
+ SHA256: ns("SHA256"),
18855
+ SHA384: ns("SHA384"),
18856
+ SHA512: ns("SHA512"),
18857
+ sameTerm: ns("sameTerm"),
18858
+ isIRI: ns("isIRI"),
18859
+ isURI: ns("isURI"),
18860
+ isBLANK: ns("isBLANK"),
18861
+ isLITERAL: ns("isLITERAL"),
18862
+ isNUMERIC: ns("isNUMERIC"),
18863
+ COALESCE: ns("COALESCE"),
18864
+ IF: ns("IF"),
18865
+ UUID: ns("UUID"),
18866
+ STRUUID: ns("STRUUID"),
18867
+ isTRIPLE: ns("isTRIPLE"),
18868
+ TRIPLE: ns("TRIPLE"),
18869
+ SUBJECT: ns("SUBJECT"),
18870
+ PREDICATE: ns("PREDICATE"),
18871
+ OBJECT: ns("OBJECT"),
18872
+ hasLANG: ns("hasLANG"),
18873
+ hasLANGDIR: ns("hasLANGDIR"),
18874
+ REGEX: ns("REGEX"),
18875
+ SUBSTR: ns("SUBSTR"),
18876
+ REPLACE: ns("REPLACE")
18877
+ };
18878
+ var BUILT_IN_FUNCTIONS = {
18879
+ STR: sps.STR,
18880
+ LANG: sps.LANG,
18881
+ LANGMATCHES: sps.LANGMATCHES,
18882
+ LANGDIR: sps.LANGDIR,
18883
+ DATATYPE: sps.DATATYPE,
18884
+ IRI: sps.IRI,
18885
+ URI: sps.URI,
18886
+ BNODE: sps.BNODE,
18887
+ BOUND: sps.BOUND,
18888
+ STRLEN: sps.STRLEN,
18889
+ UCASE: sps.UCASE,
18890
+ LCASE: sps.LCASE,
18891
+ ENCODE_FOR_URI: sps.ENCODE_FOR_URI,
18892
+ CONTAINS: sps.CONTAINS,
18893
+ STRSTARTS: sps.STRSTARTS,
18894
+ CONCAT: sps.CONCAT,
18895
+ STRENDS: sps.STRENDS,
18896
+ STRBEFORE: sps.STRBEFORE,
18897
+ STRAFTER: sps.STRAFTER,
18898
+ STRLANG: sps.STRLANG,
18899
+ STRLANGDIR: sps.STRLANGDIR,
18900
+ STRDT: sps.STRDT,
18901
+ ABS: sps.ABS,
18902
+ CEIL: sps.CEIL,
18903
+ FLOOR: sps.FLOOR,
18904
+ ROUND: sps.ROUND,
18905
+ RAND: sps.RAND,
18906
+ YEAR: sps.YEAR,
18907
+ MONTH: sps.MONTH,
18908
+ DAY: sps.DAY,
18909
+ HOURS: sps.HOURS,
18910
+ MINUTES: sps.MINUTES,
18911
+ SECONDS: sps.SECONDS,
18912
+ TIMEZONE: sps.TIMEZONE,
18913
+ TZ: sps.TZ,
18914
+ NOW: sps.NOW,
18915
+ MD5: sps.MD5,
18916
+ SHA1: sps.SHA1,
18917
+ SHA256: sps.SHA256,
18918
+ SHA384: sps.SHA384,
18919
+ SHA512: sps.SHA512,
18920
+ SAMETERM: sps.sameTerm,
18921
+ ISIRI: sps.isIRI,
18922
+ ISURI: sps.isURI,
18923
+ ISBLANK: sps.isBLANK,
18924
+ ISLITERAL: sps.isLITERAL,
18925
+ ISNUMERIC: sps.isNUMERIC,
18926
+ COALESCE: sps.COALESCE,
18927
+ IF: sps.IF,
18928
+ UUID: sps.UUID,
18929
+ STRUUID: sps.STRUUID,
18930
+ ISTRIPLE: sps.isTRIPLE,
18931
+ TRIPLE: sps.TRIPLE,
18932
+ SUBJECT: sps.SUBJECT,
18933
+ PREDICATE: sps.PREDICATE,
18934
+ OBJECT: sps.OBJECT,
18935
+ HASLANG: sps.hasLANG,
18936
+ HASLANGDIR: sps.hasLANGDIR,
18937
+ REGEX: sps.REGEX,
18938
+ SUBSTR: sps.SUBSTR,
18939
+ REPLACE: sps.REPLACE
18940
+ };
18941
+
18942
+ // ../mentor-rdf-parsers/dist/sparql/reader.js
18943
+ var BaseVisitor4 = new SparqlParser().getBaseCstVisitorConstructor();
18944
+ var RDF_TYPE2 = data_model_default.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
18945
+ var RDF_FIRST2 = data_model_default.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first");
18946
+ var RDF_REST2 = data_model_default.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#rest");
18947
+ var RDF_NIL2 = data_model_default.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil");
18948
+ var RDF_REIFIES = data_model_default.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#reifies");
18949
+ var XSD_INTEGER = data_model_default.namedNode("http://www.w3.org/2001/XMLSchema#integer");
18950
+ var XSD_DECIMAL = data_model_default.namedNode("http://www.w3.org/2001/XMLSchema#decimal");
18951
+ var XSD_DOUBLE = data_model_default.namedNode("http://www.w3.org/2001/XMLSchema#double");
18952
+ var XSD_BOOLEAN = data_model_default.namedNode("http://www.w3.org/2001/XMLSchema#boolean");
18953
+ var TRUE = data_model_default.literal("true", XSD_BOOLEAN);
18954
+
16005
18955
  // ../mentor-rdf-parsers/dist/turtle/parser.js
16006
18956
  var TurtleTokens = [
16007
18957
  RdfToken.WS,
@@ -16742,11 +19692,11 @@ var TrigParser = class extends TurtleParserBase {
16742
19692
  };
16743
19693
 
16744
19694
  // ../mentor-rdf-parsers/dist/trig/reader.js
16745
- var BaseVisitor4 = new TrigParser().getBaseCstVisitorConstructor();
19695
+ var BaseVisitor5 = new TrigParser().getBaseCstVisitorConstructor();
16746
19696
 
16747
19697
  // ../mentor-rdf-parsers/dist/turtle/reader.js
16748
- var BaseVisitor5 = new TurtleParser().getBaseCstVisitorConstructor();
16749
- var TurtleReader = class extends BaseVisitor5 {
19698
+ var BaseVisitor6 = new TurtleParser().getBaseCstVisitorConstructor();
19699
+ var TurtleReader = class extends BaseVisitor6 {
16750
19700
  constructor() {
16751
19701
  super();
16752
19702
  /**
@@ -17718,6 +20668,34 @@ var TurtleReader = class extends BaseVisitor5 {
17718
20668
  }
17719
20669
  };
17720
20670
 
20671
+ // ../mentor-rdf-parsers/dist/triplate/tokens.js
20672
+ function createTriplateToken(name, metadata) {
20673
+ const token = createToken({ name, pattern: Lexer.NA });
20674
+ Object.assign(token, metadata);
20675
+ return token;
20676
+ }
20677
+ var TEMPLATE = { isTemplate: true };
20678
+ var INTERP = { isTemplate: true, isInterpolation: true, isTerm: true };
20679
+ var TriplateToken = {
20680
+ /** A `---…---` frontmatter header, emitted as a single opaque block token. */
20681
+ TRIPLATE_FRONTMATTER: createTriplateToken("TRIPLATE_FRONTMATTER", TEMPLATE),
20682
+ /** A `${…}` value interpolation standing in for a term. */
20683
+ TRIPLATE_INTERPOLATION: createTriplateToken("TRIPLATE_INTERPOLATION", INTERP),
20684
+ /** A `$<…>` IRI template standing in for an IRI. */
20685
+ TRIPLATE_IRI_TEMPLATE: createTriplateToken("TRIPLATE_IRI_TEMPLATE", INTERP),
20686
+ /** A `$"…"` string template standing in for a literal. */
20687
+ TRIPLATE_STRING_TEMPLATE: createTriplateToken("TRIPLATE_STRING_TEMPLATE", INTERP),
20688
+ /** A `{% … %}` control directive (e.g. `{% if %}` / `{% for %}`). */
20689
+ TRIPLATE_DIRECTIVE: createTriplateToken("TRIPLATE_DIRECTIVE", TEMPLATE)
20690
+ };
20691
+
20692
+ // ../mentor-rdf-parsers/dist/triplate/constructs.js
20693
+ var INLINE_TOKEN = {
20694
+ iri: TriplateToken.TRIPLATE_IRI_TEMPLATE,
20695
+ string: TriplateToken.TRIPLATE_STRING_TEMPLATE,
20696
+ value: TriplateToken.TRIPLATE_INTERPOLATION
20697
+ };
20698
+
17721
20699
  // src/rdf/store.ts
17722
20700
  var TripleNotFoundError = class extends Error {
17723
20701
  /**