@traqula/parser-sparql-1-2 0.0.15 → 0.0.16
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 +129 -129
- package/lib/Parser.js +2 -2
- package/lib/Parser.js.map +1 -1
- package/lib/index.cjs +435 -336
- package/package.json +7 -7
package/lib/index.cjs
CHANGED
|
@@ -25,8 +25,8 @@ __export(index_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(index_exports);
|
|
27
27
|
|
|
28
|
-
// ../../packages/core/lib/
|
|
29
|
-
var
|
|
28
|
+
// ../../packages/core/lib/AstCoreFactory.js
|
|
29
|
+
var AstCoreFactory = class {
|
|
30
30
|
wrap(val, loc) {
|
|
31
31
|
return { val, loc };
|
|
32
32
|
}
|
|
@@ -9370,6 +9370,15 @@ var EmbeddedActionsParser = class extends Parser {
|
|
|
9370
9370
|
}
|
|
9371
9371
|
};
|
|
9372
9372
|
|
|
9373
|
+
// ../../packages/core/lib/utils.js
|
|
9374
|
+
function unCapitalize(str2) {
|
|
9375
|
+
return str2.charAt(0).toLowerCase() + str2.slice(1);
|
|
9376
|
+
}
|
|
9377
|
+
function createToken2(config) {
|
|
9378
|
+
return createToken(config);
|
|
9379
|
+
}
|
|
9380
|
+
var traqulaIndentation = "When you use this string, you expect traqula to handle indentation after every newline";
|
|
9381
|
+
|
|
9373
9382
|
// ../../packages/core/lib/lexer-builder/LexerBuilder.js
|
|
9374
9383
|
var LexerBuilder = class _LexerBuilder {
|
|
9375
9384
|
tokens;
|
|
@@ -9732,14 +9741,6 @@ ${firstError.message}`);
|
|
|
9732
9741
|
}
|
|
9733
9742
|
};
|
|
9734
9743
|
|
|
9735
|
-
// ../../packages/core/lib/utils.js
|
|
9736
|
-
function unCapitalize(str2) {
|
|
9737
|
-
return str2.charAt(0).toLowerCase() + str2.slice(1);
|
|
9738
|
-
}
|
|
9739
|
-
function createToken2(config) {
|
|
9740
|
-
return createToken(config);
|
|
9741
|
-
}
|
|
9742
|
-
|
|
9743
9744
|
// ../../packages/core/lib/Transformers.js
|
|
9744
9745
|
var TransformerType = class {
|
|
9745
9746
|
safeObjectVisit(value, mapper) {
|
|
@@ -11246,8 +11247,8 @@ function UpdateOperationFactoryMixin(Base) {
|
|
|
11246
11247
|
};
|
|
11247
11248
|
}
|
|
11248
11249
|
|
|
11249
|
-
// ../../packages/rules-sparql-1-1/lib/
|
|
11250
|
-
var
|
|
11250
|
+
// ../../packages/rules-sparql-1-1/lib/astFactory.js
|
|
11251
|
+
var AstFactory = class extends asArg(AstCoreFactory).call(ContextFactoryMixin).call(ExpressionFactoryMixin).call(GraphRefFactoryMixin).call(PathFactoryMixin).call(PatternFactoryMixin).call(QueryFactoryMixin).call(SolutionModifiersFactoryMixin).call(TermFactoryMixin).call(UpdateOperationFactoryMixin).returns() {
|
|
11251
11252
|
alwaysSparql11(obj) {
|
|
11252
11253
|
return true;
|
|
11253
11254
|
}
|
|
@@ -11366,7 +11367,7 @@ var TransformerSparql11 = class extends TransformerSubType {
|
|
|
11366
11367
|
};
|
|
11367
11368
|
|
|
11368
11369
|
// ../../packages/rules-sparql-1-1/lib/validation/validators.js
|
|
11369
|
-
var F = new
|
|
11370
|
+
var F = new AstFactory();
|
|
11370
11371
|
var transformer = new TransformerSparql11();
|
|
11371
11372
|
function getAggregatesOfExpression(expression2) {
|
|
11372
11373
|
if (F.isExpressionAggregate(expression2)) {
|
|
@@ -11586,22 +11587,22 @@ var rdfLiteral = {
|
|
|
11586
11587
|
return OPTION(() => OR([
|
|
11587
11588
|
{ ALT: () => {
|
|
11588
11589
|
const lang2 = CONSUME(terminals_exports.langTag);
|
|
11589
|
-
return ACTION(() => C.
|
|
11590
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, lang2), value.value, lang2.image.slice(1).toLowerCase()));
|
|
11590
11591
|
} },
|
|
11591
11592
|
{ ALT: () => {
|
|
11592
11593
|
CONSUME(symbols_exports.hathat);
|
|
11593
11594
|
const iriVal = SUBRULE1(iri2);
|
|
11594
|
-
return ACTION(() => C.
|
|
11595
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
|
|
11595
11596
|
} }
|
|
11596
11597
|
])) ?? value;
|
|
11597
11598
|
},
|
|
11598
|
-
gImpl: ({ SUBRULE, PRINT, PRINT_SPACE_LEFT }) => (ast, {
|
|
11599
|
-
|
|
11599
|
+
gImpl: ({ SUBRULE, PRINT, PRINT_SPACE_LEFT }) => (ast, { astFactory }) => {
|
|
11600
|
+
astFactory.printFilter(ast, () => PRINT_SPACE_LEFT(stringEscapedLexical(ast.value)));
|
|
11600
11601
|
if (ast.langOrIri) {
|
|
11601
11602
|
if (typeof ast.langOrIri === "string") {
|
|
11602
|
-
|
|
11603
|
+
astFactory.printFilter(ast, () => PRINT("@", ast.langOrIri));
|
|
11603
11604
|
} else {
|
|
11604
|
-
|
|
11605
|
+
astFactory.printFilter(ast, () => PRINT("^^"));
|
|
11605
11606
|
SUBRULE(iri2, ast.langOrIri);
|
|
11606
11607
|
}
|
|
11607
11608
|
}
|
|
@@ -11623,7 +11624,7 @@ var numericLiteralUnsigned = {
|
|
|
11623
11624
|
{ ALT: () => [CONSUME(terminals_exports.decimal), CommonIRIs.DECIMAL] },
|
|
11624
11625
|
{ ALT: () => [CONSUME(terminals_exports.double), CommonIRIs.DOUBLE] }
|
|
11625
11626
|
]);
|
|
11626
|
-
return ACTION(() => C.
|
|
11627
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11627
11628
|
}
|
|
11628
11629
|
};
|
|
11629
11630
|
var numericLiteralPositive = {
|
|
@@ -11634,7 +11635,7 @@ var numericLiteralPositive = {
|
|
|
11634
11635
|
{ ALT: () => [CONSUME(terminals_exports.decimalPositive), CommonIRIs.DECIMAL] },
|
|
11635
11636
|
{ ALT: () => [CONSUME(terminals_exports.doublePositive), CommonIRIs.DOUBLE] }
|
|
11636
11637
|
]);
|
|
11637
|
-
return ACTION(() => C.
|
|
11638
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11638
11639
|
}
|
|
11639
11640
|
};
|
|
11640
11641
|
var numericLiteralNegative = {
|
|
@@ -11645,7 +11646,7 @@ var numericLiteralNegative = {
|
|
|
11645
11646
|
{ ALT: () => [CONSUME(terminals_exports.decimalNegative), CommonIRIs.DECIMAL] },
|
|
11646
11647
|
{ ALT: () => [CONSUME(terminals_exports.doubleNegative), CommonIRIs.DOUBLE] }
|
|
11647
11648
|
]);
|
|
11648
|
-
return ACTION(() => C.
|
|
11649
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11649
11650
|
}
|
|
11650
11651
|
};
|
|
11651
11652
|
var booleanLiteral = {
|
|
@@ -11655,7 +11656,7 @@ var booleanLiteral = {
|
|
|
11655
11656
|
{ ALT: () => CONSUME(true_) },
|
|
11656
11657
|
{ ALT: () => CONSUME(false_) }
|
|
11657
11658
|
]);
|
|
11658
|
-
return ACTION(() => C.
|
|
11659
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(token), token.image.toLowerCase(), C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), CommonIRIs.BOOLEAN)));
|
|
11659
11660
|
}
|
|
11660
11661
|
};
|
|
11661
11662
|
var string = {
|
|
@@ -11680,7 +11681,7 @@ var string = {
|
|
|
11680
11681
|
} }
|
|
11681
11682
|
]);
|
|
11682
11683
|
return ACTION(() => {
|
|
11683
|
-
const F3 = C.
|
|
11684
|
+
const F3 = C.astFactory;
|
|
11684
11685
|
const value = x[1].replaceAll(/\\([tnrbf"'\\])/gu, (_, char) => {
|
|
11685
11686
|
switch (char) {
|
|
11686
11687
|
case "t":
|
|
@@ -11707,16 +11708,16 @@ var iri2 = {
|
|
|
11707
11708
|
{ ALT: () => SUBRULE(iriFull) },
|
|
11708
11709
|
{ ALT: () => SUBRULE(prefixedName) }
|
|
11709
11710
|
]),
|
|
11710
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11711
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => F3.isTermNamedPrefixed(ast) ? SUBRULE(prefixedName, ast) : SUBRULE(iriFull, ast)
|
|
11711
11712
|
};
|
|
11712
11713
|
var iriFull = {
|
|
11713
11714
|
name: "iriFull",
|
|
11714
11715
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
11715
11716
|
const iriToken = CONSUME(terminals_exports.iriRef);
|
|
11716
|
-
return ACTION(() => C.
|
|
11717
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(iriToken), iriToken.image.slice(1, -1)));
|
|
11717
11718
|
},
|
|
11718
|
-
gImpl: ({ PRINT }) => (ast, {
|
|
11719
|
-
|
|
11719
|
+
gImpl: ({ PRINT }) => (ast, { astFactory: F3 }) => {
|
|
11720
|
+
F3.printFilter(ast, () => PRINT("<", ast.value, ">"));
|
|
11720
11721
|
}
|
|
11721
11722
|
};
|
|
11722
11723
|
var prefixedName = {
|
|
@@ -11726,16 +11727,16 @@ var prefixedName = {
|
|
|
11726
11727
|
const longName = CONSUME(terminals_exports.pNameLn);
|
|
11727
11728
|
return ACTION(() => {
|
|
11728
11729
|
const [prefix, localName] = longName.image.split(":");
|
|
11729
|
-
return C.
|
|
11730
|
+
return C.astFactory.namedNode(C.astFactory.sourceLocation(longName), localName, prefix);
|
|
11730
11731
|
});
|
|
11731
11732
|
} },
|
|
11732
11733
|
{ ALT: () => {
|
|
11733
11734
|
const shortName = CONSUME(terminals_exports.pNameNs);
|
|
11734
|
-
return ACTION(() => C.
|
|
11735
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(shortName), "", shortName.image.slice(0, -1)));
|
|
11735
11736
|
} }
|
|
11736
11737
|
]),
|
|
11737
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11738
|
-
|
|
11738
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11739
|
+
F3.printFilter(ast, () => PRINT_WORD(ast.prefix, ":", ast.value));
|
|
11739
11740
|
}
|
|
11740
11741
|
};
|
|
11741
11742
|
var canCreateBlankNodes = Symbol("canCreateBlankNodes");
|
|
@@ -11745,11 +11746,11 @@ var blankNode = {
|
|
|
11745
11746
|
const result = OR([
|
|
11746
11747
|
{ ALT: () => {
|
|
11747
11748
|
const labelToken = CONSUME(terminals_exports.blankNodeLabel);
|
|
11748
|
-
return ACTION(() => C.
|
|
11749
|
+
return ACTION(() => C.astFactory.blankNode(labelToken.image.slice(2), C.astFactory.sourceLocation(labelToken)));
|
|
11749
11750
|
} },
|
|
11750
11751
|
{ ALT: () => {
|
|
11751
11752
|
const anonToken = CONSUME(terminals_exports.anon);
|
|
11752
|
-
return ACTION(() => C.
|
|
11753
|
+
return ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocation(anonToken)));
|
|
11753
11754
|
} }
|
|
11754
11755
|
]);
|
|
11755
11756
|
ACTION(() => {
|
|
@@ -11759,15 +11760,15 @@ var blankNode = {
|
|
|
11759
11760
|
});
|
|
11760
11761
|
return result;
|
|
11761
11762
|
},
|
|
11762
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11763
|
-
|
|
11763
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory }) => {
|
|
11764
|
+
astFactory.printFilter(ast, () => PRINT_WORD("_:", ast.label.replace(/^e_/u, "")));
|
|
11764
11765
|
}
|
|
11765
11766
|
};
|
|
11766
11767
|
var verbA = {
|
|
11767
11768
|
name: "VerbA",
|
|
11768
11769
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
11769
11770
|
const token = CONSUME(a);
|
|
11770
|
-
return ACTION(() => C.
|
|
11771
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.TYPE, void 0));
|
|
11771
11772
|
}
|
|
11772
11773
|
};
|
|
11773
11774
|
|
|
@@ -11784,7 +11785,7 @@ var prologue = {
|
|
|
11784
11785
|
]));
|
|
11785
11786
|
return result;
|
|
11786
11787
|
},
|
|
11787
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11788
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11788
11789
|
for (const context of ast) {
|
|
11789
11790
|
if (F3.isContextDefinitionBase(context)) {
|
|
11790
11791
|
SUBRULE(baseDecl2, context);
|
|
@@ -11799,11 +11800,12 @@ var baseDecl2 = {
|
|
|
11799
11800
|
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
11800
11801
|
const base = CONSUME(baseDecl);
|
|
11801
11802
|
const val = SUBRULE(iriFull);
|
|
11802
|
-
return ACTION(() => C.
|
|
11803
|
+
return ACTION(() => C.astFactory.contextDefinitionBase(C.astFactory.sourceLocation(base, val), val));
|
|
11803
11804
|
},
|
|
11804
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
11805
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11805
11806
|
F3.printFilter(ast, () => PRINT_WORD("BASE"));
|
|
11806
11807
|
SUBRULE(iri2, ast.value);
|
|
11808
|
+
F3.printFilter(ast, () => PRINT_WORD("\n"));
|
|
11807
11809
|
}
|
|
11808
11810
|
};
|
|
11809
11811
|
var prefixDecl2 = {
|
|
@@ -11812,13 +11814,14 @@ var prefixDecl2 = {
|
|
|
11812
11814
|
const prefix = CONSUME(prefixDecl);
|
|
11813
11815
|
const name = CONSUME(terminals_exports.pNameNs).image.slice(0, -1);
|
|
11814
11816
|
const value = SUBRULE(iriFull);
|
|
11815
|
-
return ACTION(() => C.
|
|
11817
|
+
return ACTION(() => C.astFactory.contextDefinitionPrefix(C.astFactory.sourceLocation(prefix, value), name, value));
|
|
11816
11818
|
},
|
|
11817
|
-
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, {
|
|
11819
|
+
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, { astFactory: F3 }) => {
|
|
11818
11820
|
F3.printFilter(ast, () => {
|
|
11819
11821
|
PRINT_WORDS("PREFIX", `${ast.key}:`);
|
|
11820
11822
|
});
|
|
11821
11823
|
SUBRULE(iri2, ast.value);
|
|
11824
|
+
F3.printFilter(ast, () => PRINT_WORDS("\n"));
|
|
11822
11825
|
}
|
|
11823
11826
|
};
|
|
11824
11827
|
var verb = {
|
|
@@ -11834,7 +11837,7 @@ var varOrTerm = {
|
|
|
11834
11837
|
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
11835
11838
|
{ ALT: () => SUBRULE(graphTerm) }
|
|
11836
11839
|
]),
|
|
11837
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11840
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11838
11841
|
if (F3.isTermVariable(ast)) {
|
|
11839
11842
|
return SUBRULE(var_, ast);
|
|
11840
11843
|
}
|
|
@@ -11855,9 +11858,9 @@ var var_ = {
|
|
|
11855
11858
|
{ ALT: () => CONSUME(terminals_exports.var1) },
|
|
11856
11859
|
{ ALT: () => CONSUME(terminals_exports.var2) }
|
|
11857
11860
|
]);
|
|
11858
|
-
return ACTION(() => C.
|
|
11861
|
+
return ACTION(() => C.astFactory.variable(varToken.image.slice(1), C.astFactory.sourceLocation(varToken)));
|
|
11859
11862
|
},
|
|
11860
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11863
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11861
11864
|
F3.printFilter(ast, () => PRINT_WORD(`?${ast.value}`));
|
|
11862
11865
|
}
|
|
11863
11866
|
};
|
|
@@ -11871,10 +11874,10 @@ var graphTerm = {
|
|
|
11871
11874
|
{ GATE: () => C.parseMode.has("canCreateBlankNodes"), ALT: () => SUBRULE(blankNode) },
|
|
11872
11875
|
{ ALT: () => {
|
|
11873
11876
|
const tokenNil = CONSUME(terminals_exports.nil);
|
|
11874
|
-
return ACTION(() => C.
|
|
11877
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(tokenNil), CommonIRIs.NIL));
|
|
11875
11878
|
} }
|
|
11876
11879
|
]),
|
|
11877
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11880
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11878
11881
|
if (F3.isTermNamed(ast)) {
|
|
11879
11882
|
SUBRULE(iri2, ast);
|
|
11880
11883
|
} else if (F3.isTermLiteral(ast)) {
|
|
@@ -11894,14 +11897,14 @@ function datasetClauseUsing(name, token) {
|
|
|
11894
11897
|
return OR([
|
|
11895
11898
|
{ ALT: () => {
|
|
11896
11899
|
const iri3 = SUBRULE(defaultGraphClause);
|
|
11897
|
-
return ACTION(() => C.
|
|
11900
|
+
return ACTION(() => C.astFactory.wrap({ clauseType: "default", value: iri3 }, C.astFactory.sourceLocation(start, iri3)));
|
|
11898
11901
|
} },
|
|
11899
11902
|
{ ALT: () => {
|
|
11900
11903
|
const namedClause = SUBRULE(namedGraphClause);
|
|
11901
|
-
return ACTION(() => C.
|
|
11904
|
+
return ACTION(() => C.astFactory.wrap({
|
|
11902
11905
|
clauseType: "named",
|
|
11903
11906
|
value: namedClause.val
|
|
11904
|
-
}, C.
|
|
11907
|
+
}, C.astFactory.sourceLocation(start, namedClause)));
|
|
11905
11908
|
} }
|
|
11906
11909
|
]);
|
|
11907
11910
|
}
|
|
@@ -11922,9 +11925,9 @@ function datasetClauseUsingStar(name, subRule, fromUsing) {
|
|
|
11922
11925
|
const clause = SUBRULE(subRule);
|
|
11923
11926
|
clauses.push(clause);
|
|
11924
11927
|
});
|
|
11925
|
-
return ACTION(() => C.
|
|
11928
|
+
return ACTION(() => C.astFactory.datasetClauses(clauses.map((clause) => clause.val), C.astFactory.sourceLocation(...clauses)));
|
|
11926
11929
|
},
|
|
11927
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
11930
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11928
11931
|
for (const clause of ast.clauses) {
|
|
11929
11932
|
F3.printFilter(ast, () => PRINT_WORD(fromUsing));
|
|
11930
11933
|
if (clause.clauseType === "named") {
|
|
@@ -11942,7 +11945,7 @@ var namedGraphClause = {
|
|
|
11942
11945
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
11943
11946
|
const named2 = CONSUME(graph_exports.named);
|
|
11944
11947
|
const iri3 = SUBRULE(sourceSelector);
|
|
11945
|
-
return ACTION(() => C.
|
|
11948
|
+
return ACTION(() => C.astFactory.wrap(iri3, C.astFactory.sourceLocation(named2, iri3)));
|
|
11946
11949
|
}
|
|
11947
11950
|
};
|
|
11948
11951
|
var sourceSelector = {
|
|
@@ -11959,7 +11962,7 @@ function funcExpr1(func) {
|
|
|
11959
11962
|
CONSUME(symbols_exports.LParen);
|
|
11960
11963
|
const arg = SUBRULE(expression);
|
|
11961
11964
|
const close = CONSUME(symbols_exports.RParen);
|
|
11962
|
-
return ACTION(() => C.
|
|
11965
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
11963
11966
|
}
|
|
11964
11967
|
};
|
|
11965
11968
|
}
|
|
@@ -11973,7 +11976,7 @@ function funcExpr2(func) {
|
|
|
11973
11976
|
CONSUME(symbols_exports.comma);
|
|
11974
11977
|
const arg2 = SUBRULE2(expression);
|
|
11975
11978
|
const close = CONSUME(symbols_exports.RParen);
|
|
11976
|
-
return ACTION(() => C.
|
|
11979
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg1, arg2], C.astFactory.sourceLocation(operator, close)));
|
|
11977
11980
|
}
|
|
11978
11981
|
};
|
|
11979
11982
|
}
|
|
@@ -11989,7 +11992,7 @@ function funcExpr3(func) {
|
|
|
11989
11992
|
CONSUME2(symbols_exports.comma);
|
|
11990
11993
|
const arg3 = SUBRULE3(expression);
|
|
11991
11994
|
const close = CONSUME(symbols_exports.RParen);
|
|
11992
|
-
return ACTION(() => C.
|
|
11995
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg1, arg2, arg3], C.astFactory.sourceLocation(operator, close)));
|
|
11993
11996
|
}
|
|
11994
11997
|
};
|
|
11995
11998
|
}
|
|
@@ -12001,7 +12004,7 @@ function funcVar1(func) {
|
|
|
12001
12004
|
CONSUME(symbols_exports.LParen);
|
|
12002
12005
|
const arg = SUBRULE(var_);
|
|
12003
12006
|
const close = CONSUME(symbols_exports.RParen);
|
|
12004
|
-
return ACTION(() => C.
|
|
12007
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
12005
12008
|
}
|
|
12006
12009
|
};
|
|
12007
12010
|
}
|
|
@@ -12015,11 +12018,11 @@ function funcExprOrNil1(func) {
|
|
|
12015
12018
|
CONSUME(symbols_exports.LParen);
|
|
12016
12019
|
const arg = SUBRULE(expression);
|
|
12017
12020
|
const close = CONSUME(symbols_exports.RParen);
|
|
12018
|
-
return ACTION(() => C.
|
|
12021
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
12019
12022
|
} },
|
|
12020
12023
|
{ ALT: () => {
|
|
12021
12024
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
12022
|
-
return ACTION(() => C.
|
|
12025
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [], C.astFactory.sourceLocation(operator, nil2)));
|
|
12023
12026
|
} }
|
|
12024
12027
|
]);
|
|
12025
12028
|
}
|
|
@@ -12031,7 +12034,7 @@ function funcNil1(func) {
|
|
|
12031
12034
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
12032
12035
|
const operator = CONSUME(func);
|
|
12033
12036
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
12034
|
-
return ACTION(() => C.
|
|
12037
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [], C.astFactory.sourceLocation(operator, nil2)));
|
|
12035
12038
|
}
|
|
12036
12039
|
};
|
|
12037
12040
|
}
|
|
@@ -12041,7 +12044,7 @@ function funcExprList1(func) {
|
|
|
12041
12044
|
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
12042
12045
|
const operator = CONSUME(func);
|
|
12043
12046
|
const args = SUBRULE(expressionList);
|
|
12044
|
-
return ACTION(() => C.
|
|
12047
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, args.val, C.astFactory.sourceLocation(operator, args)));
|
|
12045
12048
|
}
|
|
12046
12049
|
};
|
|
12047
12050
|
}
|
|
@@ -12059,7 +12062,7 @@ function funcExpr2or3(func) {
|
|
|
12059
12062
|
return SUBRULE3(expression);
|
|
12060
12063
|
});
|
|
12061
12064
|
const close = CONSUME(symbols_exports.RParen);
|
|
12062
|
-
return ACTION(() => C.
|
|
12065
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, arg3 ? [arg1, arg2, arg3] : [arg1, arg2], C.astFactory.sourceLocation(operator, close)));
|
|
12063
12066
|
}
|
|
12064
12067
|
};
|
|
12065
12068
|
}
|
|
@@ -12079,7 +12082,7 @@ function funcExpr3or4(func) {
|
|
|
12079
12082
|
return SUBRULE4(expression);
|
|
12080
12083
|
});
|
|
12081
12084
|
const close = CONSUME(symbols_exports.RParen);
|
|
12082
|
-
return ACTION(() => C.
|
|
12085
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, arg4 ? [arg1, arg2, arg3, arg4] : [arg1, arg2, arg3], C.astFactory.sourceLocation(operator, close)));
|
|
12083
12086
|
}
|
|
12084
12087
|
};
|
|
12085
12088
|
}
|
|
@@ -12089,7 +12092,7 @@ function funcGroupGraphPattern(func) {
|
|
|
12089
12092
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12090
12093
|
const operator = CONSUME(func);
|
|
12091
12094
|
const group = SUBRULE(groupGraphPattern);
|
|
12092
|
-
return ACTION(() => C.
|
|
12095
|
+
return ACTION(() => C.astFactory.expressionPatternOperation(operator.image, group, C.astFactory.sourceLocation(operator, group)));
|
|
12093
12096
|
}
|
|
12094
12097
|
};
|
|
12095
12098
|
}
|
|
@@ -12102,7 +12105,7 @@ function baseAggregateFunc(func) {
|
|
|
12102
12105
|
const distinct2 = OPTION(() => CONSUME(distinct));
|
|
12103
12106
|
const expr1 = SUBRULE(expression);
|
|
12104
12107
|
const close = CONSUME(symbols_exports.RParen);
|
|
12105
|
-
return ACTION(() => C.
|
|
12108
|
+
return ACTION(() => C.astFactory.aggregate(operator.image, distinct2 !== void 0, expr1, void 0, C.astFactory.sourceLocation(operator, close)));
|
|
12106
12109
|
}
|
|
12107
12110
|
};
|
|
12108
12111
|
}
|
|
@@ -12242,17 +12245,17 @@ var aggregateCount = {
|
|
|
12242
12245
|
const expressionVal = OR([
|
|
12243
12246
|
{ ALT: () => {
|
|
12244
12247
|
const starToken = CONSUME(symbols_exports.star);
|
|
12245
|
-
return ACTION(() => C.
|
|
12248
|
+
return ACTION(() => C.astFactory.wildcard(C.astFactory.sourceLocation(starToken)));
|
|
12246
12249
|
} },
|
|
12247
12250
|
{ ALT: () => SUBRULE(expression) }
|
|
12248
12251
|
]);
|
|
12249
12252
|
const closeToken = CONSUME(symbols_exports.RParen);
|
|
12250
12253
|
return ACTION(() => {
|
|
12251
|
-
const F3 = C.
|
|
12252
|
-
if (C.
|
|
12253
|
-
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.
|
|
12254
|
+
const F3 = C.astFactory;
|
|
12255
|
+
if (C.astFactory.isWildcard(expressionVal)) {
|
|
12256
|
+
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
|
|
12254
12257
|
}
|
|
12255
|
-
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.
|
|
12258
|
+
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
|
|
12256
12259
|
});
|
|
12257
12260
|
}
|
|
12258
12261
|
};
|
|
@@ -12276,7 +12279,7 @@ var aggregateGroup_concat = {
|
|
|
12276
12279
|
});
|
|
12277
12280
|
const closeToken = CONSUME(symbols_exports.RParen);
|
|
12278
12281
|
return ACTION(() => {
|
|
12279
|
-
const F3 = C.
|
|
12282
|
+
const F3 = C.astFactory;
|
|
12280
12283
|
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expr, sep?.value ?? " ", F3.sourceLocation(operatorToken, closeToken));
|
|
12281
12284
|
});
|
|
12282
12285
|
}
|
|
@@ -12306,7 +12309,7 @@ var aggregate = {
|
|
|
12306
12309
|
});
|
|
12307
12310
|
return result;
|
|
12308
12311
|
},
|
|
12309
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12312
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12310
12313
|
F3.printFilter(ast, () => {
|
|
12311
12314
|
PRINT_WORD(ast.aggregation.toUpperCase(), "(");
|
|
12312
12315
|
if (ast.distinct) {
|
|
@@ -12333,7 +12336,7 @@ var path = {
|
|
|
12333
12336
|
};
|
|
12334
12337
|
var pathGenerator = {
|
|
12335
12338
|
name: "path",
|
|
12336
|
-
gImpl: ({ PRINT, SUBRULE }) => (ast, {
|
|
12339
|
+
gImpl: ({ PRINT, SUBRULE }) => (ast, { astFactory: F3 }, braces = true) => {
|
|
12337
12340
|
if (F3.isTerm(ast) && F3.isTermNamed(ast)) {
|
|
12338
12341
|
SUBRULE(iri2, ast);
|
|
12339
12342
|
} else {
|
|
@@ -12382,7 +12385,7 @@ function pathChainHelper(name, SEP, subType, subRule) {
|
|
|
12382
12385
|
tailEnd = SUBRULE2(subRule);
|
|
12383
12386
|
tail.push(tailEnd);
|
|
12384
12387
|
});
|
|
12385
|
-
return ACTION(() => tail.length === 0 ? head2 : C.
|
|
12388
|
+
return ACTION(() => tail.length === 0 ? head2 : C.astFactory.path(subType, [head2, ...tail], C.astFactory.sourceLocation(head2, tailEnd)));
|
|
12386
12389
|
}
|
|
12387
12390
|
};
|
|
12388
12391
|
}
|
|
@@ -12393,7 +12396,7 @@ var pathEltOrInverse = {
|
|
|
12393
12396
|
{ ALT: () => {
|
|
12394
12397
|
const hat2 = CONSUME(symbols_exports.hat);
|
|
12395
12398
|
const item = SUBRULE2(pathElt);
|
|
12396
|
-
return ACTION(() => C.
|
|
12399
|
+
return ACTION(() => C.astFactory.path("^", [item], C.astFactory.sourceLocation(hat2, item)));
|
|
12397
12400
|
} }
|
|
12398
12401
|
])
|
|
12399
12402
|
};
|
|
@@ -12404,7 +12407,7 @@ var pathElt = {
|
|
|
12404
12407
|
impl: ({ ACTION, SUBRULE, OPTION }) => (C) => {
|
|
12405
12408
|
const item = SUBRULE(pathPrimary);
|
|
12406
12409
|
const modification = OPTION(() => SUBRULE(pathMod));
|
|
12407
|
-
return ACTION(() => modification === void 0 ? item : C.
|
|
12410
|
+
return ACTION(() => modification === void 0 ? item : C.astFactory.path(modification.image, [item], C.astFactory.sourceLocation(item, modification)));
|
|
12408
12411
|
}
|
|
12409
12412
|
};
|
|
12410
12413
|
var pathMod = {
|
|
@@ -12436,7 +12439,7 @@ var pathNegatedPropertySet = {
|
|
|
12436
12439
|
return OR([
|
|
12437
12440
|
{ ALT: () => {
|
|
12438
12441
|
const noAlternative = SUBRULE1(pathOneInPropertySet);
|
|
12439
|
-
return ACTION(() => C.
|
|
12442
|
+
return ACTION(() => C.astFactory.path("!", [noAlternative], C.astFactory.sourceLocation(exclamation2, noAlternative)));
|
|
12440
12443
|
} },
|
|
12441
12444
|
{ ALT: () => {
|
|
12442
12445
|
const open = CONSUME(symbols_exports.LParen);
|
|
@@ -12449,7 +12452,7 @@ var pathNegatedPropertySet = {
|
|
|
12449
12452
|
});
|
|
12450
12453
|
const close = CONSUME(symbols_exports.RParen);
|
|
12451
12454
|
return ACTION(() => {
|
|
12452
|
-
const F3 = C.
|
|
12455
|
+
const F3 = C.astFactory;
|
|
12453
12456
|
if (tail.length === 0) {
|
|
12454
12457
|
return F3.path("!", [head2], F3.sourceLocation(exclamation2, close));
|
|
12455
12458
|
}
|
|
@@ -12470,7 +12473,7 @@ var pathOneInPropertySet = {
|
|
|
12470
12473
|
{ ALT: () => SUBRULE2(iri2) },
|
|
12471
12474
|
{ ALT: () => SUBRULE2(verbA) }
|
|
12472
12475
|
]);
|
|
12473
|
-
return ACTION(() => C.
|
|
12476
|
+
return ACTION(() => C.astFactory.path("^", [item], C.astFactory.sourceLocation(hat2, item)));
|
|
12474
12477
|
} }
|
|
12475
12478
|
])
|
|
12476
12479
|
};
|
|
@@ -12495,33 +12498,35 @@ function triplesDotSeperated(triplesSameSubjectSubrule) {
|
|
|
12495
12498
|
});
|
|
12496
12499
|
}
|
|
12497
12500
|
});
|
|
12498
|
-
return ACTION(() => C.
|
|
12501
|
+
return ACTION(() => C.astFactory.patternBgp(triples, C.astFactory.sourceLocation(...triples, dotToken)));
|
|
12499
12502
|
};
|
|
12500
12503
|
}
|
|
12501
12504
|
var triplesBlock = {
|
|
12502
12505
|
name: "triplesBlock",
|
|
12503
12506
|
impl: (implArgs) => (C) => triplesDotSeperated(triplesSameSubjectPath)(implArgs)(C),
|
|
12504
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, {
|
|
12507
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, { astFactory: F3 }) => {
|
|
12505
12508
|
for (const [index, triple] of ast.triples.entries()) {
|
|
12506
12509
|
HANDLE_LOC(triple, () => {
|
|
12507
12510
|
const nextTriple = ast.triples.at(index);
|
|
12508
12511
|
if (F3.isTripleCollection(triple)) {
|
|
12509
12512
|
SUBRULE(graphNodePath, triple);
|
|
12510
|
-
F3.printFilter(triple, () => PRINT_WORD("
|
|
12513
|
+
F3.printFilter(triple, () => PRINT_WORD(".\n"));
|
|
12511
12514
|
} else {
|
|
12512
12515
|
SUBRULE(graphNodePath, triple.subject);
|
|
12516
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12513
12517
|
if (F3.isTerm(triple.predicate) && F3.isTermVariable(triple.predicate)) {
|
|
12514
12518
|
SUBRULE(varOrTerm, triple.predicate);
|
|
12515
12519
|
} else {
|
|
12516
12520
|
SUBRULE(pathGenerator, triple.predicate, void 0);
|
|
12517
12521
|
}
|
|
12522
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12518
12523
|
SUBRULE(graphNodePath, triple.object);
|
|
12519
12524
|
if (nextTriple === void 0 || F3.isTripleCollection(nextTriple) || !F3.isSourceLocationNoMaterialize(nextTriple.subject.loc)) {
|
|
12520
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12525
|
+
F3.printFilter(ast, () => PRINT_WORD(".\n"));
|
|
12521
12526
|
} else if (F3.isSourceLocationNoMaterialize(nextTriple.predicate.loc)) {
|
|
12522
12527
|
F3.printFilter(ast, () => PRINT_WORD(","));
|
|
12523
12528
|
} else {
|
|
12524
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12529
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
12525
12530
|
}
|
|
12526
12531
|
}
|
|
12527
12532
|
});
|
|
@@ -12534,24 +12539,24 @@ function triplesSameSubjectImpl(name, allowPaths) {
|
|
|
12534
12539
|
impl: ({ ACTION, SUBRULE, OR }) => (C) => OR([
|
|
12535
12540
|
{ ALT: () => {
|
|
12536
12541
|
const subject = SUBRULE(varOrTerm);
|
|
12537
|
-
const res = SUBRULE(allowPaths ? propertyListPathNotEmpty : propertyListNotEmpty, ACTION(() => C.
|
|
12542
|
+
const res = SUBRULE(allowPaths ? propertyListPathNotEmpty : propertyListNotEmpty, ACTION(() => C.astFactory.dematerialized(subject)));
|
|
12538
12543
|
return ACTION(() => {
|
|
12539
12544
|
if (res.length > 0) {
|
|
12540
12545
|
res[0].subject = subject;
|
|
12541
|
-
res[0].loc = C.
|
|
12546
|
+
res[0].loc = C.astFactory.sourceLocation(subject, res[0]);
|
|
12542
12547
|
}
|
|
12543
12548
|
return res;
|
|
12544
12549
|
});
|
|
12545
12550
|
} },
|
|
12546
12551
|
{ ALT: () => {
|
|
12547
12552
|
const subjectNode = SUBRULE(allowPaths ? triplesNodePath : triplesNode);
|
|
12548
|
-
const restNode = SUBRULE(allowPaths ? propertyListPath : propertyList, ACTION(() => C.
|
|
12553
|
+
const restNode = SUBRULE(allowPaths ? propertyListPath : propertyList, ACTION(() => C.astFactory.graphNodeIdentifier(subjectNode)));
|
|
12549
12554
|
return ACTION(() => {
|
|
12550
12555
|
if (restNode.length === 0) {
|
|
12551
12556
|
return [subjectNode];
|
|
12552
12557
|
}
|
|
12553
12558
|
restNode[0].subject = subjectNode;
|
|
12554
|
-
restNode[0].loc = C.
|
|
12559
|
+
restNode[0].loc = C.astFactory.sourceLocation(subjectNode, restNode[0]);
|
|
12555
12560
|
return restNode;
|
|
12556
12561
|
});
|
|
12557
12562
|
} }
|
|
@@ -12635,7 +12640,7 @@ function objectImpl(name, allowPaths) {
|
|
|
12635
12640
|
name,
|
|
12636
12641
|
impl: ({ ACTION, SUBRULE }) => (C, subject, predicate) => {
|
|
12637
12642
|
const node = SUBRULE(allowPaths ? graphNodePath : graphNode);
|
|
12638
|
-
return ACTION(() => C.
|
|
12643
|
+
return ACTION(() => C.astFactory.triple(subject, predicate, node));
|
|
12639
12644
|
}
|
|
12640
12645
|
};
|
|
12641
12646
|
}
|
|
@@ -12652,7 +12657,7 @@ function collectionImpl(name, allowPaths) {
|
|
|
12652
12657
|
});
|
|
12653
12658
|
const endToken = CONSUME(symbols_exports.RParen);
|
|
12654
12659
|
return ACTION(() => {
|
|
12655
|
-
const F3 = C.
|
|
12660
|
+
const F3 = C.astFactory;
|
|
12656
12661
|
const triples = [];
|
|
12657
12662
|
const predFirst = F3.namedNode(F3.sourceLocationNoMaterialize(), CommonIRIs.FIRST, void 0);
|
|
12658
12663
|
const predRest = F3.namedNode(F3.sourceLocationNoMaterialize(), CommonIRIs.REST, void 0);
|
|
@@ -12676,7 +12681,7 @@ function collectionImpl(name, allowPaths) {
|
|
|
12676
12681
|
return F3.tripleCollectionList(listHead, triples, F3.sourceLocation(startToken, endToken));
|
|
12677
12682
|
});
|
|
12678
12683
|
},
|
|
12679
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12684
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12680
12685
|
F3.printFilter(ast, () => PRINT_WORD("("));
|
|
12681
12686
|
for (const [idx, triple] of ast.triples.entries()) {
|
|
12682
12687
|
if (idx % 2 === 0) {
|
|
@@ -12707,13 +12712,17 @@ function blankNodePropertyListImpl(name, allowPaths) {
|
|
|
12707
12712
|
name,
|
|
12708
12713
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12709
12714
|
const startToken = CONSUME(symbols_exports.LSquare);
|
|
12710
|
-
const blankNode2 = ACTION(() => C.
|
|
12715
|
+
const blankNode2 = ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocationNoMaterialize()));
|
|
12711
12716
|
const propList = SUBRULE(propertyPathNotEmptyImpl, blankNode2);
|
|
12712
12717
|
const endToken = CONSUME(symbols_exports.RSquare);
|
|
12713
|
-
return ACTION(() => C.
|
|
12718
|
+
return ACTION(() => C.astFactory.tripleCollectionBlankNodeProperties(blankNode2, propList, C.astFactory.sourceLocation(startToken, endToken)));
|
|
12714
12719
|
},
|
|
12715
|
-
gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC }) => (ast,
|
|
12716
|
-
F3
|
|
12720
|
+
gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY }) => (ast, c) => {
|
|
12721
|
+
const { astFactory: F3, indentInc } = c;
|
|
12722
|
+
F3.printFilter(ast, () => {
|
|
12723
|
+
c[traqulaIndentation] += indentInc;
|
|
12724
|
+
PRINT("[\n");
|
|
12725
|
+
});
|
|
12717
12726
|
for (const triple of ast.triples) {
|
|
12718
12727
|
HANDLE_LOC(triple, () => {
|
|
12719
12728
|
if (F3.isTerm(triple.predicate) && F3.isTermVariable(triple.predicate)) {
|
|
@@ -12721,11 +12730,15 @@ function blankNodePropertyListImpl(name, allowPaths) {
|
|
|
12721
12730
|
} else {
|
|
12722
12731
|
SUBRULE(pathGenerator, triple.predicate, void 0);
|
|
12723
12732
|
}
|
|
12733
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12724
12734
|
SUBRULE(graphNodePath, triple.object);
|
|
12725
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12735
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
12726
12736
|
});
|
|
12727
12737
|
}
|
|
12728
|
-
F3.printFilter(ast, () =>
|
|
12738
|
+
F3.printFilter(ast, () => {
|
|
12739
|
+
c[traqulaIndentation] -= indentInc;
|
|
12740
|
+
PRINT_ON_EMPTY("]");
|
|
12741
|
+
});
|
|
12729
12742
|
}
|
|
12730
12743
|
};
|
|
12731
12744
|
}
|
|
@@ -12742,7 +12755,7 @@ function graphNodeImpl(name, allowPaths) {
|
|
|
12742
12755
|
ALT: () => SUBRULE(triplesNodeRule)
|
|
12743
12756
|
}
|
|
12744
12757
|
]),
|
|
12745
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
12758
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
12746
12759
|
if (F3.isTerm(ast)) {
|
|
12747
12760
|
SUBRULE(varOrTerm, ast);
|
|
12748
12761
|
} else {
|
|
@@ -12760,9 +12773,9 @@ var whereClause = {
|
|
|
12760
12773
|
impl: ({ ACTION, SUBRULE, CONSUME, OPTION }) => (C) => {
|
|
12761
12774
|
const where2 = OPTION(() => CONSUME(where));
|
|
12762
12775
|
const group = SUBRULE(groupGraphPattern);
|
|
12763
|
-
return ACTION(() => C.
|
|
12776
|
+
return ACTION(() => C.astFactory.wrap(group, C.astFactory.sourceLocation(where2, group)));
|
|
12764
12777
|
},
|
|
12765
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12778
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12766
12779
|
F3.printFilter(ast, () => PRINT_WORD("WHERE"));
|
|
12767
12780
|
SUBRULE(groupGraphPattern, ast.val);
|
|
12768
12781
|
}
|
|
@@ -12776,19 +12789,26 @@ var groupGraphPattern = {
|
|
|
12776
12789
|
{ ALT: () => SUBRULE(groupGraphPatternSub) }
|
|
12777
12790
|
]);
|
|
12778
12791
|
const close = CONSUME(symbols_exports.RCurly);
|
|
12779
|
-
return ACTION(() => C.
|
|
12792
|
+
return ACTION(() => C.astFactory.patternGroup(patterns, C.astFactory.sourceLocation(open, close)));
|
|
12780
12793
|
},
|
|
12781
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
12782
|
-
F3
|
|
12794
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
12795
|
+
const { astFactory: F3, indentInc } = C;
|
|
12796
|
+
F3.printFilter(ast, () => {
|
|
12797
|
+
C[traqulaIndentation] += indentInc;
|
|
12798
|
+
PRINT_WORD("{\n");
|
|
12799
|
+
});
|
|
12783
12800
|
for (const pattern of ast.patterns) {
|
|
12784
12801
|
SUBRULE(generatePattern, pattern);
|
|
12785
12802
|
}
|
|
12786
|
-
F3.printFilter(ast, () =>
|
|
12803
|
+
F3.printFilter(ast, () => {
|
|
12804
|
+
C[traqulaIndentation] -= indentInc;
|
|
12805
|
+
PRINT_ON_EMPTY("}\n");
|
|
12806
|
+
});
|
|
12787
12807
|
}
|
|
12788
12808
|
};
|
|
12789
12809
|
var generatePattern = {
|
|
12790
12810
|
name: "generatePattern",
|
|
12791
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
12811
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
12792
12812
|
if (ast.type === "query") {
|
|
12793
12813
|
SUBRULE(query, F3.querySelect({
|
|
12794
12814
|
context: [],
|
|
@@ -12877,9 +12897,9 @@ var optionalGraphPattern = {
|
|
|
12877
12897
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12878
12898
|
const optional2 = CONSUME(optional);
|
|
12879
12899
|
const group = SUBRULE(groupGraphPattern);
|
|
12880
|
-
return ACTION(() => C.
|
|
12900
|
+
return ACTION(() => C.astFactory.patternOptional(group.patterns, C.astFactory.sourceLocation(optional2, group)));
|
|
12881
12901
|
},
|
|
12882
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12902
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12883
12903
|
F3.printFilter(ast, () => PRINT_WORD("OPTIONAL"));
|
|
12884
12904
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
12885
12905
|
}
|
|
@@ -12890,9 +12910,9 @@ var graphGraphPattern = {
|
|
|
12890
12910
|
const graph2 = CONSUME(graph_exports.graph);
|
|
12891
12911
|
const name = SUBRULE(varOrIri);
|
|
12892
12912
|
const group = SUBRULE(groupGraphPattern);
|
|
12893
|
-
return ACTION(() => C.
|
|
12913
|
+
return ACTION(() => C.astFactory.patternGraph(name, group.patterns, C.astFactory.sourceLocation(graph2, group)));
|
|
12894
12914
|
},
|
|
12895
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12915
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12896
12916
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
12897
12917
|
SUBRULE(varOrTerm, ast.name);
|
|
12898
12918
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
@@ -12908,9 +12928,9 @@ var serviceGraphPattern = {
|
|
|
12908
12928
|
}) ?? false;
|
|
12909
12929
|
const name = SUBRULE1(varOrIri);
|
|
12910
12930
|
const group = SUBRULE1(groupGraphPattern);
|
|
12911
|
-
return ACTION(() => C.
|
|
12931
|
+
return ACTION(() => C.astFactory.patternService(name, group.patterns, silent2, C.astFactory.sourceLocation(service2, group)));
|
|
12912
12932
|
},
|
|
12913
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12933
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12914
12934
|
F3.printFilter(ast, () => {
|
|
12915
12935
|
PRINT_WORD("SERVICE");
|
|
12916
12936
|
if (ast.silent) {
|
|
@@ -12930,14 +12950,14 @@ var bind2 = {
|
|
|
12930
12950
|
CONSUME(as);
|
|
12931
12951
|
const variable = SUBRULE(var_);
|
|
12932
12952
|
const close = CONSUME(symbols_exports.RParen);
|
|
12933
|
-
return ACTION(() => C.
|
|
12953
|
+
return ACTION(() => C.astFactory.patternBind(expressionVal, variable, C.astFactory.sourceLocation(bind3, close)));
|
|
12934
12954
|
},
|
|
12935
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12955
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12936
12956
|
F3.printFilter(ast, () => PRINT_WORD("BIND", "("));
|
|
12937
12957
|
SUBRULE(expression, ast.expression);
|
|
12938
12958
|
F3.printFilter(ast, () => PRINT_WORD("AS"));
|
|
12939
12959
|
SUBRULE(var_, ast.variable);
|
|
12940
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
12960
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
12941
12961
|
}
|
|
12942
12962
|
};
|
|
12943
12963
|
var inlineData = {
|
|
@@ -12945,16 +12965,19 @@ var inlineData = {
|
|
|
12945
12965
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12946
12966
|
const values3 = CONSUME(values2);
|
|
12947
12967
|
const datablock = SUBRULE(dataBlock);
|
|
12948
|
-
return ACTION(() => C.
|
|
12968
|
+
return ACTION(() => C.astFactory.patternValues(datablock.val, C.astFactory.sourceLocation(values3, datablock)));
|
|
12949
12969
|
},
|
|
12950
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
12970
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
12971
|
+
const { astFactory: F3, indentInc } = C;
|
|
12951
12972
|
const variables = Object.keys(ast.values.at(0) ?? {});
|
|
12952
12973
|
F3.printFilter(ast, () => {
|
|
12974
|
+
PRINT_ON_EMPTY("");
|
|
12953
12975
|
PRINT_WORD("VALUES", "(");
|
|
12954
12976
|
for (const variable of variables) {
|
|
12955
12977
|
PRINT_WORD(`?${variable}`);
|
|
12956
12978
|
}
|
|
12957
|
-
|
|
12979
|
+
C[traqulaIndentation] += indentInc;
|
|
12980
|
+
PRINT_WORD(")", "{\n");
|
|
12958
12981
|
});
|
|
12959
12982
|
for (const mapping of ast.values) {
|
|
12960
12983
|
F3.printFilter(ast, () => PRINT_WORD("("));
|
|
@@ -12965,9 +12988,12 @@ var inlineData = {
|
|
|
12965
12988
|
SUBRULE(graphNodePath, mapping[variable]);
|
|
12966
12989
|
}
|
|
12967
12990
|
}
|
|
12968
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
12991
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
12969
12992
|
}
|
|
12970
|
-
F3.printFilter(ast, () =>
|
|
12993
|
+
F3.printFilter(ast, () => {
|
|
12994
|
+
C[traqulaIndentation] -= indentInc;
|
|
12995
|
+
PRINT_ON_EMPTY("}\n");
|
|
12996
|
+
});
|
|
12971
12997
|
}
|
|
12972
12998
|
};
|
|
12973
12999
|
var dataBlock = {
|
|
@@ -12990,7 +13016,7 @@ var inlineDataOneVar = {
|
|
|
12990
13016
|
});
|
|
12991
13017
|
});
|
|
12992
13018
|
const close = CONSUME(symbols_exports.RCurly);
|
|
12993
|
-
return ACTION(() => C.
|
|
13019
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(varVal, close)));
|
|
12994
13020
|
}
|
|
12995
13021
|
};
|
|
12996
13022
|
var inlineDataFull = {
|
|
@@ -13007,7 +13033,7 @@ var inlineDataFull = {
|
|
|
13007
13033
|
res.push({});
|
|
13008
13034
|
});
|
|
13009
13035
|
const close = CONSUME1(symbols_exports.RCurly);
|
|
13010
|
-
return ACTION(() => C.
|
|
13036
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(nil2, close)));
|
|
13011
13037
|
} },
|
|
13012
13038
|
{ ALT: () => {
|
|
13013
13039
|
const open = CONSUME1(symbols_exports.LParen);
|
|
@@ -13039,7 +13065,7 @@ var inlineDataFull = {
|
|
|
13039
13065
|
});
|
|
13040
13066
|
});
|
|
13041
13067
|
const close = CONSUME2(symbols_exports.RCurly);
|
|
13042
|
-
return ACTION(() => C.
|
|
13068
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(open, close)));
|
|
13043
13069
|
} }
|
|
13044
13070
|
]);
|
|
13045
13071
|
}
|
|
@@ -13062,9 +13088,9 @@ var minusGraphPattern = {
|
|
|
13062
13088
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
13063
13089
|
const minus2 = CONSUME(minus);
|
|
13064
13090
|
const group = SUBRULE(groupGraphPattern);
|
|
13065
|
-
return ACTION(() => C.
|
|
13091
|
+
return ACTION(() => C.astFactory.patternMinus(group.patterns, C.astFactory.sourceLocation(minus2, group)));
|
|
13066
13092
|
},
|
|
13067
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13093
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13068
13094
|
F3.printFilter(ast, () => PRINT_WORD("MINUS"));
|
|
13069
13095
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
13070
13096
|
}
|
|
@@ -13080,9 +13106,9 @@ var groupOrUnionGraphPattern = {
|
|
|
13080
13106
|
const group2 = SUBRULE2(groupGraphPattern);
|
|
13081
13107
|
groups.push(group2);
|
|
13082
13108
|
});
|
|
13083
|
-
return ACTION(() => groups.length === 1 ? groups[0] : C.
|
|
13109
|
+
return ACTION(() => groups.length === 1 ? groups[0] : C.astFactory.patternUnion(groups, C.astFactory.sourceLocation(group, groups.at(-1))));
|
|
13084
13110
|
},
|
|
13085
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13111
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13086
13112
|
if (F3.isPatternUnion(ast)) {
|
|
13087
13113
|
const [head2, ...tail] = ast.patterns;
|
|
13088
13114
|
SUBRULE(groupGraphPattern, head2);
|
|
@@ -13100,12 +13126,12 @@ var filter3 = {
|
|
|
13100
13126
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
13101
13127
|
const filterToken = CONSUME(filter2);
|
|
13102
13128
|
const expression2 = SUBRULE(constraint);
|
|
13103
|
-
return ACTION(() => C.
|
|
13129
|
+
return ACTION(() => C.astFactory.patternFilter(expression2, C.astFactory.sourceLocation(filterToken, expression2)));
|
|
13104
13130
|
},
|
|
13105
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13131
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13106
13132
|
F3.printFilter(ast, () => PRINT_WORD("FILTER ("));
|
|
13107
13133
|
SUBRULE(expression, ast.expression);
|
|
13108
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
13134
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
13109
13135
|
}
|
|
13110
13136
|
};
|
|
13111
13137
|
var constraint = {
|
|
@@ -13121,7 +13147,7 @@ var functionCall = {
|
|
|
13121
13147
|
impl: ({ ACTION, SUBRULE }) => (C) => {
|
|
13122
13148
|
const func = SUBRULE(iri2);
|
|
13123
13149
|
const args = SUBRULE(argList);
|
|
13124
|
-
return ACTION(() => C.
|
|
13150
|
+
return ACTION(() => C.astFactory.expressionFunctionCall(func, args.val.args, args.val.distinct, C.astFactory.sourceLocation(func, args)));
|
|
13125
13151
|
}
|
|
13126
13152
|
};
|
|
13127
13153
|
|
|
@@ -13131,7 +13157,7 @@ var argList = {
|
|
|
13131
13157
|
impl: ({ ACTION, CONSUME, SUBRULE1, OPTION, OR, AT_LEAST_ONE_SEP }) => (C) => OR([
|
|
13132
13158
|
{ ALT: () => {
|
|
13133
13159
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
13134
|
-
return ACTION(() => C.
|
|
13160
|
+
return ACTION(() => C.astFactory.wrap({ args: [], distinct: false }, C.astFactory.sourceLocation(nil2)));
|
|
13135
13161
|
} },
|
|
13136
13162
|
{ ALT: () => {
|
|
13137
13163
|
const args = [];
|
|
@@ -13148,10 +13174,10 @@ var argList = {
|
|
|
13148
13174
|
}
|
|
13149
13175
|
});
|
|
13150
13176
|
const close = CONSUME(symbols_exports.RParen);
|
|
13151
|
-
return ACTION(() => C.
|
|
13177
|
+
return ACTION(() => C.astFactory.wrap({ args, distinct: distinct2 }, C.astFactory.sourceLocation(open, close)));
|
|
13152
13178
|
} }
|
|
13153
13179
|
]),
|
|
13154
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13180
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13155
13181
|
F3.printFilter(ast, () => {
|
|
13156
13182
|
PRINT_WORD("(");
|
|
13157
13183
|
if (ast.val.distinct) {
|
|
@@ -13174,7 +13200,7 @@ var expressionList = {
|
|
|
13174
13200
|
impl: ({ ACTION, CONSUME, MANY, OR, SUBRULE1, SUBRULE2 }) => (C) => OR([
|
|
13175
13201
|
{ ALT: () => {
|
|
13176
13202
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
13177
|
-
return ACTION(() => C.
|
|
13203
|
+
return ACTION(() => C.astFactory.wrap([], C.astFactory.sourceLocation(nil2)));
|
|
13178
13204
|
} },
|
|
13179
13205
|
{ ALT: () => {
|
|
13180
13206
|
const open = CONSUME(symbols_exports.LParen);
|
|
@@ -13186,7 +13212,7 @@ var expressionList = {
|
|
|
13186
13212
|
args.push(expr);
|
|
13187
13213
|
});
|
|
13188
13214
|
const close = CONSUME(symbols_exports.RParen);
|
|
13189
|
-
return ACTION(() => C.
|
|
13215
|
+
return ACTION(() => C.astFactory.wrap(args, C.astFactory.sourceLocation(open, close)));
|
|
13190
13216
|
} }
|
|
13191
13217
|
])
|
|
13192
13218
|
};
|
|
@@ -13195,7 +13221,7 @@ var prefixOperator = /* @__PURE__ */ new Set(["!", "UPLUS", "UMINUS"]);
|
|
|
13195
13221
|
var expression = {
|
|
13196
13222
|
name: "expression",
|
|
13197
13223
|
impl: ({ SUBRULE }) => () => SUBRULE(conditionalOrExpression),
|
|
13198
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13224
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13199
13225
|
if (F3.isTerm(ast)) {
|
|
13200
13226
|
SUBRULE(varOrTerm, ast);
|
|
13201
13227
|
} else if (F3.isExpressionOperator(ast)) {
|
|
@@ -13260,7 +13286,7 @@ var conditionalOrExpression = {
|
|
|
13260
13286
|
impl: ({ ACTION, MANY, CONSUME, SUBRULE1, SUBRULE2 }) => (C) => constructLeftDeep(() => SUBRULE1(conditionalAndExpression), () => {
|
|
13261
13287
|
CONSUME(symbols_exports.logicOr);
|
|
13262
13288
|
const args = SUBRULE2(conditionalAndExpression);
|
|
13263
|
-
return (left) => ACTION(() => C.
|
|
13289
|
+
return (left) => ACTION(() => C.astFactory.expressionOperation("||", [left, args], C.astFactory.sourceLocation(left, args)));
|
|
13264
13290
|
}, ACTION, MANY)
|
|
13265
13291
|
};
|
|
13266
13292
|
var conditionalAndExpression = {
|
|
@@ -13268,7 +13294,7 @@ var conditionalAndExpression = {
|
|
|
13268
13294
|
impl: ({ ACTION, MANY, SUBRULE1, SUBRULE2, CONSUME }) => (C) => constructLeftDeep(() => SUBRULE1(valueLogical), () => {
|
|
13269
13295
|
CONSUME(symbols_exports.logicAnd);
|
|
13270
13296
|
const arg = SUBRULE2(valueLogical);
|
|
13271
|
-
return (left) => ACTION(() => C.
|
|
13297
|
+
return (left) => ACTION(() => C.astFactory.expressionOperation("&&", [left, arg], C.astFactory.sourceLocation(left, arg)));
|
|
13272
13298
|
}, ACTION, MANY)
|
|
13273
13299
|
};
|
|
13274
13300
|
var valueLogical = {
|
|
@@ -13290,7 +13316,7 @@ var relationalExpression = {
|
|
|
13290
13316
|
{ ALT: () => CONSUME(symbols_exports.greaterThanEqual) }
|
|
13291
13317
|
]);
|
|
13292
13318
|
const expr = SUBRULE2(numericExpression);
|
|
13293
|
-
return ACTION(() => C.
|
|
13319
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [args1, expr], C.astFactory.sourceLocation(args1, expr)));
|
|
13294
13320
|
} },
|
|
13295
13321
|
{ ALT: () => {
|
|
13296
13322
|
const operator = OR3([
|
|
@@ -13298,7 +13324,7 @@ var relationalExpression = {
|
|
|
13298
13324
|
{ ALT: () => CONSUME(notIn) }
|
|
13299
13325
|
]);
|
|
13300
13326
|
const args = SUBRULE1(expressionList);
|
|
13301
|
-
return ACTION(() => C.
|
|
13327
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [args1, ...args.val], C.astFactory.sourceLocation(args1, args)));
|
|
13302
13328
|
} }
|
|
13303
13329
|
]));
|
|
13304
13330
|
return expression2 ?? args1;
|
|
@@ -13317,7 +13343,7 @@ var additiveExpression = {
|
|
|
13317
13343
|
{ ALT: () => CONSUME(symbols_exports.opMinus) }
|
|
13318
13344
|
]);
|
|
13319
13345
|
const arg = SUBRULE2(multiplicativeExpression);
|
|
13320
|
-
return ACTION(() => (left) => C.
|
|
13346
|
+
return ACTION(() => (left) => C.astFactory.expressionOperation(operator.image, [left, arg], C.astFactory.sourceLocation(left, arg)));
|
|
13321
13347
|
} },
|
|
13322
13348
|
{ ALT: () => {
|
|
13323
13349
|
const { operator, startInt } = OR3([
|
|
@@ -13348,9 +13374,9 @@ var additiveExpression = {
|
|
|
13348
13374
|
{ ALT: () => CONSUME(symbols_exports.slash) }
|
|
13349
13375
|
]);
|
|
13350
13376
|
const innerExpr = SUBRULE1(unaryExpression);
|
|
13351
|
-
return ACTION(() => (leftInner) => C.
|
|
13377
|
+
return ACTION(() => (leftInner) => C.astFactory.expressionOperation(innerOperator.image, [leftInner, innerExpr], C.astFactory.sourceLocation(leftInner, innerExpr)));
|
|
13352
13378
|
}, ACTION, MANY2);
|
|
13353
|
-
return (left) => C.
|
|
13379
|
+
return (left) => C.astFactory.expressionOperation(operator, [left, multiplicativeExpr], C.astFactory.sourceLocation(left, multiplicativeExpr));
|
|
13354
13380
|
} }
|
|
13355
13381
|
]), ACTION, MANY1)
|
|
13356
13382
|
};
|
|
@@ -13367,7 +13393,7 @@ var multiplicativeExpression = {
|
|
|
13367
13393
|
subType: "operation",
|
|
13368
13394
|
operator: operator.image,
|
|
13369
13395
|
args: [left, expr],
|
|
13370
|
-
loc: C.
|
|
13396
|
+
loc: C.astFactory.sourceLocation(left, expr)
|
|
13371
13397
|
});
|
|
13372
13398
|
}, ACTION, MANY)
|
|
13373
13399
|
};
|
|
@@ -13382,7 +13408,7 @@ var unaryExpression = {
|
|
|
13382
13408
|
{ ALT: () => CONSUME(symbols_exports.opMinus) }
|
|
13383
13409
|
]);
|
|
13384
13410
|
const expr = SUBRULE2(primaryExpression);
|
|
13385
|
-
return ACTION(() => C.
|
|
13411
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image === "!" ? "!" : operator.image === "+" ? "UPLUS" : "UMINUS", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
13386
13412
|
} }
|
|
13387
13413
|
])
|
|
13388
13414
|
};
|
|
@@ -13405,7 +13431,7 @@ var brackettedExpression = {
|
|
|
13405
13431
|
const expr = SUBRULE(expression);
|
|
13406
13432
|
const close = CONSUME(symbols_exports.RParen);
|
|
13407
13433
|
return ACTION(() => {
|
|
13408
|
-
expr.loc = C.
|
|
13434
|
+
expr.loc = C.astFactory.sourceLocation(open, close);
|
|
13409
13435
|
return expr;
|
|
13410
13436
|
});
|
|
13411
13437
|
}
|
|
@@ -13427,13 +13453,13 @@ var iriOrFunction = {
|
|
|
13427
13453
|
function: iriVal,
|
|
13428
13454
|
args: args.val.args,
|
|
13429
13455
|
distinct: distinct2,
|
|
13430
|
-
loc: C.
|
|
13456
|
+
loc: C.astFactory.sourceLocation(iriVal, args)
|
|
13431
13457
|
};
|
|
13432
13458
|
});
|
|
13433
13459
|
});
|
|
13434
13460
|
return functionCall2 ?? iriVal;
|
|
13435
13461
|
},
|
|
13436
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13462
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13437
13463
|
if (F3.isTermNamed(ast)) {
|
|
13438
13464
|
SUBRULE(iri2, ast);
|
|
13439
13465
|
} else {
|
|
@@ -13486,11 +13512,14 @@ var groupClause = {
|
|
|
13486
13512
|
type: "solutionModifier",
|
|
13487
13513
|
subType: "group",
|
|
13488
13514
|
groupings,
|
|
13489
|
-
loc: C.
|
|
13515
|
+
loc: C.astFactory.sourceLocation(start, groupings.at(-1))
|
|
13490
13516
|
}));
|
|
13491
13517
|
},
|
|
13492
|
-
gImpl: ({ PRINT_WORDS, SUBRULE }) => (ast, {
|
|
13493
|
-
F3.printFilter(ast, () =>
|
|
13518
|
+
gImpl: ({ PRINT_WORDS, SUBRULE, PRINT_ON_EMPTY }) => (ast, { astFactory: F3 }) => {
|
|
13519
|
+
F3.printFilter(ast, () => {
|
|
13520
|
+
PRINT_ON_EMPTY("");
|
|
13521
|
+
PRINT_WORDS("GROUP", "BY");
|
|
13522
|
+
});
|
|
13494
13523
|
for (const grouping of ast.groupings) {
|
|
13495
13524
|
if (F3.isExpression(grouping)) {
|
|
13496
13525
|
SUBRULE(expression, grouping);
|
|
@@ -13524,7 +13553,7 @@ var groupCondition = {
|
|
|
13524
13553
|
return {
|
|
13525
13554
|
variable,
|
|
13526
13555
|
value: expressionValue,
|
|
13527
|
-
loc: C.
|
|
13556
|
+
loc: C.astFactory.sourceLocation(open, close)
|
|
13528
13557
|
};
|
|
13529
13558
|
}
|
|
13530
13559
|
return expressionValue;
|
|
@@ -13543,10 +13572,13 @@ var havingClause = {
|
|
|
13543
13572
|
expressions.push(SUBRULE(havingCondition));
|
|
13544
13573
|
});
|
|
13545
13574
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13546
|
-
return ACTION(() => C.
|
|
13575
|
+
return ACTION(() => C.astFactory.solutionModifierHaving(expressions, C.astFactory.sourceLocation(having2, expressions.at(-1))));
|
|
13547
13576
|
},
|
|
13548
|
-
gImpl: ({ PRINT_WORD, SUBRULE }) => (ast, {
|
|
13549
|
-
F3.printFilter(ast, () =>
|
|
13577
|
+
gImpl: ({ PRINT_WORD, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13578
|
+
F3.printFilter(ast, () => {
|
|
13579
|
+
PRINT_ON_EMPTY("");
|
|
13580
|
+
PRINT_WORD("HAVING");
|
|
13581
|
+
});
|
|
13550
13582
|
for (const having2 of ast.having) {
|
|
13551
13583
|
SUBRULE(expression, having2);
|
|
13552
13584
|
}
|
|
@@ -13567,10 +13599,13 @@ var orderClause = {
|
|
|
13567
13599
|
orderings.push(SUBRULE1(orderCondition));
|
|
13568
13600
|
});
|
|
13569
13601
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13570
|
-
return ACTION(() => C.
|
|
13602
|
+
return ACTION(() => C.astFactory.solutionModifierOrder(orderings, C.astFactory.sourceLocation(order2, orderings.at(-1))));
|
|
13571
13603
|
},
|
|
13572
|
-
gImpl: ({ PRINT_WORDS, SUBRULE }) => (ast, {
|
|
13573
|
-
F3.printFilter(ast, () =>
|
|
13604
|
+
gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13605
|
+
F3.printFilter(ast, () => {
|
|
13606
|
+
PRINT_ON_EMPTY("");
|
|
13607
|
+
PRINT_WORDS("ORDER", "BY");
|
|
13608
|
+
});
|
|
13574
13609
|
for (const ordering of ast.orderDefs) {
|
|
13575
13610
|
if (ordering.descending) {
|
|
13576
13611
|
F3.printFilter(ast, () => PRINT_WORDS("DESC"));
|
|
@@ -13601,7 +13636,7 @@ var orderCondition = {
|
|
|
13601
13636
|
return ACTION(() => ({
|
|
13602
13637
|
expression: expr,
|
|
13603
13638
|
descending: descending[0],
|
|
13604
|
-
loc: C.
|
|
13639
|
+
loc: C.astFactory.sourceLocation(descending[1], expr)
|
|
13605
13640
|
}));
|
|
13606
13641
|
} },
|
|
13607
13642
|
{ ALT: () => {
|
|
@@ -13620,16 +13655,17 @@ var limitOffsetClauses = {
|
|
|
13620
13655
|
{ ALT: () => {
|
|
13621
13656
|
const limit2 = SUBRULE1(limitClause);
|
|
13622
13657
|
const offset2 = OPTION1(() => SUBRULE1(offsetClause));
|
|
13623
|
-
return ACTION(() => C.
|
|
13658
|
+
return ACTION(() => C.astFactory.solutionModifierLimitOffset(limit2.val, offset2?.val, C.astFactory.sourceLocation(limit2, ...offset2 ? [offset2] : [])));
|
|
13624
13659
|
} },
|
|
13625
13660
|
{ ALT: () => {
|
|
13626
13661
|
const offset2 = SUBRULE2(offsetClause);
|
|
13627
13662
|
const limit2 = OPTION2(() => SUBRULE2(limitClause));
|
|
13628
|
-
return ACTION(() => C.
|
|
13663
|
+
return ACTION(() => C.astFactory.solutionModifierLimitOffset(limit2?.val, offset2.val, C.astFactory.sourceLocation(offset2, limit2)));
|
|
13629
13664
|
} }
|
|
13630
13665
|
]),
|
|
13631
|
-
gImpl: ({ PRINT_WORDS }) => (ast, {
|
|
13666
|
+
gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY }) => (ast, { astFactory: F3 }) => {
|
|
13632
13667
|
F3.printFilter(ast, () => {
|
|
13668
|
+
PRINT_ON_EMPTY("");
|
|
13633
13669
|
if (ast.limit) {
|
|
13634
13670
|
PRINT_WORDS("LIMIT", String(ast.limit));
|
|
13635
13671
|
}
|
|
@@ -13645,7 +13681,7 @@ var limitClause = {
|
|
|
13645
13681
|
const offset2 = CONSUME(limit);
|
|
13646
13682
|
const value = CONSUME(terminals_exports.integer);
|
|
13647
13683
|
const val = Number.parseInt(value.image, 10);
|
|
13648
|
-
return ACTION(() => C.
|
|
13684
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(offset2, value)));
|
|
13649
13685
|
}
|
|
13650
13686
|
};
|
|
13651
13687
|
var offsetClause = {
|
|
@@ -13654,7 +13690,7 @@ var offsetClause = {
|
|
|
13654
13690
|
const offset2 = CONSUME(offset);
|
|
13655
13691
|
const value = CONSUME(terminals_exports.integer);
|
|
13656
13692
|
const val = Number.parseInt(value.image, 10);
|
|
13657
|
-
return ACTION(() => C.
|
|
13693
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(offset2, value)));
|
|
13658
13694
|
}
|
|
13659
13695
|
};
|
|
13660
13696
|
|
|
@@ -13679,10 +13715,10 @@ var query = {
|
|
|
13679
13715
|
...subType,
|
|
13680
13716
|
type: "query",
|
|
13681
13717
|
...values3 && { values: values3 },
|
|
13682
|
-
loc: C.
|
|
13718
|
+
loc: C.astFactory.sourceLocation(prologueValues.at(0), subType, values3)
|
|
13683
13719
|
}));
|
|
13684
13720
|
},
|
|
13685
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13721
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13686
13722
|
SUBRULE(prologue, ast.context);
|
|
13687
13723
|
if (F3.isQuerySelect(ast)) {
|
|
13688
13724
|
SUBRULE(selectQuery, ast);
|
|
@@ -13712,13 +13748,13 @@ var selectQuery = {
|
|
|
13712
13748
|
solutionModifiers: modifiers,
|
|
13713
13749
|
datasets: from2,
|
|
13714
13750
|
...selectVal.val,
|
|
13715
|
-
loc: C.
|
|
13751
|
+
loc: C.astFactory.sourceLocation(selectVal, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13716
13752
|
};
|
|
13717
13753
|
queryIsGood(ret);
|
|
13718
13754
|
return ret;
|
|
13719
13755
|
});
|
|
13720
13756
|
},
|
|
13721
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13757
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13722
13758
|
SUBRULE(selectClause, F3.wrap({
|
|
13723
13759
|
variables: ast.variables,
|
|
13724
13760
|
distinct: ast.distinct,
|
|
@@ -13736,14 +13772,14 @@ var subSelect = {
|
|
|
13736
13772
|
const where2 = SUBRULE(whereClause);
|
|
13737
13773
|
const modifiers = SUBRULE(solutionModifier);
|
|
13738
13774
|
const values3 = SUBRULE(valuesClause);
|
|
13739
|
-
return ACTION(() => C.
|
|
13775
|
+
return ACTION(() => C.astFactory.querySelect({
|
|
13740
13776
|
where: where2.val,
|
|
13741
|
-
datasets: C.
|
|
13777
|
+
datasets: C.astFactory.datasetClauses([], C.astFactory.sourceLocation()),
|
|
13742
13778
|
context: [],
|
|
13743
13779
|
solutionModifiers: modifiers,
|
|
13744
13780
|
...selectVal.val,
|
|
13745
13781
|
...values3 && { values: values3 }
|
|
13746
|
-
}, C.
|
|
13782
|
+
}, C.astFactory.sourceLocation(selectVal, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset, values3)));
|
|
13747
13783
|
}
|
|
13748
13784
|
};
|
|
13749
13785
|
var selectClause = {
|
|
@@ -13774,7 +13810,7 @@ var selectClause = {
|
|
|
13774
13810
|
const star2 = CONSUME(symbols_exports.star);
|
|
13775
13811
|
return ACTION(() => {
|
|
13776
13812
|
last2 = star2;
|
|
13777
|
-
return { variables: [C.
|
|
13813
|
+
return { variables: [C.astFactory.wildcard(C.astFactory.sourceLocation(star2))], ...distRed };
|
|
13778
13814
|
});
|
|
13779
13815
|
} },
|
|
13780
13816
|
{ ALT: () => {
|
|
@@ -13804,7 +13840,7 @@ var selectClause = {
|
|
|
13804
13840
|
throw new Error(`Variable ${variable.value} used more than once in SELECT clause`);
|
|
13805
13841
|
}
|
|
13806
13842
|
usedVars.push(variable);
|
|
13807
|
-
variables.push(C.
|
|
13843
|
+
variables.push(C.astFactory.patternBind(expr, variable, C.astFactory.sourceLocation(open, last2)));
|
|
13808
13844
|
});
|
|
13809
13845
|
} }
|
|
13810
13846
|
]));
|
|
@@ -13812,9 +13848,9 @@ var selectClause = {
|
|
|
13812
13848
|
} }
|
|
13813
13849
|
]);
|
|
13814
13850
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13815
|
-
return ACTION(() => C.
|
|
13851
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(select2, last2)));
|
|
13816
13852
|
},
|
|
13817
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13853
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13818
13854
|
F3.printFilter(ast, () => {
|
|
13819
13855
|
PRINT_WORD("SELECT");
|
|
13820
13856
|
if (ast.val.distinct) {
|
|
@@ -13854,7 +13890,7 @@ var constructQuery = {
|
|
|
13854
13890
|
datasets: from2,
|
|
13855
13891
|
where: where2.val,
|
|
13856
13892
|
solutionModifiers: modifiers,
|
|
13857
|
-
loc: C.
|
|
13893
|
+
loc: C.astFactory.sourceLocation(construct2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13858
13894
|
}));
|
|
13859
13895
|
} },
|
|
13860
13896
|
{ ALT: () => {
|
|
@@ -13866,19 +13902,26 @@ var constructQuery = {
|
|
|
13866
13902
|
subType: "construct",
|
|
13867
13903
|
template: template.val,
|
|
13868
13904
|
datasets: from2,
|
|
13869
|
-
where: C.
|
|
13905
|
+
where: C.astFactory.patternGroup([template.val], C.astFactory.sourceLocation()),
|
|
13870
13906
|
solutionModifiers: modifiers,
|
|
13871
|
-
loc: C.
|
|
13907
|
+
loc: C.astFactory.sourceLocation(construct2, template, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13872
13908
|
}));
|
|
13873
13909
|
} }
|
|
13874
13910
|
]);
|
|
13875
13911
|
},
|
|
13876
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
13912
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
13913
|
+
const { astFactory: F3, indentInc } = C;
|
|
13877
13914
|
F3.printFilter(ast, () => PRINT_WORD("CONSTRUCT"));
|
|
13878
13915
|
if (!F3.isSourceLocationNoMaterialize(ast.where.loc)) {
|
|
13879
|
-
F3.printFilter(ast, () =>
|
|
13916
|
+
F3.printFilter(ast, () => {
|
|
13917
|
+
C[traqulaIndentation] += indentInc;
|
|
13918
|
+
PRINT_WORD("{\n");
|
|
13919
|
+
});
|
|
13880
13920
|
SUBRULE(triplesBlock, ast.template);
|
|
13881
|
-
F3.printFilter(ast, () =>
|
|
13921
|
+
F3.printFilter(ast, () => {
|
|
13922
|
+
C[traqulaIndentation] -= indentInc;
|
|
13923
|
+
PRINT_ON_EMPTY("}\n");
|
|
13924
|
+
});
|
|
13882
13925
|
}
|
|
13883
13926
|
SUBRULE(datasetClauseStar, ast.datasets);
|
|
13884
13927
|
if (F3.isSourceLocationNoMaterialize(ast.where.loc)) {
|
|
@@ -13903,7 +13946,7 @@ var describeQuery = {
|
|
|
13903
13946
|
} },
|
|
13904
13947
|
{ ALT: () => {
|
|
13905
13948
|
const star2 = CONSUME(symbols_exports.star);
|
|
13906
|
-
return [ACTION(() => C.
|
|
13949
|
+
return [ACTION(() => C.astFactory.wildcard(C.astFactory.sourceLocation(star2)))];
|
|
13907
13950
|
} }
|
|
13908
13951
|
]);
|
|
13909
13952
|
const from2 = SUBRULE1(datasetClauseStar);
|
|
@@ -13915,10 +13958,10 @@ var describeQuery = {
|
|
|
13915
13958
|
datasets: from2,
|
|
13916
13959
|
...where2 && { where: where2.val },
|
|
13917
13960
|
solutionModifiers: modifiers,
|
|
13918
|
-
loc: C.
|
|
13961
|
+
loc: C.astFactory.sourceLocation(describe2, ...variables, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13919
13962
|
}));
|
|
13920
13963
|
},
|
|
13921
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13964
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13922
13965
|
F3.printFilter(ast, () => PRINT_WORD("DESCRIBE"));
|
|
13923
13966
|
if (F3.isWildcard(ast.variables[0])) {
|
|
13924
13967
|
F3.printFilter(ast, () => PRINT_WORD("*"));
|
|
@@ -13946,10 +13989,10 @@ var askQuery = {
|
|
|
13946
13989
|
datasets: from2,
|
|
13947
13990
|
where: where2.val,
|
|
13948
13991
|
solutionModifiers: modifiers,
|
|
13949
|
-
loc: C.
|
|
13992
|
+
loc: C.astFactory.sourceLocation(ask2, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13950
13993
|
}));
|
|
13951
13994
|
},
|
|
13952
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13995
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13953
13996
|
F3.printFilter(ast, () => PRINT_WORD("ASK"));
|
|
13954
13997
|
SUBRULE(datasetClauseStar, ast.datasets);
|
|
13955
13998
|
SUBRULE(whereClause, F3.wrap(ast.where, ast.loc));
|
|
@@ -13966,7 +14009,7 @@ var constructTemplate = {
|
|
|
13966
14009
|
const open = CONSUME(symbols_exports.LCurly);
|
|
13967
14010
|
const triples = OPTION(() => SUBRULE1(constructTriples));
|
|
13968
14011
|
const close = CONSUME(symbols_exports.RCurly);
|
|
13969
|
-
return ACTION(() => C.
|
|
14012
|
+
return ACTION(() => C.astFactory.wrap(triples ?? C.astFactory.patternBgp([], C.astFactory.sourceLocation()), C.astFactory.sourceLocation(open, close)));
|
|
13970
14013
|
}
|
|
13971
14014
|
};
|
|
13972
14015
|
var constructTriples = {
|
|
@@ -14003,13 +14046,13 @@ var update = {
|
|
|
14003
14046
|
const update2 = {
|
|
14004
14047
|
type: "update",
|
|
14005
14048
|
updates,
|
|
14006
|
-
loc: C.
|
|
14049
|
+
loc: C.astFactory.sourceLocation(...updates[0].context, updates[0].operation, ...updates.at(-1).context, updates.at(-1)?.operation)
|
|
14007
14050
|
};
|
|
14008
14051
|
updateNoReuseBlankNodeLabels(update2);
|
|
14009
14052
|
return update2;
|
|
14010
14053
|
});
|
|
14011
14054
|
},
|
|
14012
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14055
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14013
14056
|
const [head2, ...tail] = ast.updates;
|
|
14014
14057
|
if (head2) {
|
|
14015
14058
|
SUBRULE(prologue, head2.context);
|
|
@@ -14089,9 +14132,9 @@ var load2 = {
|
|
|
14089
14132
|
CONSUME(loadInto);
|
|
14090
14133
|
return SUBRULE1(graphRef);
|
|
14091
14134
|
});
|
|
14092
|
-
return ACTION(() => C.
|
|
14135
|
+
return ACTION(() => C.astFactory.updateOperationLoad(C.astFactory.sourceLocation(loadToken, source, destination), source, Boolean(silent2), destination));
|
|
14093
14136
|
},
|
|
14094
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14137
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14095
14138
|
F3.printFilter(ast, () => {
|
|
14096
14139
|
PRINT_WORD("LOAD");
|
|
14097
14140
|
if (ast.silent) {
|
|
@@ -14112,9 +14155,9 @@ function clearOrDrop(operation) {
|
|
|
14112
14155
|
const opToken = CONSUME(operation);
|
|
14113
14156
|
const silent2 = OPTION(() => CONSUME(silent));
|
|
14114
14157
|
const destination = SUBRULE1(graphRefAll);
|
|
14115
|
-
return ACTION(() => C.
|
|
14158
|
+
return ACTION(() => C.astFactory.updateOperationClearDrop(unCapitalize(operation.name), Boolean(silent2), destination, C.astFactory.sourceLocation(opToken, destination)));
|
|
14116
14159
|
},
|
|
14117
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14160
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14118
14161
|
F3.printFilter(ast, () => {
|
|
14119
14162
|
PRINT_WORD(operation.name.toUpperCase());
|
|
14120
14163
|
if (ast.silent) {
|
|
@@ -14133,9 +14176,9 @@ var create2 = {
|
|
|
14133
14176
|
const createToken3 = CONSUME(create);
|
|
14134
14177
|
const silent2 = OPTION(() => CONSUME(silent));
|
|
14135
14178
|
const destination = SUBRULE1(graphRef);
|
|
14136
|
-
return ACTION(() => C.
|
|
14179
|
+
return ACTION(() => C.astFactory.updateOperationCreate(destination, Boolean(silent2), C.astFactory.sourceLocation(createToken3, destination)));
|
|
14137
14180
|
},
|
|
14138
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14181
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14139
14182
|
F3.printFilter(ast, () => {
|
|
14140
14183
|
PRINT_WORD("CREATE");
|
|
14141
14184
|
if (ast.silent) {
|
|
@@ -14154,9 +14197,9 @@ function copyMoveAddOperation(operation) {
|
|
|
14154
14197
|
const source = SUBRULE1(graphOrDefault);
|
|
14155
14198
|
CONSUME(to);
|
|
14156
14199
|
const destination = SUBRULE2(graphOrDefault);
|
|
14157
|
-
return ACTION(() => C.
|
|
14200
|
+
return ACTION(() => C.astFactory.updateOperationAddMoveCopy(unCapitalize(operation.name), source, destination, Boolean(silent2), C.astFactory.sourceLocation(op, destination)));
|
|
14158
14201
|
},
|
|
14159
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14202
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14160
14203
|
F3.printFilter(ast, () => {
|
|
14161
14204
|
PRINT_WORD(operation.name.toUpperCase());
|
|
14162
14205
|
if (ast.silent) {
|
|
@@ -14178,7 +14221,7 @@ var quadPattern = {
|
|
|
14178
14221
|
const open = CONSUME(symbols_exports.LCurly);
|
|
14179
14222
|
const val = SUBRULE1(quads);
|
|
14180
14223
|
const close = CONSUME(symbols_exports.RCurly);
|
|
14181
|
-
return ACTION(() => C.
|
|
14224
|
+
return ACTION(() => C.astFactory.wrap(val.val, C.astFactory.sourceLocation(open, close)));
|
|
14182
14225
|
}
|
|
14183
14226
|
};
|
|
14184
14227
|
var quadData = {
|
|
@@ -14189,7 +14232,7 @@ var quadData = {
|
|
|
14189
14232
|
const val = SUBRULE1(quads);
|
|
14190
14233
|
ACTION(() => couldParseVars && C.parseMode.add("canParseVars"));
|
|
14191
14234
|
const close = CONSUME(symbols_exports.RCurly);
|
|
14192
|
-
return ACTION(() => C.
|
|
14235
|
+
return ACTION(() => C.astFactory.wrap(val.val, C.astFactory.sourceLocation(open, close)));
|
|
14193
14236
|
}
|
|
14194
14237
|
};
|
|
14195
14238
|
function insertDeleteDelWhere(name, subType, cons1, cons2, dataRule) {
|
|
@@ -14206,12 +14249,26 @@ function insertDeleteDelWhere(name, subType, cons1, cons2, dataRule) {
|
|
|
14206
14249
|
if (name !== "insertData") {
|
|
14207
14250
|
ACTION(() => couldCreateBlankNodes && C.parseMode.add("canCreateBlankNodes"));
|
|
14208
14251
|
}
|
|
14209
|
-
return ACTION(() => C.
|
|
14252
|
+
return ACTION(() => C.astFactory.updateOperationInsDelDataWhere(subType, data.val, C.astFactory.sourceLocation(insDelToken, data)));
|
|
14210
14253
|
},
|
|
14211
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
14212
|
-
|
|
14254
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14255
|
+
const { astFactory: F3, indentInc } = C;
|
|
14256
|
+
F3.printFilter(ast, () => {
|
|
14257
|
+
C[traqulaIndentation] += indentInc;
|
|
14258
|
+
if (subType === "insertdata") {
|
|
14259
|
+
PRINT_WORD("INSERT DATA");
|
|
14260
|
+
} else if (subType === "deletedata") {
|
|
14261
|
+
PRINT_WORD("DELETE DATA");
|
|
14262
|
+
} else if (subType === "deletewhere") {
|
|
14263
|
+
PRINT_WORD("DELETE WHERE");
|
|
14264
|
+
}
|
|
14265
|
+
PRINT_WORD("{\n");
|
|
14266
|
+
});
|
|
14213
14267
|
SUBRULE(quads, F3.wrap(ast.data, ast.loc));
|
|
14214
|
-
F3.printFilter(ast, () =>
|
|
14268
|
+
F3.printFilter(ast, () => {
|
|
14269
|
+
C[traqulaIndentation] -= indentInc;
|
|
14270
|
+
PRINT_ON_EMPTY("}\n");
|
|
14271
|
+
});
|
|
14215
14272
|
}
|
|
14216
14273
|
};
|
|
14217
14274
|
}
|
|
@@ -14240,22 +14297,35 @@ var modify = {
|
|
|
14240
14297
|
const using = SUBRULE1(usingClauseStar);
|
|
14241
14298
|
CONSUME(where);
|
|
14242
14299
|
const where2 = SUBRULE1(groupGraphPattern);
|
|
14243
|
-
return ACTION(() => C.
|
|
14300
|
+
return ACTION(() => C.astFactory.updateOperationModify(C.astFactory.sourceLocation(graph2?.withToken, del, insert, where2), insert?.val ?? [], del?.val ?? [], where2, using, graph2?.graph));
|
|
14244
14301
|
},
|
|
14245
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
14302
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14303
|
+
const { astFactory: F3, indentInc } = C;
|
|
14246
14304
|
if (ast.graph) {
|
|
14247
14305
|
F3.printFilter(ast, () => PRINT_WORD("WITH"));
|
|
14248
14306
|
SUBRULE(iri2, ast.graph);
|
|
14249
14307
|
}
|
|
14250
14308
|
if (ast.delete.length > 0) {
|
|
14251
|
-
F3.printFilter(ast, () =>
|
|
14309
|
+
F3.printFilter(ast, () => {
|
|
14310
|
+
C[traqulaIndentation] += indentInc;
|
|
14311
|
+
PRINT_WORD("DELETE", "{\n");
|
|
14312
|
+
});
|
|
14252
14313
|
SUBRULE(quads, F3.wrap(ast.delete, ast.loc));
|
|
14253
|
-
F3.printFilter(ast, () =>
|
|
14314
|
+
F3.printFilter(ast, () => {
|
|
14315
|
+
C[traqulaIndentation] -= indentInc;
|
|
14316
|
+
PRINT_ON_EMPTY("}\n");
|
|
14317
|
+
});
|
|
14254
14318
|
}
|
|
14255
14319
|
if (ast.insert.length > 0) {
|
|
14256
|
-
F3.printFilter(ast, () =>
|
|
14320
|
+
F3.printFilter(ast, () => {
|
|
14321
|
+
C[traqulaIndentation] += indentInc;
|
|
14322
|
+
PRINT_WORD("INSERT", "{\n");
|
|
14323
|
+
});
|
|
14257
14324
|
SUBRULE(quads, F3.wrap(ast.insert, ast.loc));
|
|
14258
|
-
F3.printFilter(ast, () =>
|
|
14325
|
+
F3.printFilter(ast, () => {
|
|
14326
|
+
C[traqulaIndentation] -= indentInc;
|
|
14327
|
+
PRINT_ON_EMPTY("}\n");
|
|
14328
|
+
});
|
|
14259
14329
|
}
|
|
14260
14330
|
SUBRULE(usingClauseStar, ast.from);
|
|
14261
14331
|
F3.printFilter(ast, () => PRINT_WORD("WHERE"));
|
|
@@ -14269,7 +14339,7 @@ var deleteClause2 = {
|
|
|
14269
14339
|
const couldCreateBlankNodes = ACTION(() => C.parseMode.delete("canCreateBlankNodes"));
|
|
14270
14340
|
const del = SUBRULE(quadPattern);
|
|
14271
14341
|
ACTION(() => couldCreateBlankNodes && C.parseMode.add("canCreateBlankNodes"));
|
|
14272
|
-
return ACTION(() => C.
|
|
14342
|
+
return ACTION(() => C.astFactory.wrap(del.val, C.astFactory.sourceLocation(delToken, del)));
|
|
14273
14343
|
}
|
|
14274
14344
|
};
|
|
14275
14345
|
var insertClause2 = {
|
|
@@ -14277,7 +14347,7 @@ var insertClause2 = {
|
|
|
14277
14347
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14278
14348
|
const insertToken = CONSUME(insertClause);
|
|
14279
14349
|
const insert = SUBRULE(quadPattern);
|
|
14280
|
-
return ACTION(() => C.
|
|
14350
|
+
return ACTION(() => C.astFactory.wrap(insert.val, C.astFactory.sourceLocation(insertToken, insert)));
|
|
14281
14351
|
}
|
|
14282
14352
|
};
|
|
14283
14353
|
var graphOrDefault = {
|
|
@@ -14285,12 +14355,12 @@ var graphOrDefault = {
|
|
|
14285
14355
|
impl: ({ ACTION, SUBRULE1, CONSUME, OPTION, OR }) => (C) => OR([
|
|
14286
14356
|
{ ALT: () => {
|
|
14287
14357
|
const def = CONSUME(graph_exports.default_);
|
|
14288
|
-
return ACTION(() => C.
|
|
14358
|
+
return ACTION(() => C.astFactory.graphRefDefault(C.astFactory.sourceLocation(def)));
|
|
14289
14359
|
} },
|
|
14290
14360
|
{ ALT: () => {
|
|
14291
14361
|
const graph2 = OPTION(() => CONSUME(graph_exports.graph));
|
|
14292
14362
|
const name = SUBRULE1(iri2);
|
|
14293
|
-
return ACTION(() => C.
|
|
14363
|
+
return ACTION(() => C.astFactory.graphRefSpecific(name, C.astFactory.sourceLocation(graph2, name)));
|
|
14294
14364
|
} }
|
|
14295
14365
|
])
|
|
14296
14366
|
};
|
|
@@ -14299,9 +14369,9 @@ var graphRef = {
|
|
|
14299
14369
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14300
14370
|
const graph2 = CONSUME(graph_exports.graph);
|
|
14301
14371
|
const val = SUBRULE(iri2);
|
|
14302
|
-
return ACTION(() => C.
|
|
14372
|
+
return ACTION(() => C.astFactory.graphRefSpecific(val, C.astFactory.sourceLocation(graph2, val)));
|
|
14303
14373
|
},
|
|
14304
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14374
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14305
14375
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
14306
14376
|
SUBRULE(iri2, ast.graph);
|
|
14307
14377
|
}
|
|
@@ -14312,18 +14382,18 @@ var graphRefAll = {
|
|
|
14312
14382
|
{ ALT: () => SUBRULE(graphRef) },
|
|
14313
14383
|
{ ALT: () => {
|
|
14314
14384
|
const def = CONSUME(graph_exports.default_);
|
|
14315
|
-
return ACTION(() => C.
|
|
14385
|
+
return ACTION(() => C.astFactory.graphRefDefault(C.astFactory.sourceLocation(def)));
|
|
14316
14386
|
} },
|
|
14317
14387
|
{ ALT: () => {
|
|
14318
14388
|
const named2 = CONSUME(graph_exports.named);
|
|
14319
|
-
return ACTION(() => C.
|
|
14389
|
+
return ACTION(() => C.astFactory.graphRefNamed(C.astFactory.sourceLocation(named2)));
|
|
14320
14390
|
} },
|
|
14321
14391
|
{ ALT: () => {
|
|
14322
14392
|
const graphAll2 = CONSUME(graph_exports.graphAll);
|
|
14323
|
-
return ACTION(() => C.
|
|
14393
|
+
return ACTION(() => C.astFactory.graphRefAll(C.astFactory.sourceLocation(graphAll2)));
|
|
14324
14394
|
} }
|
|
14325
14395
|
]),
|
|
14326
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14396
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14327
14397
|
if (F3.isGraphRefSpecific(ast)) {
|
|
14328
14398
|
SUBRULE(graphRef, ast);
|
|
14329
14399
|
} else if (F3.isGraphRefDefault(ast)) {
|
|
@@ -14360,9 +14430,9 @@ var quads = {
|
|
|
14360
14430
|
ACTION(() => quads2.push(triples));
|
|
14361
14431
|
});
|
|
14362
14432
|
});
|
|
14363
|
-
return ACTION(() => C.
|
|
14433
|
+
return ACTION(() => C.astFactory.wrap(quads2, C.astFactory.sourceLocation(quads2.at(0), last2)));
|
|
14364
14434
|
},
|
|
14365
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
14435
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14366
14436
|
for (const quad of ast.val) {
|
|
14367
14437
|
if (F3.isPattern(quad)) {
|
|
14368
14438
|
SUBRULE(triplesBlock, quad);
|
|
@@ -14380,14 +14450,21 @@ var quadsNotTriples = {
|
|
|
14380
14450
|
CONSUME(symbols_exports.LCurly);
|
|
14381
14451
|
const triples = OPTION(() => SUBRULE1(triplesTemplate));
|
|
14382
14452
|
const close = CONSUME(symbols_exports.RCurly);
|
|
14383
|
-
return ACTION(() => C.
|
|
14453
|
+
return ACTION(() => C.astFactory.graphQuads(name, triples ?? C.astFactory.patternBgp([], C.astFactory.sourceLocationNoMaterialize()), C.astFactory.sourceLocation(graph2, close)));
|
|
14384
14454
|
},
|
|
14385
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
14455
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14456
|
+
const { astFactory: F3, indentInc } = C;
|
|
14386
14457
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
14387
14458
|
SUBRULE(varOrTerm, ast.graph);
|
|
14388
|
-
F3.printFilter(ast, () =>
|
|
14459
|
+
F3.printFilter(ast, () => {
|
|
14460
|
+
C[traqulaIndentation] += indentInc;
|
|
14461
|
+
PRINT_WORD("{\n");
|
|
14462
|
+
});
|
|
14389
14463
|
SUBRULE(triplesBlock, ast.triples);
|
|
14390
|
-
F3.printFilter(ast, () =>
|
|
14464
|
+
F3.printFilter(ast, () => {
|
|
14465
|
+
C[traqulaIndentation] -= indentInc;
|
|
14466
|
+
PRINT_ON_EMPTY("}\n");
|
|
14467
|
+
});
|
|
14391
14468
|
}
|
|
14392
14469
|
};
|
|
14393
14470
|
|
|
@@ -14410,7 +14487,7 @@ var queryOrUpdate = {
|
|
|
14410
14487
|
...subType,
|
|
14411
14488
|
type: "query",
|
|
14412
14489
|
...values3 && { values: values3 },
|
|
14413
|
-
loc: C.
|
|
14490
|
+
loc: C.astFactory.sourceLocation(prologueValues.at(0), subType, values3)
|
|
14414
14491
|
}));
|
|
14415
14492
|
} },
|
|
14416
14493
|
{ ALT: () => {
|
|
@@ -14434,7 +14511,7 @@ var queryOrUpdate = {
|
|
|
14434
14511
|
const update2 = {
|
|
14435
14512
|
type: "update",
|
|
14436
14513
|
updates,
|
|
14437
|
-
loc: C.
|
|
14514
|
+
loc: C.astFactory.sourceLocation(...updates[0].context, updates[0].operation, ...updates.at(-1).context, updates.at(-1)?.operation)
|
|
14438
14515
|
};
|
|
14439
14516
|
updateNoReuseBlankNodeLabels(update2);
|
|
14440
14517
|
return update2;
|
|
@@ -14442,7 +14519,7 @@ var queryOrUpdate = {
|
|
|
14442
14519
|
} }
|
|
14443
14520
|
]);
|
|
14444
14521
|
},
|
|
14445
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
14522
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14446
14523
|
if (F3.isQuery(ast)) {
|
|
14447
14524
|
SUBRULE(query, ast);
|
|
14448
14525
|
} else {
|
|
@@ -14797,8 +14874,78 @@ var LANG_DIR = createToken2({
|
|
|
14797
14874
|
});
|
|
14798
14875
|
var sparql12LexerBuilder = LexerBuilder.create(lexer_exports.sparql11LexerBuilder).addBefore(lexer_exports.symbols.logicAnd, tilde, annotationOpen, annotationClose, tripleTermOpen, tripleTermClose, reificationOpen, reificationClose, version).addBefore(lexer_exports.builtIn.langmatches, buildInLangDir, buildInStrLangDir, buildInHasLangDir, buildInHasLang, buildInIsTRIPLE, buildInTRIPLE, buildInSUBJECT, buildInPREDICATE, buildInOBJECT).addBefore(lexer_exports.terminals.langTag, LANG_DIR).delete(lexer_exports.terminals.langTag);
|
|
14799
14876
|
|
|
14877
|
+
// ../../packages/rules-sparql-1-2/lib/AstFactory.js
|
|
14878
|
+
var AstFactory2 = class extends AstFactory {
|
|
14879
|
+
termTriple(subject, predicate, object3, loc) {
|
|
14880
|
+
return {
|
|
14881
|
+
type: "term",
|
|
14882
|
+
subType: "triple",
|
|
14883
|
+
subject,
|
|
14884
|
+
predicate,
|
|
14885
|
+
object: object3,
|
|
14886
|
+
loc
|
|
14887
|
+
};
|
|
14888
|
+
}
|
|
14889
|
+
isTermTriple(obj) {
|
|
14890
|
+
return this.isOfSubType(obj, "term", "triple");
|
|
14891
|
+
}
|
|
14892
|
+
tripleCollectionReifiedTriple(loc, subject, predicate, object3, reifier2) {
|
|
14893
|
+
return {
|
|
14894
|
+
type: "tripleCollection",
|
|
14895
|
+
subType: "reifiedTriple",
|
|
14896
|
+
triples: [this.triple(subject, predicate, object3)],
|
|
14897
|
+
identifier: reifier2 ?? this.blankNode(void 0, this.sourceLocationNoMaterialize()),
|
|
14898
|
+
loc
|
|
14899
|
+
};
|
|
14900
|
+
}
|
|
14901
|
+
isTripleCollectionReifiedTriple(obj) {
|
|
14902
|
+
return this.isOfSubType(obj, "tripleCollection", "reifiedTriple");
|
|
14903
|
+
}
|
|
14904
|
+
tripleCollectionBlankNodeProperties(identifier, triples, loc) {
|
|
14905
|
+
return {
|
|
14906
|
+
type: "tripleCollection",
|
|
14907
|
+
subType: "blankNodeProperties",
|
|
14908
|
+
triples,
|
|
14909
|
+
identifier,
|
|
14910
|
+
loc
|
|
14911
|
+
};
|
|
14912
|
+
}
|
|
14913
|
+
/**
|
|
14914
|
+
* Overwritten triple constructor to always contain an empty annotations list
|
|
14915
|
+
*/
|
|
14916
|
+
triple = (subject, predicate, object3, loc) => ({
|
|
14917
|
+
type: "triple",
|
|
14918
|
+
subject,
|
|
14919
|
+
predicate,
|
|
14920
|
+
object: object3,
|
|
14921
|
+
annotations: [],
|
|
14922
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
14923
|
+
});
|
|
14924
|
+
annotatedTriple(subject, predicate, object3, annotations, loc) {
|
|
14925
|
+
return {
|
|
14926
|
+
type: "triple",
|
|
14927
|
+
subject,
|
|
14928
|
+
predicate,
|
|
14929
|
+
object: object3,
|
|
14930
|
+
annotations: annotations ?? [],
|
|
14931
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object3, ...annotations ?? [])
|
|
14932
|
+
};
|
|
14933
|
+
}
|
|
14934
|
+
contextDefinitionVersion(version2, loc) {
|
|
14935
|
+
return {
|
|
14936
|
+
type: "contextDef",
|
|
14937
|
+
subType: "version",
|
|
14938
|
+
version: version2,
|
|
14939
|
+
loc
|
|
14940
|
+
};
|
|
14941
|
+
}
|
|
14942
|
+
isContextDefinitionVersion(obj) {
|
|
14943
|
+
return this.isOfSubType(obj, "contextDef", "version");
|
|
14944
|
+
}
|
|
14945
|
+
};
|
|
14946
|
+
|
|
14800
14947
|
// ../../packages/rules-sparql-1-2/lib/validators.js
|
|
14801
|
-
var F2 = new
|
|
14948
|
+
var F2 = new AstFactory2();
|
|
14802
14949
|
function isLangDir(dir) {
|
|
14803
14950
|
return dir === "ltr" || dir === "rtl";
|
|
14804
14951
|
}
|
|
@@ -14820,11 +14967,11 @@ var versionDecl = {
|
|
|
14820
14967
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14821
14968
|
const versionToken = CONSUME(version);
|
|
14822
14969
|
const identifier = SUBRULE(versionSpecifier);
|
|
14823
|
-
return ACTION(() => C.
|
|
14970
|
+
return ACTION(() => C.astFactory.contextDefinitionVersion(identifier.val, C.astFactory.sourceLocation(versionToken, identifier)));
|
|
14824
14971
|
},
|
|
14825
|
-
gImpl: ({ PRINT_WORDS }) => (ast, {
|
|
14972
|
+
gImpl: ({ PRINT_WORDS }) => (ast, { astFactory: F3 }) => {
|
|
14826
14973
|
F3.printFilter(ast, () => {
|
|
14827
|
-
PRINT_WORDS("VERSION", `${grammar_exports.stringEscapedLexical(ast.version)}
|
|
14974
|
+
PRINT_WORDS("VERSION", `${grammar_exports.stringEscapedLexical(ast.version)}`, "\n");
|
|
14828
14975
|
});
|
|
14829
14976
|
}
|
|
14830
14977
|
};
|
|
@@ -14835,7 +14982,7 @@ var versionSpecifier = {
|
|
|
14835
14982
|
{ ALT: () => CONSUME(lexer_exports.terminals.stringLiteral1) },
|
|
14836
14983
|
{ ALT: () => CONSUME(lexer_exports.terminals.stringLiteral2) }
|
|
14837
14984
|
]);
|
|
14838
|
-
return ACTION(() => C.
|
|
14985
|
+
return ACTION(() => C.astFactory.wrap(token.image.slice(1, -1), C.astFactory.sourceLocation(token)));
|
|
14839
14986
|
}
|
|
14840
14987
|
};
|
|
14841
14988
|
var prologue2 = {
|
|
@@ -14851,7 +14998,7 @@ var prologue2 = {
|
|
|
14851
14998
|
]));
|
|
14852
14999
|
return result;
|
|
14853
15000
|
},
|
|
14854
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
15001
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14855
15002
|
for (const context of ast) {
|
|
14856
15003
|
if (F3.isContextDefinitionBase(context)) {
|
|
14857
15004
|
SUBRULE(grammar_exports.baseDecl, context);
|
|
@@ -14868,7 +15015,7 @@ function reifiedTripleBlockImpl(name, allowPath) {
|
|
|
14868
15015
|
name,
|
|
14869
15016
|
impl: ({ ACTION, SUBRULE }) => (C) => {
|
|
14870
15017
|
const triple = SUBRULE(reifiedTriple);
|
|
14871
|
-
const properties = SUBRULE(allowPath ? grammar_exports.propertyListPath : grammar_exports.propertyList, ACTION(() => C.
|
|
15018
|
+
const properties = SUBRULE(allowPath ? grammar_exports.propertyListPath : grammar_exports.propertyList, ACTION(() => C.astFactory.dematerialized(triple.identifier)));
|
|
14872
15019
|
return ACTION(() => [triple, ...properties]);
|
|
14873
15020
|
}
|
|
14874
15021
|
};
|
|
@@ -14891,7 +15038,7 @@ var reifier = {
|
|
|
14891
15038
|
if (reifier2 === void 0 && !C.parseMode.has("canCreateBlankNodes")) {
|
|
14892
15039
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
14893
15040
|
}
|
|
14894
|
-
return C.
|
|
15041
|
+
return C.astFactory.wrap(reifier2 ?? C.astFactory.blankNode(void 0, C.astFactory.sourceLocation()), C.astFactory.sourceLocation(tildeToken, reifier2));
|
|
14895
15042
|
});
|
|
14896
15043
|
}
|
|
14897
15044
|
};
|
|
@@ -14921,7 +15068,7 @@ function objectImpl2(name, allowPaths) {
|
|
|
14921
15068
|
const objectVal = SUBRULE(allowPaths ? graphNodePath2 : graphNode2);
|
|
14922
15069
|
const annotationVal = SUBRULE(allowPaths ? annotationPath : annotation);
|
|
14923
15070
|
return ACTION(() => {
|
|
14924
|
-
const F3 = C.
|
|
15071
|
+
const F3 = C.astFactory;
|
|
14925
15072
|
if (F3.isPathPure(predicate) && annotationVal.length > 0) {
|
|
14926
15073
|
throw new Error("Note 17 violation");
|
|
14927
15074
|
}
|
|
@@ -14950,7 +15097,7 @@ function annotationImpl(name, allowPaths) {
|
|
|
14950
15097
|
if (!currentReifier && !C.parseMode.has("canCreateBlankNodes")) {
|
|
14951
15098
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
14952
15099
|
}
|
|
14953
|
-
currentReifier = currentReifier ?? C.
|
|
15100
|
+
currentReifier = currentReifier ?? C.astFactory.blankNode(void 0, C.astFactory.sourceLocation());
|
|
14954
15101
|
});
|
|
14955
15102
|
const block = SUBRULE(allowPaths ? annotationBlockPath : annotationBlock, currentReifier);
|
|
14956
15103
|
ACTION(() => {
|
|
@@ -14962,7 +15109,7 @@ function annotationImpl(name, allowPaths) {
|
|
|
14962
15109
|
});
|
|
14963
15110
|
return annotations;
|
|
14964
15111
|
},
|
|
14965
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
15112
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14966
15113
|
for (const annotation2 of ast) {
|
|
14967
15114
|
if (F3.isTripleCollectionBlankNodeProperties(annotation2)) {
|
|
14968
15115
|
SUBRULE(annotationBlockPath, annotation2);
|
|
@@ -14983,11 +15130,18 @@ function annotationBlockImpl(name, allowPaths) {
|
|
|
14983
15130
|
const open = CONSUME(annotationOpen);
|
|
14984
15131
|
const res = SUBRULE(allowPaths ? grammar_exports.propertyListPathNotEmpty : grammar_exports.propertyListNotEmpty, arg);
|
|
14985
15132
|
const close = CONSUME(annotationClose);
|
|
14986
|
-
return ACTION(() => C.
|
|
15133
|
+
return ACTION(() => C.astFactory.tripleCollectionBlankNodeProperties(arg, res, C.astFactory.sourceLocation(open, close)));
|
|
14987
15134
|
},
|
|
14988
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast,
|
|
14989
|
-
F3
|
|
14990
|
-
|
|
15135
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
15136
|
+
const { astFactory: F3, indentInc } = C;
|
|
15137
|
+
F3.printFilter(ast, () => {
|
|
15138
|
+
PRINT_WORD("{|");
|
|
15139
|
+
if (ast.triples.length > 1) {
|
|
15140
|
+
C[traqulaIndentation] += indentInc;
|
|
15141
|
+
PRINT_WORD("\n");
|
|
15142
|
+
}
|
|
15143
|
+
});
|
|
15144
|
+
function printTriple(triple) {
|
|
14991
15145
|
HANDLE_LOC(triple, () => {
|
|
14992
15146
|
if (F3.isTerm(triple.predicate)) {
|
|
14993
15147
|
SUBRULE(graphNodePath2, triple.predicate);
|
|
@@ -14995,10 +15149,21 @@ function annotationBlockImpl(name, allowPaths) {
|
|
|
14995
15149
|
SUBRULE(grammar_exports.pathGenerator, triple.predicate, void 0);
|
|
14996
15150
|
}
|
|
14997
15151
|
SUBRULE(graphNodePath2, triple.object);
|
|
14998
|
-
F3.printFilter(ast, () => PRINT_WORD(";"));
|
|
14999
15152
|
});
|
|
15000
15153
|
}
|
|
15001
|
-
|
|
15154
|
+
const [head2, ...tail] = ast.triples;
|
|
15155
|
+
printTriple(head2);
|
|
15156
|
+
for (const triple of tail) {
|
|
15157
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
15158
|
+
printTriple(triple);
|
|
15159
|
+
}
|
|
15160
|
+
F3.printFilter(ast, () => {
|
|
15161
|
+
if (ast.triples.length > 1) {
|
|
15162
|
+
PRINT_ON_EMPTY("|}\n");
|
|
15163
|
+
} else {
|
|
15164
|
+
PRINT_WORD("|}");
|
|
15165
|
+
}
|
|
15166
|
+
});
|
|
15002
15167
|
}
|
|
15003
15168
|
};
|
|
15004
15169
|
}
|
|
@@ -15018,7 +15183,7 @@ var graphNodePath2 = {
|
|
|
15018
15183
|
{ ALT: () => $.SUBRULE(reifiedTriple) }
|
|
15019
15184
|
]),
|
|
15020
15185
|
gImpl: ($) => (ast, C) => {
|
|
15021
|
-
if (C.
|
|
15186
|
+
if (C.astFactory.isTripleCollectionReifiedTriple(ast)) {
|
|
15022
15187
|
$.SUBRULE(reifiedTriple, ast);
|
|
15023
15188
|
} else {
|
|
15024
15189
|
grammar_exports.graphNodePath.gImpl($)(ast, C);
|
|
@@ -15036,7 +15201,7 @@ var varOrTerm2 = {
|
|
|
15036
15201
|
{ ALT: () => SUBRULE(grammar_exports.blankNode) },
|
|
15037
15202
|
{ ALT: () => {
|
|
15038
15203
|
const token = CONSUME(lexer_exports.terminals.nil);
|
|
15039
|
-
return ACTION(() => C.
|
|
15204
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.NIL));
|
|
15040
15205
|
} },
|
|
15041
15206
|
{ ALT: () => SUBRULE(tripleTerm) }
|
|
15042
15207
|
])
|
|
@@ -15055,10 +15220,10 @@ var reifiedTriple = {
|
|
|
15055
15220
|
if (reifierVal === void 0 && !C.parseMode.has("canCreateBlankNodes")) {
|
|
15056
15221
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
15057
15222
|
}
|
|
15058
|
-
return C.
|
|
15223
|
+
return C.astFactory.tripleCollectionReifiedTriple(C.astFactory.sourceLocation(open, close), subject, predicate, object3, reifierVal?.val);
|
|
15059
15224
|
});
|
|
15060
15225
|
},
|
|
15061
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
15226
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
15062
15227
|
F3.printFilter(ast, () => PRINT_WORD("<<"));
|
|
15063
15228
|
const triple = ast.triples[0];
|
|
15064
15229
|
SUBRULE(graphNodePath2, triple.subject);
|
|
@@ -15097,9 +15262,9 @@ var tripleTerm = {
|
|
|
15097
15262
|
const predicate = SUBRULE(grammar_exports.verb);
|
|
15098
15263
|
const object3 = SUBRULE(tripleTermObject);
|
|
15099
15264
|
const close = CONSUME(tripleTermClose);
|
|
15100
|
-
return ACTION(() => C.
|
|
15265
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
15101
15266
|
},
|
|
15102
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
15267
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
15103
15268
|
F3.printFilter(ast, () => PRINT_WORD("<<("));
|
|
15104
15269
|
SUBRULE(graphNodePath2, ast.subject);
|
|
15105
15270
|
SUBRULE(graphNodePath2, ast.predicate);
|
|
@@ -15132,12 +15297,12 @@ var tripleTermData = {
|
|
|
15132
15297
|
{ ALT: () => SUBRULE(grammar_exports.iri) },
|
|
15133
15298
|
{ ALT: () => {
|
|
15134
15299
|
const token = CONSUME(lexer_exports.a);
|
|
15135
|
-
return ACTION(() => C.
|
|
15300
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.TYPE));
|
|
15136
15301
|
} }
|
|
15137
15302
|
]);
|
|
15138
15303
|
const object3 = SUBRULE(tripleTermDataObject);
|
|
15139
15304
|
const close = CONSUME(tripleTermClose);
|
|
15140
|
-
return ACTION(() => C.
|
|
15305
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
15141
15306
|
}
|
|
15142
15307
|
};
|
|
15143
15308
|
var tripleTermDataSubject = {
|
|
@@ -15169,7 +15334,7 @@ var exprTripleTerm = {
|
|
|
15169
15334
|
const predicate = SUBRULE(grammar_exports.verb);
|
|
15170
15335
|
const object3 = SUBRULE(exprTripleTermObject);
|
|
15171
15336
|
const close = CONSUME(tripleTermClose);
|
|
15172
|
-
return ACTION(() => C.
|
|
15337
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
15173
15338
|
}
|
|
15174
15339
|
};
|
|
15175
15340
|
var exprTripleTermSubject = {
|
|
@@ -15219,7 +15384,7 @@ var rdfLiteral2 = {
|
|
|
15219
15384
|
{ ALT: () => {
|
|
15220
15385
|
const langTag2 = CONSUME(LANG_DIR);
|
|
15221
15386
|
return ACTION(() => {
|
|
15222
|
-
const literal = C.
|
|
15387
|
+
const literal = C.astFactory.literalTerm(C.astFactory.sourceLocation(value, langTag2), value.value, langTag2.image.slice(1).toLowerCase());
|
|
15223
15388
|
langTagHasCorrectRange(literal);
|
|
15224
15389
|
return literal;
|
|
15225
15390
|
});
|
|
@@ -15227,7 +15392,7 @@ var rdfLiteral2 = {
|
|
|
15227
15392
|
{ ALT: () => {
|
|
15228
15393
|
CONSUME(lexer_exports.symbols.hathat);
|
|
15229
15394
|
const iriVal = SUBRULE(grammar_exports.iri);
|
|
15230
|
-
return ACTION(() => C.
|
|
15395
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
|
|
15231
15396
|
} }
|
|
15232
15397
|
])) ?? value;
|
|
15233
15398
|
}
|
|
@@ -15239,7 +15404,7 @@ var unaryExpression2 = {
|
|
|
15239
15404
|
{ ALT: () => {
|
|
15240
15405
|
const operator = CONSUME(lexer_exports.symbols.exclamation);
|
|
15241
15406
|
const expr = SUBRULE1(unaryExpression2);
|
|
15242
|
-
return ACTION(() => C.
|
|
15407
|
+
return ACTION(() => C.astFactory.expressionOperation("!", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
15243
15408
|
} },
|
|
15244
15409
|
{ ALT: () => {
|
|
15245
15410
|
const operator = OR2([
|
|
@@ -15247,34 +15412,36 @@ var unaryExpression2 = {
|
|
|
15247
15412
|
{ ALT: () => CONSUME(lexer_exports.symbols.opMinus) }
|
|
15248
15413
|
]);
|
|
15249
15414
|
const expr = SUBRULE2(primaryExpression2);
|
|
15250
|
-
return ACTION(() => C.
|
|
15415
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image === "!" ? "!" : operator.image === "+" ? "UPLUS" : "UMINUS", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
15251
15416
|
} }
|
|
15252
15417
|
])
|
|
15253
15418
|
};
|
|
15254
15419
|
var generateTriplesBlock = {
|
|
15255
15420
|
name: "triplesBlock",
|
|
15256
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, {
|
|
15421
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, { astFactory: F3 }) => {
|
|
15257
15422
|
for (const [index, triple] of ast.triples.entries()) {
|
|
15258
15423
|
HANDLE_LOC(triple, () => {
|
|
15259
15424
|
const nextTriple = ast.triples.at(index);
|
|
15260
15425
|
if (F3.isTripleCollection(triple)) {
|
|
15261
15426
|
SUBRULE(graphNodePath2, triple);
|
|
15262
|
-
F3.printFilter(triple, () => PRINT_WORD("
|
|
15427
|
+
F3.printFilter(triple, () => PRINT_WORD(".\n"));
|
|
15263
15428
|
} else {
|
|
15264
15429
|
SUBRULE(graphNodePath2, triple.subject);
|
|
15430
|
+
F3.printFilter(ast, () => PRINT_WORD(""));
|
|
15265
15431
|
if (F3.isPathPure(triple.predicate)) {
|
|
15266
15432
|
SUBRULE(grammar_exports.pathGenerator, triple.predicate, void 0);
|
|
15267
15433
|
} else {
|
|
15268
15434
|
SUBRULE(graphNodePath2, triple.predicate);
|
|
15269
15435
|
}
|
|
15436
|
+
F3.printFilter(ast, () => PRINT_WORD(""));
|
|
15270
15437
|
SUBRULE(graphNodePath2, triple.object);
|
|
15271
15438
|
SUBRULE(annotationPath, triple.annotations ?? []);
|
|
15272
15439
|
if (nextTriple === void 0 || F3.isTripleCollection(nextTriple) || !F3.isSourceLocationNoMaterialize(nextTriple.subject.loc)) {
|
|
15273
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
15440
|
+
F3.printFilter(ast, () => PRINT_WORD(".\n"));
|
|
15274
15441
|
} else if (F3.isSourceLocationNoMaterialize(nextTriple.predicate.loc)) {
|
|
15275
15442
|
F3.printFilter(ast, () => PRINT_WORD(","));
|
|
15276
15443
|
} else {
|
|
15277
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
15444
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
15278
15445
|
}
|
|
15279
15446
|
}
|
|
15280
15447
|
});
|
|
@@ -15284,7 +15451,7 @@ var generateTriplesBlock = {
|
|
|
15284
15451
|
var generateGraphTerm = {
|
|
15285
15452
|
name: "graphTerm",
|
|
15286
15453
|
gImpl: ($) => (ast, C) => {
|
|
15287
|
-
if (C.
|
|
15454
|
+
if (C.astFactory.isTermTriple(ast)) {
|
|
15288
15455
|
$.SUBRULE(tripleTerm, ast);
|
|
15289
15456
|
} else {
|
|
15290
15457
|
grammar_exports.graphTerm.gImpl($)(ast, C);
|
|
@@ -15292,86 +15459,18 @@ var generateGraphTerm = {
|
|
|
15292
15459
|
}
|
|
15293
15460
|
};
|
|
15294
15461
|
|
|
15295
|
-
// ../../packages/rules-sparql-1-2/lib/Factory.js
|
|
15296
|
-
var Factory2 = class extends Factory {
|
|
15297
|
-
termTriple(subject, predicate, object3, loc) {
|
|
15298
|
-
return {
|
|
15299
|
-
type: "term",
|
|
15300
|
-
subType: "triple",
|
|
15301
|
-
subject,
|
|
15302
|
-
predicate,
|
|
15303
|
-
object: object3,
|
|
15304
|
-
loc
|
|
15305
|
-
};
|
|
15306
|
-
}
|
|
15307
|
-
isTermTriple(obj) {
|
|
15308
|
-
return this.isOfSubType(obj, "term", "triple");
|
|
15309
|
-
}
|
|
15310
|
-
tripleCollectionReifiedTriple(loc, subject, predicate, object3, reifier2) {
|
|
15311
|
-
return {
|
|
15312
|
-
type: "tripleCollection",
|
|
15313
|
-
subType: "reifiedTriple",
|
|
15314
|
-
triples: [this.triple(subject, predicate, object3)],
|
|
15315
|
-
identifier: reifier2 ?? this.blankNode(void 0, this.sourceLocationNoMaterialize()),
|
|
15316
|
-
loc
|
|
15317
|
-
};
|
|
15318
|
-
}
|
|
15319
|
-
isTripleCollectionReifiedTriple(obj) {
|
|
15320
|
-
return this.isOfSubType(obj, "tripleCollection", "reifiedTriple");
|
|
15321
|
-
}
|
|
15322
|
-
tripleCollectionBlankNodeProperties(identifier, triples, loc) {
|
|
15323
|
-
return {
|
|
15324
|
-
type: "tripleCollection",
|
|
15325
|
-
subType: "blankNodeProperties",
|
|
15326
|
-
triples,
|
|
15327
|
-
identifier,
|
|
15328
|
-
loc
|
|
15329
|
-
};
|
|
15330
|
-
}
|
|
15331
|
-
/**
|
|
15332
|
-
* Overwritten triple constructor to always contain an empty annotations list
|
|
15333
|
-
*/
|
|
15334
|
-
triple = (subject, predicate, object3, loc) => ({
|
|
15335
|
-
type: "triple",
|
|
15336
|
-
subject,
|
|
15337
|
-
predicate,
|
|
15338
|
-
object: object3,
|
|
15339
|
-
annotations: [],
|
|
15340
|
-
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
15341
|
-
});
|
|
15342
|
-
annotatedTriple(subject, predicate, object3, annotations, loc) {
|
|
15343
|
-
return {
|
|
15344
|
-
type: "triple",
|
|
15345
|
-
subject,
|
|
15346
|
-
predicate,
|
|
15347
|
-
object: object3,
|
|
15348
|
-
annotations: annotations ?? [],
|
|
15349
|
-
loc: loc ?? this.sourceLocation(subject, predicate, object3, ...annotations ?? [])
|
|
15350
|
-
};
|
|
15351
|
-
}
|
|
15352
|
-
contextDefinitionVersion(version2, loc) {
|
|
15353
|
-
return {
|
|
15354
|
-
type: "contextDef",
|
|
15355
|
-
subType: "version",
|
|
15356
|
-
version: version2,
|
|
15357
|
-
loc
|
|
15358
|
-
};
|
|
15359
|
-
}
|
|
15360
|
-
isContextDefinitionVersion(obj) {
|
|
15361
|
-
return this.isOfSubType(obj, "contextDef", "version");
|
|
15362
|
-
}
|
|
15363
|
-
};
|
|
15364
|
-
|
|
15365
15462
|
// ../../packages/rules-sparql-1-2/lib/parserUtils.js
|
|
15366
15463
|
function completeParseContext(context) {
|
|
15367
15464
|
return {
|
|
15368
|
-
|
|
15465
|
+
astFactory: context.astFactory ?? new AstFactory2(),
|
|
15369
15466
|
baseIRI: context.baseIRI,
|
|
15370
15467
|
prefixes: { ...context.prefixes },
|
|
15371
15468
|
origSource: context.origSource ?? "",
|
|
15372
15469
|
offset: context.offset,
|
|
15373
15470
|
parseMode: context.parseMode ? new Set(context.parseMode) : /* @__PURE__ */ new Set(["canParseVars", "canCreateBlankNodes"]),
|
|
15374
|
-
skipValidation: context.skipValidation ?? false
|
|
15471
|
+
skipValidation: context.skipValidation ?? false,
|
|
15472
|
+
indentInc: context.indentInc ?? 2,
|
|
15473
|
+
[traqulaIndentation]: context[traqulaIndentation] ?? 0
|
|
15375
15474
|
};
|
|
15376
15475
|
}
|
|
15377
15476
|
|
|
@@ -15379,7 +15478,7 @@ function completeParseContext(context) {
|
|
|
15379
15478
|
var sparql12ParserBuilder = ParserBuilder.create(sparql11ParserBuilder).widenContext().typePatch().addMany(grammar_exports2.reifiedTripleBlock, grammar_exports2.reifiedTripleBlockPath, grammar_exports2.reifier, grammar_exports2.varOrReifierId, grammar_exports2.annotation, grammar_exports2.annotationPath, grammar_exports2.annotationBlockPath, grammar_exports2.annotationBlock, grammar_exports2.reifiedTriple, grammar_exports2.reifiedTripleSubject, grammar_exports2.reifiedTripleObject, grammar_exports2.tripleTerm, grammar_exports2.tripleTermSubject, grammar_exports2.tripleTermObject, grammar_exports2.tripleTermData, grammar_exports2.tripleTermDataSubject, grammar_exports2.tripleTermDataObject, grammar_exports2.exprTripleTerm, grammar_exports2.exprTripleTermSubject, grammar_exports2.exprTripleTermObject).addMany(grammar_exports2.versionDecl, grammar_exports2.versionSpecifier).addMany(grammar_exports2.buildInLangDir, grammar_exports2.buildInLangStrDir, grammar_exports2.buildInHasLang, grammar_exports2.buildInHasLangDir, grammar_exports2.buildInIsTriple, grammar_exports2.buildInTriple, grammar_exports2.buildInSubject, grammar_exports2.buildInPredicate, grammar_exports2.buildInObject).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.unaryExpression).patchRule(grammar_exports2.prologue);
|
|
15380
15479
|
var Parser2 = class {
|
|
15381
15480
|
parser;
|
|
15382
|
-
F = new
|
|
15481
|
+
F = new AstFactory2();
|
|
15383
15482
|
constructor() {
|
|
15384
15483
|
this.parser = sparql12ParserBuilder.build({
|
|
15385
15484
|
queryPreProcessor: sparqlCodepointEscape,
|