@traqula/parser-sparql-1-2 0.0.4 → 0.0.6
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/lib/Parser.d.ts +185 -185
- package/lib/Parser.js +6 -6
- package/lib/Parser.js.map +1 -1
- package/lib/index.cjs +417 -416
- package/package.json +8 -8
package/lib/index.cjs
CHANGED
|
@@ -353,10 +353,10 @@ var coreJsData = root_default["__core-js_shared__"];
|
|
|
353
353
|
var coreJsData_default = coreJsData;
|
|
354
354
|
|
|
355
355
|
// ../../node_modules/lodash-es/_isMasked.js
|
|
356
|
-
var maskSrcKey = function() {
|
|
356
|
+
var maskSrcKey = (function() {
|
|
357
357
|
var uid = /[^.]+$/.exec(coreJsData_default && coreJsData_default.keys && coreJsData_default.keys.IE_PROTO || "");
|
|
358
358
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
359
|
-
}();
|
|
359
|
+
})();
|
|
360
360
|
function isMasked(func) {
|
|
361
361
|
return !!maskSrcKey && maskSrcKey in func;
|
|
362
362
|
}
|
|
@@ -418,7 +418,7 @@ var WeakMap_default = WeakMap2;
|
|
|
418
418
|
|
|
419
419
|
// ../../node_modules/lodash-es/_baseCreate.js
|
|
420
420
|
var objectCreate = Object.create;
|
|
421
|
-
var baseCreate = /* @__PURE__ */ function() {
|
|
421
|
+
var baseCreate = /* @__PURE__ */ (function() {
|
|
422
422
|
function object3() {
|
|
423
423
|
}
|
|
424
424
|
return function(proto) {
|
|
@@ -433,7 +433,7 @@ var baseCreate = /* @__PURE__ */ function() {
|
|
|
433
433
|
object3.prototype = void 0;
|
|
434
434
|
return result;
|
|
435
435
|
};
|
|
436
|
-
}();
|
|
436
|
+
})();
|
|
437
437
|
var baseCreate_default = baseCreate;
|
|
438
438
|
|
|
439
439
|
// ../../node_modules/lodash-es/_apply.js
|
|
@@ -498,14 +498,14 @@ function constant(value) {
|
|
|
498
498
|
var constant_default = constant;
|
|
499
499
|
|
|
500
500
|
// ../../node_modules/lodash-es/_defineProperty.js
|
|
501
|
-
var defineProperty = function() {
|
|
501
|
+
var defineProperty = (function() {
|
|
502
502
|
try {
|
|
503
503
|
var func = getNative_default(Object, "defineProperty");
|
|
504
504
|
func({}, "", {});
|
|
505
505
|
return func;
|
|
506
506
|
} catch (e) {
|
|
507
507
|
}
|
|
508
|
-
}();
|
|
508
|
+
})();
|
|
509
509
|
var defineProperty_default = defineProperty;
|
|
510
510
|
|
|
511
511
|
// ../../node_modules/lodash-es/_baseSetToString.js
|
|
@@ -743,9 +743,9 @@ var baseIsArguments_default = baseIsArguments;
|
|
|
743
743
|
var objectProto6 = Object.prototype;
|
|
744
744
|
var hasOwnProperty4 = objectProto6.hasOwnProperty;
|
|
745
745
|
var propertyIsEnumerable = objectProto6.propertyIsEnumerable;
|
|
746
|
-
var isArguments = baseIsArguments_default(/* @__PURE__ */ function() {
|
|
746
|
+
var isArguments = baseIsArguments_default(/* @__PURE__ */ (function() {
|
|
747
747
|
return arguments;
|
|
748
|
-
}()) ? baseIsArguments_default : function(value) {
|
|
748
|
+
})()) ? baseIsArguments_default : function(value) {
|
|
749
749
|
return isObjectLike_default(value) && hasOwnProperty4.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
750
750
|
};
|
|
751
751
|
var isArguments_default = isArguments;
|
|
@@ -811,7 +811,7 @@ var freeExports2 = typeof exports == "object" && exports && !exports.nodeType &&
|
|
|
811
811
|
var freeModule2 = freeExports2 && typeof module == "object" && module && !module.nodeType && module;
|
|
812
812
|
var moduleExports2 = freeModule2 && freeModule2.exports === freeExports2;
|
|
813
813
|
var freeProcess = moduleExports2 && freeGlobal_default.process;
|
|
814
|
-
var nodeUtil = function() {
|
|
814
|
+
var nodeUtil = (function() {
|
|
815
815
|
try {
|
|
816
816
|
var types = freeModule2 && freeModule2.require && freeModule2.require("util").types;
|
|
817
817
|
if (types) {
|
|
@@ -820,7 +820,7 @@ var nodeUtil = function() {
|
|
|
820
820
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
821
821
|
} catch (e) {
|
|
822
822
|
}
|
|
823
|
-
}();
|
|
823
|
+
})();
|
|
824
824
|
var nodeUtil_default = nodeUtil;
|
|
825
825
|
|
|
826
826
|
// ../../node_modules/lodash-es/isTypedArray.js
|
|
@@ -9372,6 +9372,7 @@ var EmbeddedActionsParser = class extends Parser {
|
|
|
9372
9372
|
|
|
9373
9373
|
// ../../packages/core/lib/lexer-builder/LexerBuilder.ts
|
|
9374
9374
|
var LexerBuilder = class _LexerBuilder {
|
|
9375
|
+
tokens;
|
|
9375
9376
|
static create(starter) {
|
|
9376
9377
|
return new _LexerBuilder(starter);
|
|
9377
9378
|
}
|
|
@@ -9468,6 +9469,7 @@ var LexerBuilder = class _LexerBuilder {
|
|
|
9468
9469
|
|
|
9469
9470
|
// ../../packages/core/lib/parser-builder/dynamicParser.ts
|
|
9470
9471
|
var DynamicParser = class extends EmbeddedActionsParser {
|
|
9472
|
+
context;
|
|
9471
9473
|
setContext(context) {
|
|
9472
9474
|
this.context = context;
|
|
9473
9475
|
}
|
|
@@ -9475,7 +9477,7 @@ var DynamicParser = class extends EmbeddedActionsParser {
|
|
|
9475
9477
|
super(tokenVocabulary, {
|
|
9476
9478
|
// RecoveryEnabled: true,
|
|
9477
9479
|
maxLookahead: 2,
|
|
9478
|
-
|
|
9480
|
+
skipValidations: true,
|
|
9479
9481
|
...config
|
|
9480
9482
|
});
|
|
9481
9483
|
this.context = void 0;
|
|
@@ -9490,7 +9492,7 @@ var DynamicParser = class extends EmbeddedActionsParser {
|
|
|
9490
9492
|
this.performSelfAnalysis();
|
|
9491
9493
|
}
|
|
9492
9494
|
constructSelfRef() {
|
|
9493
|
-
const subRuleImpl = (chevrotainSubrule) => (cstDef, ...arg) => chevrotainSubrule(this[cstDef.name], { ARGS: [this.context, ...arg] });
|
|
9495
|
+
const subRuleImpl = (chevrotainSubrule) => ((cstDef, ...arg) => chevrotainSubrule(this[cstDef.name], { ARGS: [this.context, ...arg] }));
|
|
9494
9496
|
return {
|
|
9495
9497
|
CONSUME: (tokenType, option) => this.CONSUME(tokenType, option),
|
|
9496
9498
|
CONSUME1: (tokenType, option) => this.CONSUME1(tokenType, option),
|
|
@@ -9597,6 +9599,7 @@ var ParserBuilder = class _ParserBuilder {
|
|
|
9597
9599
|
}
|
|
9598
9600
|
return new _ParserBuilder(listToRuleDefMap(start));
|
|
9599
9601
|
}
|
|
9602
|
+
rules;
|
|
9600
9603
|
constructor(startRules) {
|
|
9601
9604
|
this.rules = startRules;
|
|
9602
9605
|
}
|
|
@@ -9701,9 +9704,9 @@ ${firstError.message}`);
|
|
|
9701
9704
|
const lexer = LexerBuilder.create().add(...tokenVocabulary).build({
|
|
9702
9705
|
positionTracking: "full",
|
|
9703
9706
|
recoveryEnabled: false,
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
+
ensureOptimizations: true,
|
|
9708
|
+
safeMode: false,
|
|
9709
|
+
skipValidations: true,
|
|
9707
9710
|
...lexerConfig
|
|
9708
9711
|
});
|
|
9709
9712
|
const parser = this.consume({
|
|
@@ -9712,7 +9715,7 @@ ${firstError.message}`);
|
|
|
9712
9715
|
});
|
|
9713
9716
|
const selfSufficientParser = {};
|
|
9714
9717
|
for (const rule of Object.values(this.rules)) {
|
|
9715
|
-
selfSufficientParser[rule.name] = (input, context, ...args) => {
|
|
9718
|
+
selfSufficientParser[rule.name] = ((input, context, ...args) => {
|
|
9716
9719
|
const processedInput = queryPreProcessor(input);
|
|
9717
9720
|
const lexResult = lexer.tokenize(processedInput);
|
|
9718
9721
|
parser.input = lexResult.tokens;
|
|
@@ -9726,7 +9729,7 @@ ${firstError.message}`);
|
|
|
9726
9729
|
}
|
|
9727
9730
|
}
|
|
9728
9731
|
return result;
|
|
9729
|
-
};
|
|
9732
|
+
});
|
|
9730
9733
|
}
|
|
9731
9734
|
return selfSufficientParser;
|
|
9732
9735
|
}
|
|
@@ -9981,6 +9984,7 @@ __export(grammar_exports, {
|
|
|
9981
9984
|
quads: () => quads,
|
|
9982
9985
|
quadsNotTriples: () => quadsNotTriples,
|
|
9983
9986
|
query: () => query,
|
|
9987
|
+
queryOrUpdate: () => queryOrUpdate,
|
|
9984
9988
|
queryUnit: () => queryUnit,
|
|
9985
9989
|
rdfLiteral: () => rdfLiteral,
|
|
9986
9990
|
regexExpression: () => regexExpression,
|
|
@@ -10029,7 +10033,7 @@ __export(lexer_exports, {
|
|
|
10029
10033
|
ask: () => ask,
|
|
10030
10034
|
baseDecl: () => baseDecl,
|
|
10031
10035
|
bind: () => bind,
|
|
10032
|
-
builtIn: () =>
|
|
10036
|
+
builtIn: () => BuiltInCalls_exports,
|
|
10033
10037
|
by: () => by,
|
|
10034
10038
|
clear: () => clear,
|
|
10035
10039
|
construct: () => construct,
|
|
@@ -10066,7 +10070,7 @@ __export(lexer_exports, {
|
|
|
10066
10070
|
separator: () => separator,
|
|
10067
10071
|
service: () => service,
|
|
10068
10072
|
silent: () => silent,
|
|
10069
|
-
|
|
10073
|
+
sparql11LexerBuilder: () => sparql11LexerBuilder,
|
|
10070
10074
|
symbols: () => symbols_exports,
|
|
10071
10075
|
terminals: () => terminals_exports,
|
|
10072
10076
|
to: () => to,
|
|
@@ -10078,10 +10082,10 @@ __export(lexer_exports, {
|
|
|
10078
10082
|
where: () => where
|
|
10079
10083
|
});
|
|
10080
10084
|
|
|
10081
|
-
// ../../packages/rules-sparql-1-1/lib/lexer/
|
|
10082
|
-
var
|
|
10083
|
-
__export(
|
|
10084
|
-
|
|
10085
|
+
// ../../packages/rules-sparql-1-1/lib/lexer/BuiltInCalls.ts
|
|
10086
|
+
var BuiltInCalls_exports = {};
|
|
10087
|
+
__export(BuiltInCalls_exports, {
|
|
10088
|
+
BuiltInCalls: () => BuiltInCalls,
|
|
10085
10089
|
abs: () => abs,
|
|
10086
10090
|
allBuiltInCalls: () => allBuiltInCalls,
|
|
10087
10091
|
avg: () => avg,
|
|
@@ -10145,70 +10149,70 @@ __export(BuildinCalls_exports, {
|
|
|
10145
10149
|
uuid: () => uuid,
|
|
10146
10150
|
year: () => year
|
|
10147
10151
|
});
|
|
10148
|
-
var
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10167
|
-
|
|
10168
|
-
|
|
10169
|
-
|
|
10170
|
-
|
|
10171
|
-
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
return
|
|
10211
|
-
})(
|
|
10152
|
+
var BuiltInCalls = /* @__PURE__ */ ((BuiltInCalls2) => {
|
|
10153
|
+
BuiltInCalls2["Str"] = "builtInStr";
|
|
10154
|
+
BuiltInCalls2["Lang"] = "builtInLang";
|
|
10155
|
+
BuiltInCalls2["Langmatches"] = "builtInLangmatches";
|
|
10156
|
+
BuiltInCalls2["Datatype"] = "builtInDatatype";
|
|
10157
|
+
BuiltInCalls2["Bound"] = "builtInBound";
|
|
10158
|
+
BuiltInCalls2["Iri"] = "builtInIri";
|
|
10159
|
+
BuiltInCalls2["Uri"] = "builtInUri";
|
|
10160
|
+
BuiltInCalls2["Bnode"] = "builtInBnode";
|
|
10161
|
+
BuiltInCalls2["Rand"] = "builtInRand";
|
|
10162
|
+
BuiltInCalls2["Abs"] = "builtInAbs";
|
|
10163
|
+
BuiltInCalls2["Ceil"] = "builtInCeil";
|
|
10164
|
+
BuiltInCalls2["Floor"] = "builtInFloor";
|
|
10165
|
+
BuiltInCalls2["Round"] = "builtInRound";
|
|
10166
|
+
BuiltInCalls2["Concat"] = "builtInConcat";
|
|
10167
|
+
BuiltInCalls2["Strlen"] = "builtInStrlen";
|
|
10168
|
+
BuiltInCalls2["Ucase"] = "builtInUcase";
|
|
10169
|
+
BuiltInCalls2["Lcase"] = "builtInLcase";
|
|
10170
|
+
BuiltInCalls2["Encode_for_uri"] = "builtInEncode_for_uri";
|
|
10171
|
+
BuiltInCalls2["Contains"] = "builtInContains";
|
|
10172
|
+
BuiltInCalls2["Strstarts"] = "builtInStrstarts";
|
|
10173
|
+
BuiltInCalls2["Strends"] = "builtInStrends";
|
|
10174
|
+
BuiltInCalls2["Strbefore"] = "builtInStrbefore";
|
|
10175
|
+
BuiltInCalls2["Strafter"] = "builtInStrafter";
|
|
10176
|
+
BuiltInCalls2["Year"] = "builtInYear";
|
|
10177
|
+
BuiltInCalls2["Month"] = "builtInMonth";
|
|
10178
|
+
BuiltInCalls2["Day"] = "builtInDay";
|
|
10179
|
+
BuiltInCalls2["Hours"] = "builtInHours";
|
|
10180
|
+
BuiltInCalls2["Minutes"] = "builtInMinutes";
|
|
10181
|
+
BuiltInCalls2["Seconds"] = "builtInSeconds";
|
|
10182
|
+
BuiltInCalls2["Timezone"] = "builtInTimezone";
|
|
10183
|
+
BuiltInCalls2["Tz"] = "builtInTz";
|
|
10184
|
+
BuiltInCalls2["Now"] = "builtInNow";
|
|
10185
|
+
BuiltInCalls2["Uuid"] = "builtInUuid";
|
|
10186
|
+
BuiltInCalls2["Struuid"] = "builtInStruuid";
|
|
10187
|
+
BuiltInCalls2["Md5"] = "builtInMd5";
|
|
10188
|
+
BuiltInCalls2["Sha1"] = "builtInSha1";
|
|
10189
|
+
BuiltInCalls2["Sha256"] = "builtInSha256";
|
|
10190
|
+
BuiltInCalls2["Sha384"] = "builtInSha384";
|
|
10191
|
+
BuiltInCalls2["Sha512"] = "builtInSha512";
|
|
10192
|
+
BuiltInCalls2["Coalesce"] = "builtInCoalesce";
|
|
10193
|
+
BuiltInCalls2["If"] = "builtInIf";
|
|
10194
|
+
BuiltInCalls2["Strlang"] = "builtInStrlang";
|
|
10195
|
+
BuiltInCalls2["Strdt"] = "builtInStrdt";
|
|
10196
|
+
BuiltInCalls2["Sameterm"] = "builtInSameterm";
|
|
10197
|
+
BuiltInCalls2["Isiri"] = "builtInIsiri";
|
|
10198
|
+
BuiltInCalls2["Isuri"] = "builtInIsuri";
|
|
10199
|
+
BuiltInCalls2["Isblank"] = "builtInIsblank";
|
|
10200
|
+
BuiltInCalls2["Isliteral"] = "builtInIsliteral";
|
|
10201
|
+
BuiltInCalls2["Isnumeric"] = "builtInIsnumeric";
|
|
10202
|
+
BuiltInCalls2["Regex"] = "builtInRegex";
|
|
10203
|
+
BuiltInCalls2["Substr"] = "builtInSubstr";
|
|
10204
|
+
BuiltInCalls2["Replace"] = "builtInReplace";
|
|
10205
|
+
BuiltInCalls2["Exists"] = "builtInExists";
|
|
10206
|
+
BuiltInCalls2["Notexists"] = "builtInNotexists";
|
|
10207
|
+
BuiltInCalls2["Count"] = "builtInCount";
|
|
10208
|
+
BuiltInCalls2["Sum"] = "builtInSum";
|
|
10209
|
+
BuiltInCalls2["Min"] = "builtInMin";
|
|
10210
|
+
BuiltInCalls2["Max"] = "builtInMax";
|
|
10211
|
+
BuiltInCalls2["Avg"] = "builtInAvg";
|
|
10212
|
+
BuiltInCalls2["Sample"] = "builtInSample";
|
|
10213
|
+
BuiltInCalls2["Group_concat"] = "builtInGroup_concat";
|
|
10214
|
+
return BuiltInCalls2;
|
|
10215
|
+
})(BuiltInCalls || {});
|
|
10212
10216
|
function capitalize(string2) {
|
|
10213
10217
|
return string2.charAt(0).toUpperCase() + string2.slice(1);
|
|
10214
10218
|
}
|
|
@@ -10712,7 +10716,7 @@ var allBaseTokens = LexerBuilder.create().add(
|
|
|
10712
10716
|
notIn,
|
|
10713
10717
|
separator
|
|
10714
10718
|
);
|
|
10715
|
-
var
|
|
10719
|
+
var sparql11LexerBuilder = LexerBuilder.create(allTerminals).merge(allBaseTokens).merge(allBuiltInCalls).merge(allGraphTokens).merge(allSymbols).moveBefore(datatype, dataClause).moveAfter(avg, a).moveBefore(a, graphAll).moveAfter(groupConcat, groupByGroup);
|
|
10716
10720
|
|
|
10717
10721
|
// ../../packages/rules-sparql-1-1/lib/factoryMixins/ContextFactory.ts
|
|
10718
10722
|
var nodeType = "contextDef";
|
|
@@ -11157,10 +11161,7 @@ function SolutionModifiersFactoryMixin(Base) {
|
|
|
11157
11161
|
var nodeType8 = "term";
|
|
11158
11162
|
function TermFactoryMixin(Base) {
|
|
11159
11163
|
return class TermFactory extends Base {
|
|
11160
|
-
|
|
11161
|
-
super(...arguments);
|
|
11162
|
-
this.__blankNodeCounter = 0;
|
|
11163
|
-
}
|
|
11164
|
+
__blankNodeCounter = 0;
|
|
11164
11165
|
resetBlankNodeCounter() {
|
|
11165
11166
|
this.__blankNodeCounter = 0;
|
|
11166
11167
|
}
|
|
@@ -11899,6 +11900,120 @@ var verbA = {
|
|
|
11899
11900
|
}
|
|
11900
11901
|
};
|
|
11901
11902
|
|
|
11903
|
+
// ../../packages/rules-sparql-1-1/lib/grammar/general.ts
|
|
11904
|
+
var prologue = {
|
|
11905
|
+
name: "prologue",
|
|
11906
|
+
impl: ({ SUBRULE, MANY, OR }) => () => {
|
|
11907
|
+
const result = [];
|
|
11908
|
+
MANY(() => OR([
|
|
11909
|
+
{ ALT: () => result.push(SUBRULE(baseDecl2)) },
|
|
11910
|
+
// TODO: the [spec](https://www.w3.org/TR/sparql11-query/#iriRefs) says you cannot redefine prefixes.
|
|
11911
|
+
// We might need to check this.
|
|
11912
|
+
{ ALT: () => result.push(SUBRULE(prefixDecl2)) }
|
|
11913
|
+
]));
|
|
11914
|
+
return result;
|
|
11915
|
+
},
|
|
11916
|
+
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
11917
|
+
for (const context of ast) {
|
|
11918
|
+
if (F3.isContextDefinitionBase(context)) {
|
|
11919
|
+
SUBRULE(baseDecl2, context);
|
|
11920
|
+
} else if (F3.isContextDefinitionPrefix(context)) {
|
|
11921
|
+
SUBRULE(prefixDecl2, context);
|
|
11922
|
+
}
|
|
11923
|
+
}
|
|
11924
|
+
}
|
|
11925
|
+
};
|
|
11926
|
+
var baseDecl2 = {
|
|
11927
|
+
name: "baseDecl",
|
|
11928
|
+
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
11929
|
+
const base = CONSUME(baseDecl);
|
|
11930
|
+
const val = SUBRULE(iriFull);
|
|
11931
|
+
return ACTION(() => C.factory.contextDefinitionBase(C.factory.sourceLocation(base, val), val));
|
|
11932
|
+
},
|
|
11933
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
11934
|
+
F3.printFilter(ast, () => PRINT_WORD("BASE"));
|
|
11935
|
+
SUBRULE(iri2, ast.value);
|
|
11936
|
+
}
|
|
11937
|
+
};
|
|
11938
|
+
var prefixDecl2 = {
|
|
11939
|
+
name: "prefixDecl",
|
|
11940
|
+
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
11941
|
+
const prefix = CONSUME(prefixDecl);
|
|
11942
|
+
const name = CONSUME(terminals_exports.pNameNs).image.slice(0, -1);
|
|
11943
|
+
const value = SUBRULE(iriFull);
|
|
11944
|
+
return ACTION(() => C.factory.contextDefinitionPrefix(C.factory.sourceLocation(prefix, value), name, value));
|
|
11945
|
+
},
|
|
11946
|
+
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, { factory: F3 }) => {
|
|
11947
|
+
F3.printFilter(ast, () => {
|
|
11948
|
+
PRINT_WORDS("PREFIX", `${ast.key}:`);
|
|
11949
|
+
});
|
|
11950
|
+
SUBRULE(iri2, ast.value);
|
|
11951
|
+
}
|
|
11952
|
+
};
|
|
11953
|
+
var verb = {
|
|
11954
|
+
name: "verb",
|
|
11955
|
+
impl: ({ SUBRULE, OR }) => () => OR([
|
|
11956
|
+
{ ALT: () => SUBRULE(varOrIri) },
|
|
11957
|
+
{ ALT: () => SUBRULE(verbA) }
|
|
11958
|
+
])
|
|
11959
|
+
};
|
|
11960
|
+
var varOrTerm = {
|
|
11961
|
+
name: "varOrTerm",
|
|
11962
|
+
impl: ({ SUBRULE, OR }) => (C) => OR([
|
|
11963
|
+
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
11964
|
+
{ ALT: () => SUBRULE(graphTerm) }
|
|
11965
|
+
]),
|
|
11966
|
+
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
11967
|
+
if (F3.isTermVariable(ast)) {
|
|
11968
|
+
return SUBRULE(var_, ast);
|
|
11969
|
+
}
|
|
11970
|
+
return SUBRULE(graphTerm, ast);
|
|
11971
|
+
}
|
|
11972
|
+
};
|
|
11973
|
+
var varOrIri = {
|
|
11974
|
+
name: "varOrIri",
|
|
11975
|
+
impl: ({ SUBRULE, OR }) => (C) => OR([
|
|
11976
|
+
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
11977
|
+
{ ALT: () => SUBRULE(iri2) }
|
|
11978
|
+
])
|
|
11979
|
+
};
|
|
11980
|
+
var var_ = {
|
|
11981
|
+
name: "var",
|
|
11982
|
+
impl: ({ ACTION, CONSUME, OR }) => (C) => {
|
|
11983
|
+
const varToken = OR([
|
|
11984
|
+
{ ALT: () => CONSUME(terminals_exports.var1) },
|
|
11985
|
+
{ ALT: () => CONSUME(terminals_exports.var2) }
|
|
11986
|
+
]);
|
|
11987
|
+
return ACTION(() => C.factory.variable(varToken.image.slice(1), C.factory.sourceLocation(varToken)));
|
|
11988
|
+
},
|
|
11989
|
+
gImpl: ({ PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
11990
|
+
F3.printFilter(ast, () => PRINT_WORD(`?${ast.value}`));
|
|
11991
|
+
}
|
|
11992
|
+
};
|
|
11993
|
+
var graphTerm = {
|
|
11994
|
+
name: "graphTerm",
|
|
11995
|
+
impl: ({ ACTION, SUBRULE, CONSUME, OR }) => (C) => OR([
|
|
11996
|
+
{ ALT: () => SUBRULE(iri2) },
|
|
11997
|
+
{ ALT: () => SUBRULE(rdfLiteral) },
|
|
11998
|
+
{ ALT: () => SUBRULE(numericLiteral) },
|
|
11999
|
+
{ ALT: () => SUBRULE(booleanLiteral) },
|
|
12000
|
+
{ GATE: () => C.parseMode.has("canCreateBlankNodes"), ALT: () => SUBRULE(blankNode) },
|
|
12001
|
+
{ ALT: () => {
|
|
12002
|
+
const tokenNil = CONSUME(terminals_exports.nil);
|
|
12003
|
+
return ACTION(() => C.factory.namedNode(C.factory.sourceLocation(tokenNil), "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" /* NIL */));
|
|
12004
|
+
} }
|
|
12005
|
+
]),
|
|
12006
|
+
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
12007
|
+
if (F3.isTermNamed(ast)) {
|
|
12008
|
+
SUBRULE(iri2, ast);
|
|
12009
|
+
} else if (F3.isTermLiteral(ast)) {
|
|
12010
|
+
SUBRULE(rdfLiteral, ast);
|
|
12011
|
+
} else if (F3.isTermBlank(ast)) {
|
|
12012
|
+
SUBRULE(blankNode, ast);
|
|
12013
|
+
}
|
|
12014
|
+
}
|
|
12015
|
+
};
|
|
12016
|
+
|
|
11902
12017
|
// ../../packages/rules-sparql-1-1/lib/grammar/dataSetClause.ts
|
|
11903
12018
|
function datasetClauseUsing(name, token) {
|
|
11904
12019
|
return {
|
|
@@ -12154,55 +12269,55 @@ function baseAggregateFunc(func) {
|
|
|
12154
12269
|
}
|
|
12155
12270
|
|
|
12156
12271
|
// ../../packages/rules-sparql-1-1/lib/grammar/builtIn.ts
|
|
12157
|
-
var builtInStr = funcExpr1(
|
|
12158
|
-
var builtInLang = funcExpr1(
|
|
12159
|
-
var builtInLangmatches = funcExpr2(
|
|
12160
|
-
var builtInDatatype = funcExpr1(
|
|
12161
|
-
var builtInBound = funcVar1(
|
|
12162
|
-
var builtInIri = funcExpr1(
|
|
12163
|
-
var builtInUri = funcExpr1(
|
|
12164
|
-
var builtInBnodeSparqlJs = funcExprOrNil1(
|
|
12165
|
-
var builtInRand = funcNil1(
|
|
12166
|
-
var builtInAbs = funcExpr1(
|
|
12167
|
-
var builtInCeil = funcExpr1(
|
|
12168
|
-
var builtInFloor = funcExpr1(
|
|
12169
|
-
var builtInRound = funcExpr1(
|
|
12170
|
-
var builtInConcat = funcExprList1(
|
|
12171
|
-
var builtInStrlen = funcExpr1(
|
|
12172
|
-
var builtInUcase = funcExpr1(
|
|
12173
|
-
var builtInLcase = funcExpr1(
|
|
12174
|
-
var builtInEncode_for_uri = funcExpr1(
|
|
12175
|
-
var builtInContains = funcExpr2(
|
|
12176
|
-
var builtInStrstarts = funcExpr2(
|
|
12177
|
-
var builtInStrends = funcExpr2(
|
|
12178
|
-
var builtInStrbefore = funcExpr2(
|
|
12179
|
-
var builtInStrafter = funcExpr2(
|
|
12180
|
-
var builtInYear = funcExpr1(
|
|
12181
|
-
var builtInMonth = funcExpr1(
|
|
12182
|
-
var builtInDay = funcExpr1(
|
|
12183
|
-
var builtInHours = funcExpr1(
|
|
12184
|
-
var builtInMinutes = funcExpr1(
|
|
12185
|
-
var builtInSeconds = funcExpr1(
|
|
12186
|
-
var builtInTimezone = funcExpr1(
|
|
12187
|
-
var builtInTz = funcExpr1(
|
|
12188
|
-
var builtInNow = funcNil1(
|
|
12189
|
-
var builtInUuid = funcNil1(
|
|
12190
|
-
var builtInStruuid = funcNil1(
|
|
12191
|
-
var builtInMd5 = funcExpr1(
|
|
12192
|
-
var builtInSha1 = funcExpr1(
|
|
12193
|
-
var builtInSha256 = funcExpr1(
|
|
12194
|
-
var builtInSha384 = funcExpr1(
|
|
12195
|
-
var builtInSha512 = funcExpr1(
|
|
12196
|
-
var builtInCoalesce = funcExprList1(
|
|
12197
|
-
var builtInIf = funcExpr3(
|
|
12198
|
-
var builtInStrlang = funcExpr2(
|
|
12199
|
-
var builtInStrdt = funcExpr2(
|
|
12200
|
-
var builtInSameterm = funcExpr2(
|
|
12201
|
-
var builtInIsiri = funcExpr1(
|
|
12202
|
-
var builtInIsuri = funcExpr1(
|
|
12203
|
-
var builtInIsblank = funcExpr1(
|
|
12204
|
-
var builtInIsliteral = funcExpr1(
|
|
12205
|
-
var builtInIsnumeric = funcExpr1(
|
|
12272
|
+
var builtInStr = funcExpr1(BuiltInCalls_exports.str);
|
|
12273
|
+
var builtInLang = funcExpr1(BuiltInCalls_exports.lang);
|
|
12274
|
+
var builtInLangmatches = funcExpr2(BuiltInCalls_exports.langmatches);
|
|
12275
|
+
var builtInDatatype = funcExpr1(BuiltInCalls_exports.datatype);
|
|
12276
|
+
var builtInBound = funcVar1(BuiltInCalls_exports.bound);
|
|
12277
|
+
var builtInIri = funcExpr1(BuiltInCalls_exports.iri);
|
|
12278
|
+
var builtInUri = funcExpr1(BuiltInCalls_exports.uri);
|
|
12279
|
+
var builtInBnodeSparqlJs = funcExprOrNil1(BuiltInCalls_exports.bnode);
|
|
12280
|
+
var builtInRand = funcNil1(BuiltInCalls_exports.rand);
|
|
12281
|
+
var builtInAbs = funcExpr1(BuiltInCalls_exports.abs);
|
|
12282
|
+
var builtInCeil = funcExpr1(BuiltInCalls_exports.ceil);
|
|
12283
|
+
var builtInFloor = funcExpr1(BuiltInCalls_exports.floor);
|
|
12284
|
+
var builtInRound = funcExpr1(BuiltInCalls_exports.round);
|
|
12285
|
+
var builtInConcat = funcExprList1(BuiltInCalls_exports.concat);
|
|
12286
|
+
var builtInStrlen = funcExpr1(BuiltInCalls_exports.strlen);
|
|
12287
|
+
var builtInUcase = funcExpr1(BuiltInCalls_exports.ucase);
|
|
12288
|
+
var builtInLcase = funcExpr1(BuiltInCalls_exports.lcase);
|
|
12289
|
+
var builtInEncode_for_uri = funcExpr1(BuiltInCalls_exports.encode_for_uri);
|
|
12290
|
+
var builtInContains = funcExpr2(BuiltInCalls_exports.contains);
|
|
12291
|
+
var builtInStrstarts = funcExpr2(BuiltInCalls_exports.strstarts);
|
|
12292
|
+
var builtInStrends = funcExpr2(BuiltInCalls_exports.strends);
|
|
12293
|
+
var builtInStrbefore = funcExpr2(BuiltInCalls_exports.strbefore);
|
|
12294
|
+
var builtInStrafter = funcExpr2(BuiltInCalls_exports.strafter);
|
|
12295
|
+
var builtInYear = funcExpr1(BuiltInCalls_exports.year);
|
|
12296
|
+
var builtInMonth = funcExpr1(BuiltInCalls_exports.month);
|
|
12297
|
+
var builtInDay = funcExpr1(BuiltInCalls_exports.day);
|
|
12298
|
+
var builtInHours = funcExpr1(BuiltInCalls_exports.hours);
|
|
12299
|
+
var builtInMinutes = funcExpr1(BuiltInCalls_exports.minutes);
|
|
12300
|
+
var builtInSeconds = funcExpr1(BuiltInCalls_exports.seconds);
|
|
12301
|
+
var builtInTimezone = funcExpr1(BuiltInCalls_exports.timezone);
|
|
12302
|
+
var builtInTz = funcExpr1(BuiltInCalls_exports.tz);
|
|
12303
|
+
var builtInNow = funcNil1(BuiltInCalls_exports.now);
|
|
12304
|
+
var builtInUuid = funcNil1(BuiltInCalls_exports.uuid);
|
|
12305
|
+
var builtInStruuid = funcNil1(BuiltInCalls_exports.struuid);
|
|
12306
|
+
var builtInMd5 = funcExpr1(BuiltInCalls_exports.md5);
|
|
12307
|
+
var builtInSha1 = funcExpr1(BuiltInCalls_exports.sha1);
|
|
12308
|
+
var builtInSha256 = funcExpr1(BuiltInCalls_exports.sha256);
|
|
12309
|
+
var builtInSha384 = funcExpr1(BuiltInCalls_exports.sha384);
|
|
12310
|
+
var builtInSha512 = funcExpr1(BuiltInCalls_exports.sha512);
|
|
12311
|
+
var builtInCoalesce = funcExprList1(BuiltInCalls_exports.coalesce);
|
|
12312
|
+
var builtInIf = funcExpr3(BuiltInCalls_exports.if_);
|
|
12313
|
+
var builtInStrlang = funcExpr2(BuiltInCalls_exports.strlang);
|
|
12314
|
+
var builtInStrdt = funcExpr2(BuiltInCalls_exports.strdt);
|
|
12315
|
+
var builtInSameterm = funcExpr2(BuiltInCalls_exports.sameterm);
|
|
12316
|
+
var builtInIsiri = funcExpr1(BuiltInCalls_exports.isiri);
|
|
12317
|
+
var builtInIsuri = funcExpr1(BuiltInCalls_exports.isuri);
|
|
12318
|
+
var builtInIsblank = funcExpr1(BuiltInCalls_exports.isblank);
|
|
12319
|
+
var builtInIsliteral = funcExpr1(BuiltInCalls_exports.isliteral);
|
|
12320
|
+
var builtInIsnumeric = funcExpr1(BuiltInCalls_exports.isnumeric);
|
|
12206
12321
|
function builtInCallList(SUBRULE) {
|
|
12207
12322
|
return [
|
|
12208
12323
|
{ ALT: () => SUBRULE(aggregate) },
|
|
@@ -12274,15 +12389,15 @@ var builtInCall = {
|
|
|
12274
12389
|
return OR(builtIns);
|
|
12275
12390
|
}
|
|
12276
12391
|
};
|
|
12277
|
-
var regexExpression = funcExpr2or3(
|
|
12278
|
-
var substringExpression = funcExpr2or3(
|
|
12279
|
-
var strReplaceExpression = funcExpr3or4(
|
|
12280
|
-
var existsFunc = funcGroupGraphPattern(
|
|
12281
|
-
var notExistsFunc = funcGroupGraphPattern(
|
|
12392
|
+
var regexExpression = funcExpr2or3(BuiltInCalls_exports.regex);
|
|
12393
|
+
var substringExpression = funcExpr2or3(BuiltInCalls_exports.substr);
|
|
12394
|
+
var strReplaceExpression = funcExpr3or4(BuiltInCalls_exports.replace);
|
|
12395
|
+
var existsFunc = funcGroupGraphPattern(BuiltInCalls_exports.exists);
|
|
12396
|
+
var notExistsFunc = funcGroupGraphPattern(BuiltInCalls_exports.notexists);
|
|
12282
12397
|
var aggregateCount = {
|
|
12283
|
-
name: unCapitalize(
|
|
12398
|
+
name: unCapitalize(BuiltInCalls_exports.count.name),
|
|
12284
12399
|
impl: ({ ACTION, CONSUME, SUBRULE, OR, OPTION }) => (C) => {
|
|
12285
|
-
const operatorToken = CONSUME(
|
|
12400
|
+
const operatorToken = CONSUME(BuiltInCalls_exports.count);
|
|
12286
12401
|
CONSUME(symbols_exports.LParen);
|
|
12287
12402
|
const distinctToken = OPTION(() => CONSUME(distinct));
|
|
12288
12403
|
const expressionVal = OR([
|
|
@@ -12314,15 +12429,15 @@ var aggregateCount = {
|
|
|
12314
12429
|
});
|
|
12315
12430
|
}
|
|
12316
12431
|
};
|
|
12317
|
-
var aggregateSum = baseAggregateFunc(
|
|
12318
|
-
var aggregateMin = baseAggregateFunc(
|
|
12319
|
-
var aggregateMax = baseAggregateFunc(
|
|
12320
|
-
var aggregateAvg = baseAggregateFunc(
|
|
12321
|
-
var aggregateSample = baseAggregateFunc(
|
|
12432
|
+
var aggregateSum = baseAggregateFunc(BuiltInCalls_exports.sum);
|
|
12433
|
+
var aggregateMin = baseAggregateFunc(BuiltInCalls_exports.min);
|
|
12434
|
+
var aggregateMax = baseAggregateFunc(BuiltInCalls_exports.max);
|
|
12435
|
+
var aggregateAvg = baseAggregateFunc(BuiltInCalls_exports.avg);
|
|
12436
|
+
var aggregateSample = baseAggregateFunc(BuiltInCalls_exports.sample);
|
|
12322
12437
|
var aggregateGroup_concat = {
|
|
12323
|
-
name: unCapitalize(
|
|
12438
|
+
name: unCapitalize(BuiltInCalls_exports.groupConcat.name),
|
|
12324
12439
|
impl: ({ ACTION, CONSUME, OPTION1, SUBRULE, OPTION2 }) => (C) => {
|
|
12325
|
-
const operatorToken = CONSUME(
|
|
12440
|
+
const operatorToken = CONSUME(BuiltInCalls_exports.groupConcat);
|
|
12326
12441
|
CONSUME(symbols_exports.LParen);
|
|
12327
12442
|
const distinctToken = OPTION1(() => CONSUME(distinct));
|
|
12328
12443
|
const expr = SUBRULE(expression);
|
|
@@ -12390,120 +12505,6 @@ var aggregate = {
|
|
|
12390
12505
|
}
|
|
12391
12506
|
};
|
|
12392
12507
|
|
|
12393
|
-
// ../../packages/rules-sparql-1-1/lib/grammar/general.ts
|
|
12394
|
-
var prologue = {
|
|
12395
|
-
name: "prologue",
|
|
12396
|
-
impl: ({ SUBRULE, MANY, OR }) => () => {
|
|
12397
|
-
const result = [];
|
|
12398
|
-
MANY(() => OR([
|
|
12399
|
-
{ ALT: () => result.push(SUBRULE(baseDecl2)) },
|
|
12400
|
-
// TODO: the [spec](https://www.w3.org/TR/sparql11-query/#iriRefs) says you cannot redefine prefixes.
|
|
12401
|
-
// We might need to check this.
|
|
12402
|
-
{ ALT: () => result.push(SUBRULE(prefixDecl2)) }
|
|
12403
|
-
]));
|
|
12404
|
-
return result;
|
|
12405
|
-
},
|
|
12406
|
-
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
12407
|
-
for (const context of ast) {
|
|
12408
|
-
if (F3.isContextDefinitionBase(context)) {
|
|
12409
|
-
SUBRULE(baseDecl2, context);
|
|
12410
|
-
} else if (F3.isContextDefinitionPrefix(context)) {
|
|
12411
|
-
SUBRULE(prefixDecl2, context);
|
|
12412
|
-
}
|
|
12413
|
-
}
|
|
12414
|
-
}
|
|
12415
|
-
};
|
|
12416
|
-
var baseDecl2 = {
|
|
12417
|
-
name: "baseDecl",
|
|
12418
|
-
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
12419
|
-
const base = CONSUME(baseDecl);
|
|
12420
|
-
const val = SUBRULE(iriFull);
|
|
12421
|
-
return ACTION(() => C.factory.contextDefinitionBase(C.factory.sourceLocation(base, val), val));
|
|
12422
|
-
},
|
|
12423
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
12424
|
-
F3.printFilter(ast, () => PRINT_WORD("BASE"));
|
|
12425
|
-
SUBRULE(iri2, ast.value);
|
|
12426
|
-
}
|
|
12427
|
-
};
|
|
12428
|
-
var prefixDecl2 = {
|
|
12429
|
-
name: "prefixDecl",
|
|
12430
|
-
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
12431
|
-
const prefix = CONSUME(prefixDecl);
|
|
12432
|
-
const name = CONSUME(terminals_exports.pNameNs).image.slice(0, -1);
|
|
12433
|
-
const value = SUBRULE(iriFull);
|
|
12434
|
-
return ACTION(() => C.factory.contextDefinitionPrefix(C.factory.sourceLocation(prefix, value), name, value));
|
|
12435
|
-
},
|
|
12436
|
-
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, { factory: F3 }) => {
|
|
12437
|
-
F3.printFilter(ast, () => {
|
|
12438
|
-
PRINT_WORDS("PREFIX", `${ast.key}:`);
|
|
12439
|
-
});
|
|
12440
|
-
SUBRULE(iri2, ast.value);
|
|
12441
|
-
}
|
|
12442
|
-
};
|
|
12443
|
-
var verb = {
|
|
12444
|
-
name: "verb",
|
|
12445
|
-
impl: ({ SUBRULE, OR }) => () => OR([
|
|
12446
|
-
{ ALT: () => SUBRULE(varOrIri) },
|
|
12447
|
-
{ ALT: () => SUBRULE(verbA) }
|
|
12448
|
-
])
|
|
12449
|
-
};
|
|
12450
|
-
var varOrTerm = {
|
|
12451
|
-
name: "varOrTerm",
|
|
12452
|
-
impl: ({ SUBRULE, OR }) => (C) => OR([
|
|
12453
|
-
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
12454
|
-
{ ALT: () => SUBRULE(graphTerm) }
|
|
12455
|
-
]),
|
|
12456
|
-
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
12457
|
-
if (F3.isTermVariable(ast)) {
|
|
12458
|
-
return SUBRULE(var_, ast);
|
|
12459
|
-
}
|
|
12460
|
-
return SUBRULE(graphTerm, ast);
|
|
12461
|
-
}
|
|
12462
|
-
};
|
|
12463
|
-
var varOrIri = {
|
|
12464
|
-
name: "varOrIri",
|
|
12465
|
-
impl: ({ SUBRULE, OR }) => (C) => OR([
|
|
12466
|
-
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
12467
|
-
{ ALT: () => SUBRULE(iri2) }
|
|
12468
|
-
])
|
|
12469
|
-
};
|
|
12470
|
-
var var_ = {
|
|
12471
|
-
name: "var",
|
|
12472
|
-
impl: ({ ACTION, CONSUME, OR }) => (C) => {
|
|
12473
|
-
const varToken = OR([
|
|
12474
|
-
{ ALT: () => CONSUME(terminals_exports.var1) },
|
|
12475
|
-
{ ALT: () => CONSUME(terminals_exports.var2) }
|
|
12476
|
-
]);
|
|
12477
|
-
return ACTION(() => C.factory.variable(varToken.image.slice(1), C.factory.sourceLocation(varToken)));
|
|
12478
|
-
},
|
|
12479
|
-
gImpl: ({ PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
12480
|
-
F3.printFilter(ast, () => PRINT_WORD(`?${ast.value}`));
|
|
12481
|
-
}
|
|
12482
|
-
};
|
|
12483
|
-
var graphTerm = {
|
|
12484
|
-
name: "graphTerm",
|
|
12485
|
-
impl: ({ ACTION, SUBRULE, CONSUME, OR }) => (C) => OR([
|
|
12486
|
-
{ ALT: () => SUBRULE(iri2) },
|
|
12487
|
-
{ ALT: () => SUBRULE(rdfLiteral) },
|
|
12488
|
-
{ ALT: () => SUBRULE(numericLiteral) },
|
|
12489
|
-
{ ALT: () => SUBRULE(booleanLiteral) },
|
|
12490
|
-
{ GATE: () => C.parseMode.has("canCreateBlankNodes"), ALT: () => SUBRULE(blankNode) },
|
|
12491
|
-
{ ALT: () => {
|
|
12492
|
-
const tokenNil = CONSUME(terminals_exports.nil);
|
|
12493
|
-
return ACTION(() => C.factory.namedNode(C.factory.sourceLocation(tokenNil), "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" /* NIL */));
|
|
12494
|
-
} }
|
|
12495
|
-
]),
|
|
12496
|
-
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
12497
|
-
if (F3.isTermNamed(ast)) {
|
|
12498
|
-
SUBRULE(iri2, ast);
|
|
12499
|
-
} else if (F3.isTermLiteral(ast)) {
|
|
12500
|
-
SUBRULE(rdfLiteral, ast);
|
|
12501
|
-
} else if (F3.isTermBlank(ast)) {
|
|
12502
|
-
SUBRULE(blankNode, ast);
|
|
12503
|
-
}
|
|
12504
|
-
}
|
|
12505
|
-
};
|
|
12506
|
-
|
|
12507
12508
|
// ../../packages/rules-sparql-1-1/lib/grammar/propertyPaths.ts
|
|
12508
12509
|
var path = {
|
|
12509
12510
|
name: "path",
|
|
@@ -14759,6 +14760,68 @@ var quadsNotTriples = {
|
|
|
14759
14760
|
}
|
|
14760
14761
|
};
|
|
14761
14762
|
|
|
14763
|
+
// ../../packages/rules-sparql-1-1/lib/grammar/index.ts
|
|
14764
|
+
var queryOrUpdate = {
|
|
14765
|
+
name: "queryOrUpdate",
|
|
14766
|
+
impl: ({ ACTION, SUBRULE, OR1, OR2, MANY, OPTION1, CONSUME, SUBRULE2 }) => (C) => {
|
|
14767
|
+
const prologueValues = SUBRULE(prologue);
|
|
14768
|
+
return OR1([
|
|
14769
|
+
{ ALT: () => {
|
|
14770
|
+
const subType = OR2([
|
|
14771
|
+
{ ALT: () => SUBRULE(selectQuery) },
|
|
14772
|
+
{ ALT: () => SUBRULE(constructQuery) },
|
|
14773
|
+
{ ALT: () => SUBRULE(describeQuery) },
|
|
14774
|
+
{ ALT: () => SUBRULE(askQuery) }
|
|
14775
|
+
]);
|
|
14776
|
+
const values3 = SUBRULE(valuesClause);
|
|
14777
|
+
return ACTION(() => ({
|
|
14778
|
+
context: prologueValues,
|
|
14779
|
+
...subType,
|
|
14780
|
+
type: "query",
|
|
14781
|
+
...values3 && { values: values3 },
|
|
14782
|
+
loc: C.factory.sourceLocation(
|
|
14783
|
+
prologueValues.at(0),
|
|
14784
|
+
subType,
|
|
14785
|
+
values3
|
|
14786
|
+
)
|
|
14787
|
+
}));
|
|
14788
|
+
} },
|
|
14789
|
+
{ ALT: () => {
|
|
14790
|
+
const updates = [];
|
|
14791
|
+
updates.push({ context: prologueValues });
|
|
14792
|
+
let parsedSemi = true;
|
|
14793
|
+
MANY({
|
|
14794
|
+
GATE: () => parsedSemi,
|
|
14795
|
+
DEF: () => {
|
|
14796
|
+
parsedSemi = false;
|
|
14797
|
+
updates.at(-1).operation = SUBRULE(update1);
|
|
14798
|
+
OPTION1(() => {
|
|
14799
|
+
CONSUME(symbols_exports.semi);
|
|
14800
|
+
parsedSemi = true;
|
|
14801
|
+
const innerPrologue = SUBRULE2(prologue);
|
|
14802
|
+
updates.push({ context: innerPrologue });
|
|
14803
|
+
});
|
|
14804
|
+
}
|
|
14805
|
+
});
|
|
14806
|
+
return ACTION(() => {
|
|
14807
|
+
const update2 = {
|
|
14808
|
+
type: "update",
|
|
14809
|
+
updates,
|
|
14810
|
+
loc: C.factory.sourceLocation(
|
|
14811
|
+
...updates[0].context,
|
|
14812
|
+
updates[0].operation,
|
|
14813
|
+
...updates.at(-1).context,
|
|
14814
|
+
updates.at(-1)?.operation
|
|
14815
|
+
)
|
|
14816
|
+
};
|
|
14817
|
+
updateNoReuseBlankNodeLabels(update2);
|
|
14818
|
+
return update2;
|
|
14819
|
+
});
|
|
14820
|
+
} }
|
|
14821
|
+
]);
|
|
14822
|
+
}
|
|
14823
|
+
};
|
|
14824
|
+
|
|
14762
14825
|
// ../parser-sparql-1-1/lib/expressionParser.ts
|
|
14763
14826
|
var rulesNoBuiltIn = [
|
|
14764
14827
|
grammar_exports.expression,
|
|
@@ -14882,7 +14945,7 @@ var rules = [
|
|
|
14882
14945
|
grammar_exports.numericLiteralPositive,
|
|
14883
14946
|
grammar_exports.numericLiteralNegative
|
|
14884
14947
|
];
|
|
14885
|
-
var
|
|
14948
|
+
var objectListParserBuilder = ParserBuilder.create(rules);
|
|
14886
14949
|
|
|
14887
14950
|
// ../parser-sparql-1-1/lib/triplesBlockParser.ts
|
|
14888
14951
|
var triplesBlockParserBuilder = ParserBuilder.create([
|
|
@@ -14896,7 +14959,7 @@ var triplesBlockParserBuilder = ParserBuilder.create([
|
|
|
14896
14959
|
grammar_exports.verbPath,
|
|
14897
14960
|
grammar_exports.verbSimple,
|
|
14898
14961
|
grammar_exports.objectListPath
|
|
14899
|
-
]).merge(
|
|
14962
|
+
]).merge(objectListParserBuilder, []).addMany(
|
|
14900
14963
|
grammar_exports.path,
|
|
14901
14964
|
grammar_exports.pathAlternative,
|
|
14902
14965
|
grammar_exports.pathSequence,
|
|
@@ -15056,70 +15119,10 @@ var updateParserBuilder = ParserBuilder.create(updateNoModifyParserBuilder).patc
|
|
|
15056
15119
|
grammar_exports.sourceSelector,
|
|
15057
15120
|
grammar_exports.usingClauseStar,
|
|
15058
15121
|
grammar_exports.groupGraphPattern
|
|
15059
|
-
).merge(
|
|
15122
|
+
).merge(objectListParserBuilder, []).merge(subSelectParserBuilder, []);
|
|
15060
15123
|
|
|
15061
15124
|
// ../parser-sparql-1-1/lib/Parser.ts
|
|
15062
|
-
var
|
|
15063
|
-
name: "queryOrUpdate",
|
|
15064
|
-
impl: ({ ACTION, SUBRULE, OR1, OR2, MANY, OPTION1, CONSUME, SUBRULE2 }) => (C) => {
|
|
15065
|
-
const prologueValues = SUBRULE(grammar_exports.prologue);
|
|
15066
|
-
return OR1([
|
|
15067
|
-
{ ALT: () => {
|
|
15068
|
-
const subType = OR2([
|
|
15069
|
-
{ ALT: () => SUBRULE(grammar_exports.selectQuery) },
|
|
15070
|
-
{ ALT: () => SUBRULE(grammar_exports.constructQuery) },
|
|
15071
|
-
{ ALT: () => SUBRULE(grammar_exports.describeQuery) },
|
|
15072
|
-
{ ALT: () => SUBRULE(grammar_exports.askQuery) }
|
|
15073
|
-
]);
|
|
15074
|
-
const values3 = SUBRULE(grammar_exports.valuesClause);
|
|
15075
|
-
return ACTION(() => ({
|
|
15076
|
-
context: prologueValues,
|
|
15077
|
-
...subType,
|
|
15078
|
-
type: "query",
|
|
15079
|
-
...values3 && { values: values3 },
|
|
15080
|
-
loc: C.factory.sourceLocation(
|
|
15081
|
-
prologueValues.at(0),
|
|
15082
|
-
subType,
|
|
15083
|
-
values3
|
|
15084
|
-
)
|
|
15085
|
-
}));
|
|
15086
|
-
} },
|
|
15087
|
-
{ ALT: () => {
|
|
15088
|
-
const updates = [];
|
|
15089
|
-
updates.push({ context: prologueValues });
|
|
15090
|
-
let parsedSemi = true;
|
|
15091
|
-
MANY({
|
|
15092
|
-
GATE: () => parsedSemi,
|
|
15093
|
-
DEF: () => {
|
|
15094
|
-
parsedSemi = false;
|
|
15095
|
-
updates.at(-1).operation = SUBRULE(grammar_exports.update1);
|
|
15096
|
-
OPTION1(() => {
|
|
15097
|
-
CONSUME(lexer_exports.symbols.semi);
|
|
15098
|
-
parsedSemi = true;
|
|
15099
|
-
const innerPrologue = SUBRULE2(grammar_exports.prologue);
|
|
15100
|
-
updates.push({ context: innerPrologue });
|
|
15101
|
-
});
|
|
15102
|
-
}
|
|
15103
|
-
});
|
|
15104
|
-
return ACTION(() => {
|
|
15105
|
-
const update2 = {
|
|
15106
|
-
type: "update",
|
|
15107
|
-
updates,
|
|
15108
|
-
loc: C.factory.sourceLocation(
|
|
15109
|
-
...updates[0].context,
|
|
15110
|
-
updates[0].operation,
|
|
15111
|
-
...updates.at(-1).context,
|
|
15112
|
-
updates.at(-1)?.operation
|
|
15113
|
-
)
|
|
15114
|
-
};
|
|
15115
|
-
updateNoReuseBlankNodeLabels(update2);
|
|
15116
|
-
return update2;
|
|
15117
|
-
});
|
|
15118
|
-
} }
|
|
15119
|
-
]);
|
|
15120
|
-
}
|
|
15121
|
-
};
|
|
15122
|
-
var sparql11ParserBuilder = ParserBuilder.create(queryUnitParserBuilder).merge(updateParserBuilder, []).addRule(queryOrUpdate);
|
|
15125
|
+
var sparql11ParserBuilder = ParserBuilder.create(queryUnitParserBuilder).merge(updateParserBuilder, []).addRule(grammar_exports.queryOrUpdate);
|
|
15123
15126
|
|
|
15124
15127
|
// ../../packages/rules-sparql-1-2/lib/grammar.ts
|
|
15125
15128
|
var grammar_exports2 = {};
|
|
@@ -15128,16 +15131,16 @@ __export(grammar_exports2, {
|
|
|
15128
15131
|
annotationBlock: () => annotationBlock,
|
|
15129
15132
|
annotationBlockPath: () => annotationBlockPath,
|
|
15130
15133
|
annotationPath: () => annotationPath,
|
|
15134
|
+
buildInHasLang: () => buildInHasLang2,
|
|
15135
|
+
buildInHasLangDir: () => buildInHasLangDir2,
|
|
15136
|
+
buildInIsTriple: () => buildInIsTriple,
|
|
15137
|
+
buildInLangDir: () => buildInLangDir2,
|
|
15138
|
+
buildInLangStrDir: () => buildInLangStrDir,
|
|
15139
|
+
buildInObject: () => buildInObject,
|
|
15140
|
+
buildInPredicate: () => buildInPredicate,
|
|
15141
|
+
buildInSubject: () => buildInSubject,
|
|
15142
|
+
buildInTriple: () => buildInTriple,
|
|
15131
15143
|
builtInCall: () => builtInCall2,
|
|
15132
|
-
builtinHasLang: () => builtinHasLang2,
|
|
15133
|
-
builtinHasLangDir: () => builtinHasLangDir2,
|
|
15134
|
-
builtinIsTriple: () => builtinIsTriple,
|
|
15135
|
-
builtinLangDir: () => builtinLangDir2,
|
|
15136
|
-
builtinLangStrDir: () => builtinLangStrDir,
|
|
15137
|
-
builtinObject: () => builtinObject,
|
|
15138
|
-
builtinPredicate: () => builtinPredicate,
|
|
15139
|
-
builtinSubject: () => builtinSubject,
|
|
15140
|
-
builtinTriple: () => builtinTriple,
|
|
15141
15144
|
dataBlockValue: () => dataBlockValue2,
|
|
15142
15145
|
exprTripleTerm: () => exprTripleTerm,
|
|
15143
15146
|
exprTripleTermObject: () => exprTripleTermObject,
|
|
@@ -15177,18 +15180,18 @@ __export(lexer_exports2, {
|
|
|
15177
15180
|
LANG_DIR: () => LANG_DIR,
|
|
15178
15181
|
annotationClose: () => annotationClose,
|
|
15179
15182
|
annotationOpen: () => annotationOpen,
|
|
15180
|
-
|
|
15181
|
-
|
|
15182
|
-
|
|
15183
|
-
|
|
15184
|
-
|
|
15185
|
-
|
|
15186
|
-
|
|
15187
|
-
|
|
15188
|
-
|
|
15183
|
+
buildInHasLang: () => buildInHasLang,
|
|
15184
|
+
buildInHasLangDir: () => buildInHasLangDir,
|
|
15185
|
+
buildInIsTRIPLE: () => buildInIsTRIPLE,
|
|
15186
|
+
buildInLangDir: () => buildInLangDir,
|
|
15187
|
+
buildInOBJECT: () => buildInOBJECT,
|
|
15188
|
+
buildInPREDICATE: () => buildInPREDICATE,
|
|
15189
|
+
buildInSUBJECT: () => buildInSUBJECT,
|
|
15190
|
+
buildInStrLangDir: () => buildInStrLangDir,
|
|
15191
|
+
buildInTRIPLE: () => buildInTRIPLE,
|
|
15189
15192
|
reificationClose: () => reificationClose,
|
|
15190
15193
|
reificationOpen: () => reificationOpen,
|
|
15191
|
-
|
|
15194
|
+
sparql12LexerBuilder: () => sparql12LexerBuilder,
|
|
15192
15195
|
tilde: () => tilde,
|
|
15193
15196
|
tripleTermClose: () => tripleTermClose,
|
|
15194
15197
|
tripleTermOpen: () => tripleTermOpen,
|
|
@@ -15202,29 +15205,29 @@ var reificationOpen = createToken2({ name: "ReificationOpen", pattern: "<<", lab
|
|
|
15202
15205
|
var reificationClose = createToken2({ name: "ReificationClose", pattern: ">>", label: "Reification close >>" });
|
|
15203
15206
|
var tripleTermOpen = createToken2({ name: "TripleTermOpen", pattern: "<<(", label: "Triple Term Open <<(" });
|
|
15204
15207
|
var tripleTermClose = createToken2({ name: "TripleTermClose", pattern: ")>>", label: "Triple Term Close )>>" });
|
|
15205
|
-
var
|
|
15206
|
-
var
|
|
15208
|
+
var buildInLangDir = createToken2({ name: "BuiltInLangdir", pattern: /langdir/i, label: "LANGDIR" });
|
|
15209
|
+
var buildInStrLangDir = createToken2({
|
|
15207
15210
|
name: "BuiltInStrLangdir",
|
|
15208
15211
|
pattern: /strlangdir/i,
|
|
15209
15212
|
label: "STRLANGDIR"
|
|
15210
15213
|
});
|
|
15211
|
-
var
|
|
15212
|
-
var
|
|
15214
|
+
var buildInHasLang = createToken2({ name: "BuiltInHasLang", pattern: /haslang/i, label: "hasLANG" });
|
|
15215
|
+
var buildInHasLangDir = createToken2({
|
|
15213
15216
|
name: "BuiltInHasLangdir",
|
|
15214
15217
|
pattern: /haslangdir/i,
|
|
15215
15218
|
label: "hasLANGDIR"
|
|
15216
15219
|
});
|
|
15217
|
-
var
|
|
15218
|
-
var
|
|
15219
|
-
var
|
|
15220
|
-
var
|
|
15221
|
-
var
|
|
15220
|
+
var buildInIsTRIPLE = createToken2({ name: "BuiltInIsTriple", pattern: /istriple/i, label: "isTRIPLE" });
|
|
15221
|
+
var buildInTRIPLE = createToken2({ name: "BuiltInTriple", pattern: /triple/i, label: "TRIPLE" });
|
|
15222
|
+
var buildInSUBJECT = createToken2({ name: "BuiltInSubject", pattern: /subject/i, label: "SUBJECT" });
|
|
15223
|
+
var buildInPREDICATE = createToken2({ name: "BuiltInPredicate", pattern: /predicate/i, label: "PREDICATE" });
|
|
15224
|
+
var buildInOBJECT = createToken2({ name: "BuiltInObject", pattern: /object/i, label: "OBJECT" });
|
|
15222
15225
|
var LANG_DIR = createToken2({
|
|
15223
15226
|
name: "LANG_DIR",
|
|
15224
15227
|
pattern: /@[a-z]+(?:-[\da-z]+)*(?:--[a-z]+)?/i,
|
|
15225
15228
|
label: "LANG_DIR"
|
|
15226
15229
|
});
|
|
15227
|
-
var
|
|
15230
|
+
var sparql12LexerBuilder = LexerBuilder.create(lexer_exports.sparql11LexerBuilder).addBefore(
|
|
15228
15231
|
lexer_exports.symbols.logicAnd,
|
|
15229
15232
|
tilde,
|
|
15230
15233
|
annotationOpen,
|
|
@@ -15236,15 +15239,15 @@ var sparql12Tokens = LexerBuilder.create(lexer_exports.sparql11Tokens).addBefore
|
|
|
15236
15239
|
version
|
|
15237
15240
|
).addBefore(
|
|
15238
15241
|
lexer_exports.builtIn.langmatches,
|
|
15239
|
-
|
|
15240
|
-
|
|
15241
|
-
|
|
15242
|
-
|
|
15243
|
-
|
|
15244
|
-
|
|
15245
|
-
|
|
15246
|
-
|
|
15247
|
-
|
|
15242
|
+
buildInLangDir,
|
|
15243
|
+
buildInStrLangDir,
|
|
15244
|
+
buildInHasLangDir,
|
|
15245
|
+
buildInHasLang,
|
|
15246
|
+
buildInIsTRIPLE,
|
|
15247
|
+
buildInTRIPLE,
|
|
15248
|
+
buildInSUBJECT,
|
|
15249
|
+
buildInPREDICATE,
|
|
15250
|
+
buildInOBJECT
|
|
15248
15251
|
).addBefore(lexer_exports.terminals.langTag, LANG_DIR).delete(lexer_exports.terminals.langTag);
|
|
15249
15252
|
|
|
15250
15253
|
// ../../packages/rules-sparql-1-2/lib/validator.ts
|
|
@@ -15669,28 +15672,28 @@ var exprTripleTermObject = {
|
|
|
15669
15672
|
name: "exprTripleTermObject",
|
|
15670
15673
|
impl: exprTripleTermSubject.impl
|
|
15671
15674
|
};
|
|
15672
|
-
var
|
|
15673
|
-
var
|
|
15674
|
-
var
|
|
15675
|
-
var
|
|
15676
|
-
var
|
|
15677
|
-
var
|
|
15678
|
-
var
|
|
15679
|
-
var
|
|
15680
|
-
var
|
|
15675
|
+
var buildInLangDir2 = funcExpr1(buildInLangDir);
|
|
15676
|
+
var buildInLangStrDir = funcExpr3(buildInStrLangDir);
|
|
15677
|
+
var buildInHasLang2 = funcExpr1(buildInHasLang);
|
|
15678
|
+
var buildInHasLangDir2 = funcExpr1(buildInHasLangDir);
|
|
15679
|
+
var buildInIsTriple = funcExpr1(buildInIsTRIPLE);
|
|
15680
|
+
var buildInTriple = funcExpr3(buildInTRIPLE);
|
|
15681
|
+
var buildInSubject = funcExpr1(buildInSUBJECT);
|
|
15682
|
+
var buildInPredicate = funcExpr1(buildInPREDICATE);
|
|
15683
|
+
var buildInObject = funcExpr1(buildInOBJECT);
|
|
15681
15684
|
var builtInCall2 = {
|
|
15682
15685
|
name: "builtInCall",
|
|
15683
15686
|
impl: ($) => (C) => $.OR2([
|
|
15684
15687
|
{ ALT: () => grammar_exports.builtInCall.impl($)(C) },
|
|
15685
|
-
{ ALT: () => $.SUBRULE(
|
|
15686
|
-
{ ALT: () => $.SUBRULE(
|
|
15687
|
-
{ ALT: () => $.SUBRULE(
|
|
15688
|
-
{ ALT: () => $.SUBRULE(
|
|
15689
|
-
{ ALT: () => $.SUBRULE(
|
|
15690
|
-
{ ALT: () => $.SUBRULE(
|
|
15691
|
-
{ ALT: () => $.SUBRULE(
|
|
15692
|
-
{ ALT: () => $.SUBRULE(
|
|
15693
|
-
{ ALT: () => $.SUBRULE(
|
|
15688
|
+
{ ALT: () => $.SUBRULE(buildInLangDir2) },
|
|
15689
|
+
{ ALT: () => $.SUBRULE(buildInLangStrDir) },
|
|
15690
|
+
{ ALT: () => $.SUBRULE(buildInHasLang2) },
|
|
15691
|
+
{ ALT: () => $.SUBRULE(buildInHasLangDir2) },
|
|
15692
|
+
{ ALT: () => $.SUBRULE(buildInIsTriple) },
|
|
15693
|
+
{ ALT: () => $.SUBRULE(buildInTriple) },
|
|
15694
|
+
{ ALT: () => $.SUBRULE(buildInSubject) },
|
|
15695
|
+
{ ALT: () => $.SUBRULE(buildInPredicate) },
|
|
15696
|
+
{ ALT: () => $.SUBRULE(buildInObject) }
|
|
15694
15697
|
])
|
|
15695
15698
|
};
|
|
15696
15699
|
var rdfLiteral2 = {
|
|
@@ -15765,20 +15768,6 @@ var generateGraphTerm = {
|
|
|
15765
15768
|
|
|
15766
15769
|
// ../../packages/rules-sparql-1-2/lib/Factory.ts
|
|
15767
15770
|
var Factory2 = class extends Factory {
|
|
15768
|
-
constructor() {
|
|
15769
|
-
super(...arguments);
|
|
15770
|
-
/**
|
|
15771
|
-
* Overwritten triple constructor to always contain an empty annotations list
|
|
15772
|
-
*/
|
|
15773
|
-
this.triple = (subject, predicate, object3, loc) => ({
|
|
15774
|
-
type: "triple",
|
|
15775
|
-
subject,
|
|
15776
|
-
predicate,
|
|
15777
|
-
object: object3,
|
|
15778
|
-
annotations: [],
|
|
15779
|
-
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
15780
|
-
});
|
|
15781
|
-
}
|
|
15782
15771
|
termTriple(subject, predicate, object3, loc) {
|
|
15783
15772
|
return {
|
|
15784
15773
|
type: "term",
|
|
@@ -15813,6 +15802,17 @@ var Factory2 = class extends Factory {
|
|
|
15813
15802
|
loc
|
|
15814
15803
|
};
|
|
15815
15804
|
}
|
|
15805
|
+
/**
|
|
15806
|
+
* Overwritten triple constructor to always contain an empty annotations list
|
|
15807
|
+
*/
|
|
15808
|
+
triple = (subject, predicate, object3, loc) => ({
|
|
15809
|
+
type: "triple",
|
|
15810
|
+
subject,
|
|
15811
|
+
predicate,
|
|
15812
|
+
object: object3,
|
|
15813
|
+
annotations: [],
|
|
15814
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
15815
|
+
});
|
|
15816
15816
|
annotatedTriple(subject, predicate, object3, annotations, loc) {
|
|
15817
15817
|
return {
|
|
15818
15818
|
type: "triple",
|
|
@@ -15875,29 +15875,30 @@ var sparql12ParserBuilder = ParserBuilder.create(sparql11ParserBuilder).widenCon
|
|
|
15875
15875
|
grammar_exports2.versionDecl,
|
|
15876
15876
|
grammar_exports2.versionSpecifier
|
|
15877
15877
|
).addMany(
|
|
15878
|
-
grammar_exports2.
|
|
15879
|
-
grammar_exports2.
|
|
15880
|
-
grammar_exports2.
|
|
15881
|
-
grammar_exports2.
|
|
15882
|
-
grammar_exports2.
|
|
15883
|
-
grammar_exports2.
|
|
15884
|
-
grammar_exports2.
|
|
15885
|
-
grammar_exports2.
|
|
15886
|
-
grammar_exports2.
|
|
15878
|
+
grammar_exports2.buildInLangDir,
|
|
15879
|
+
grammar_exports2.buildInLangStrDir,
|
|
15880
|
+
grammar_exports2.buildInHasLang,
|
|
15881
|
+
grammar_exports2.buildInHasLangDir,
|
|
15882
|
+
grammar_exports2.buildInIsTriple,
|
|
15883
|
+
grammar_exports2.buildInTriple,
|
|
15884
|
+
grammar_exports2.buildInSubject,
|
|
15885
|
+
grammar_exports2.buildInPredicate,
|
|
15886
|
+
grammar_exports2.buildInObject
|
|
15887
15887
|
).patchRule(grammar_exports2.dataBlockValue).patchRule(grammar_exports2.triplesSameSubject).patchRule(grammar_exports2.triplesSameSubjectPath).patchRule(grammar_exports2.object).patchRule(grammar_exports2.objectPath).patchRule(grammar_exports2.graphNode).patchRule(grammar_exports2.graphNodePath).patchRule(grammar_exports2.varOrTerm).deleteRule(grammar_exports.graphTerm.name).patchRule(grammar_exports2.primaryExpression).patchRule(grammar_exports2.builtInCall).patchRule(grammar_exports2.rdfLiteral).patchRule(grammar_exports2.prologue);
|
|
15888
15888
|
var Parser2 = class {
|
|
15889
|
+
parser;
|
|
15890
|
+
F = new Factory2();
|
|
15889
15891
|
constructor() {
|
|
15890
|
-
this.F = new Factory2();
|
|
15891
15892
|
this.parser = sparql12ParserBuilder.build({
|
|
15892
15893
|
queryPreProcessor: sparqlCodepointEscape,
|
|
15893
|
-
tokenVocabulary: lexer_exports2.
|
|
15894
|
+
tokenVocabulary: lexer_exports2.sparql12LexerBuilder.tokenVocabulary
|
|
15894
15895
|
});
|
|
15895
15896
|
}
|
|
15896
15897
|
parse(query2, context = {}) {
|
|
15897
|
-
return this.parser.queryOrUpdate(query2, completeParseContext(context)
|
|
15898
|
+
return this.parser.queryOrUpdate(query2, completeParseContext(context));
|
|
15898
15899
|
}
|
|
15899
15900
|
parsePath(query2, context = {}) {
|
|
15900
|
-
const res = this.parser.path(query2, completeParseContext(context)
|
|
15901
|
+
const res = this.parser.path(query2, completeParseContext(context));
|
|
15901
15902
|
if (this.F.isPathPure(res)) {
|
|
15902
15903
|
return {
|
|
15903
15904
|
...res,
|