@traqula/rules-sparql-1-2 0.0.7 → 0.0.9
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/index.cjs +21 -7
- package/lib/lexer.d.ts +1 -1
- package/package.json +4 -4
package/lib/index.cjs
CHANGED
|
@@ -12902,7 +12902,7 @@ var inlineData = {
|
|
|
12902
12902
|
return ACTION(() => C.factory.patternValues(datablock.val, C.factory.sourceLocation(values3, datablock)));
|
|
12903
12903
|
},
|
|
12904
12904
|
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
12905
|
-
const variables = Object.keys(ast.values
|
|
12905
|
+
const variables = Object.keys(ast.values.at(0) ?? {});
|
|
12906
12906
|
F3.printFilter(ast, () => {
|
|
12907
12907
|
PRINT_WORD("VALUES", "(");
|
|
12908
12908
|
for (const variable of variables) {
|
|
@@ -13127,7 +13127,7 @@ var argList = {
|
|
|
13127
13127
|
F3.printFilter(ast, () => {
|
|
13128
13128
|
PRINT_WORD("(");
|
|
13129
13129
|
if (ast.val.distinct) {
|
|
13130
|
-
PRINT_WORD("
|
|
13130
|
+
PRINT_WORD("DISTINCT");
|
|
13131
13131
|
}
|
|
13132
13132
|
});
|
|
13133
13133
|
const [head2, ...tail] = ast.val.args;
|
|
@@ -13181,7 +13181,7 @@ var expression = {
|
|
|
13181
13181
|
} else if (ast.operator === "in") {
|
|
13182
13182
|
PRINT_WORD("IN");
|
|
13183
13183
|
} else {
|
|
13184
|
-
PRINT_WORD(ast.operator);
|
|
13184
|
+
PRINT_WORD(ast.operator.toUpperCase());
|
|
13185
13185
|
}
|
|
13186
13186
|
});
|
|
13187
13187
|
if (right.length === 1) {
|
|
@@ -13192,10 +13192,10 @@ var expression = {
|
|
|
13192
13192
|
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
13193
13193
|
} else if (prefixOperator.has(ast.operator)) {
|
|
13194
13194
|
const [expr] = ast.args;
|
|
13195
|
-
F3.printFilter(ast, () => PRINT_WORD(ast.operator));
|
|
13195
|
+
F3.printFilter(ast, () => PRINT_WORD(ast.operator.toUpperCase()));
|
|
13196
13196
|
SUBRULE(expression, expr);
|
|
13197
13197
|
} else {
|
|
13198
|
-
F3.printFilter(ast, () => PRINT_WORD(ast.operator, "("));
|
|
13198
|
+
F3.printFilter(ast, () => PRINT_WORD(ast.operator.toUpperCase(), "("));
|
|
13199
13199
|
const [head2, ...tail] = ast.args;
|
|
13200
13200
|
if (head2) {
|
|
13201
13201
|
SUBRULE(expression, head2);
|
|
@@ -14105,11 +14105,18 @@ var update = {
|
|
|
14105
14105
|
});
|
|
14106
14106
|
},
|
|
14107
14107
|
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { factory: F3 }) => {
|
|
14108
|
-
|
|
14108
|
+
const [head2, ...tail] = ast.updates;
|
|
14109
|
+
if (head2) {
|
|
14110
|
+
SUBRULE(prologue, head2.context);
|
|
14111
|
+
if (head2.operation) {
|
|
14112
|
+
SUBRULE(update1, head2.operation);
|
|
14113
|
+
}
|
|
14114
|
+
}
|
|
14115
|
+
for (const update2 of tail) {
|
|
14116
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
14109
14117
|
SUBRULE(prologue, update2.context);
|
|
14110
14118
|
if (update2.operation) {
|
|
14111
14119
|
SUBRULE(update1, update2.operation);
|
|
14112
|
-
F3.printFilter(ast, () => PRINT_WORD(" ;\n"));
|
|
14113
14120
|
}
|
|
14114
14121
|
}
|
|
14115
14122
|
}
|
|
@@ -14572,6 +14579,13 @@ var queryOrUpdate = {
|
|
|
14572
14579
|
});
|
|
14573
14580
|
} }
|
|
14574
14581
|
]);
|
|
14582
|
+
},
|
|
14583
|
+
gImpl: ({ SUBRULE }) => (ast, { factory: F3 }) => {
|
|
14584
|
+
if (F3.isQuery(ast)) {
|
|
14585
|
+
SUBRULE(query, ast);
|
|
14586
|
+
} else {
|
|
14587
|
+
SUBRULE(update, ast);
|
|
14588
|
+
}
|
|
14575
14589
|
}
|
|
14576
14590
|
};
|
|
14577
14591
|
|
package/lib/lexer.d.ts
CHANGED
|
@@ -17,4 +17,4 @@ export declare const buildInSUBJECT: import("@traqula/core").NamedToken<"BuiltIn
|
|
|
17
17
|
export declare const buildInPREDICATE: import("@traqula/core").NamedToken<"BuiltInPredicate">;
|
|
18
18
|
export declare const buildInOBJECT: import("@traqula/core").NamedToken<"BuiltInObject">;
|
|
19
19
|
export declare const LANG_DIR: import("@traqula/core").NamedToken<"LANG_DIR">;
|
|
20
|
-
export declare const sparql12LexerBuilder: LexerBuilder<"
|
|
20
|
+
export declare const sparql12LexerBuilder: LexerBuilder<"BuiltInStr" | "BuiltInLang" | "BuiltInLangmatches" | "BuiltInDatatype" | "BuiltInBound" | "BuiltInIri" | "BuiltInUri" | "BuiltInBnode" | "BuiltInRand" | "BuiltInAbs" | "BuiltInCeil" | "BuiltInFloor" | "BuiltInRound" | "BuiltInConcat" | "BuiltInStrlen" | "BuiltInUcase" | "BuiltInLcase" | "BuiltInEncode_for_uri" | "BuiltInContains" | "BuiltInStrstarts" | "BuiltInStrends" | "BuiltInStrbefore" | "BuiltInStrafter" | "BuiltInYear" | "BuiltInMonth" | "BuiltInDay" | "BuiltInHours" | "BuiltInMinutes" | "BuiltInSeconds" | "BuiltInTimezone" | "BuiltInTz" | "BuiltInNow" | "BuiltInUuid" | "BuiltInStruuid" | "BuiltInMd5" | "BuiltInSha1" | "BuiltInSha256" | "BuiltInSha384" | "BuiltInSha512" | "BuiltInCoalesce" | "BuiltInIf" | "BuiltInStrlang" | "BuiltInStrdt" | "BuiltInSameterm" | "BuiltInIsiri" | "BuiltInIsuri" | "BuiltInIsblank" | "BuiltInIsliteral" | "BuiltInIsnumeric" | "BuiltInRegex" | "BuiltInSubstr" | "BuiltInReplace" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInExists" | "BuiltInNotexists" | "Pipe" | "Slash" | "From" | "Clear" | "Drop" | "Add" | "Copy" | "Move" | "InsertClause" | "DataClause" | "DeleteClause" | "Where" | "UsingClause" | "BuiltInLangdir" | "BuiltInStrLangdir" | "BuiltInHasLang" | "BuiltInHasLangdir" | "BuiltInIsTriple" | "BuiltInTriple" | "BuiltInSubject" | "BuiltInPredicate" | "BuiltInObject" | "IriRef" | "PNameNs" | "PNameLn" | "BlankNodeLabel" | "Var1" | "Var2" | "Double" | "Decimal" | "Integer" | "InterferePositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteralLong1" | "StringLiteralLong2" | "StringLiteral1" | "StringLiteral2" | "Ws" | "Comment" | "Nil" | "Anon" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "Construct" | "Describe" | "Ask" | "Having" | "GroupByGroup" | "By" | "Order" | "OrderAsc" | "OrderDesc" | "Limit" | "Offset" | "Values" | "Load" | "Silent" | "LoadInto" | "Create" | "To" | "ModifyWith" | "Optional" | "Service" | "Bind" | "Undef" | "Minus" | "Union" | "Filter" | "As" | "a" | "True" | "False" | "In" | "NotIn" | "Separator" | "BuiltInCount" | "BuiltInGroup_concat" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "LogicAnd" | "LogicOr" | "NotEqual" | "LessThanEqual" | "GreaterThanEqual" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Hathat" | "Hat" | "Question" | "Star" | "OpPlus" | "OpMinus" | "Exclamation" | "Equal" | "LessThan" | "GreaterThan" | "Tilde" | "AnnotationOpen" | "AnnotationClose" | "TripleTermOpen" | "TripleTermClose" | "ReificationOpen" | "ReificationClose" | "Version" | "LANG_DIR">;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/rules-sparql-1-2",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.9",
|
|
5
5
|
"description": "Traqula Lexer and Grammar Rules for sparql 1.2",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"build:transpile": " node \"../../node_modules/esbuild/bin/esbuild\" --format=cjs --bundle --log-level=error --outfile=lib/index.cjs lib/index.ts"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@traqula/core": "^0.0.
|
|
45
|
-
"@traqula/rules-sparql-1-1": "^0.0.
|
|
44
|
+
"@traqula/core": "^0.0.9",
|
|
45
|
+
"@traqula/rules-sparql-1-1": "^0.0.9"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c13cd255122c688daad98bf313a3397cbffdc45d"
|
|
48
48
|
}
|