@traqula/parser-sparql-1-1-adjust 1.0.7 → 1.1.1
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/README.md +2 -2
- package/dist/cjs/lib/Parser.js +12 -2
- package/dist/cjs/lib/Parser.js.map +1 -1
- package/dist/esm/lib/Parser.d.ts +12 -2
- package/dist/esm/lib/Parser.js +12 -2
- package/dist/esm/lib/Parser.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[](https://www.npmjs.com/package/@traqula/parser-sparql-1-1-adjust)
|
|
12
12
|
|
|
13
13
|
Traqula Sparql 1.1 Adjust is a [SPARQL 1.1](https://www.w3.org/TR/sparql11-query/#grammar) query parser that also parses the [builtin function ADJUST](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md) for TypeScript.
|
|
14
|
-
Simple grammar extension of [Traqula
|
|
14
|
+
Simple grammar extension of [Traqula parser-sparql-1-1](https://github.com/comunica/traqula/tree/main/engines/parser-sparql-1-1)
|
|
15
15
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
@@ -52,5 +52,5 @@ SELECT ?s ?p (ADJUST(?o, "-PT10H"^^<http://www.w3.org/2001/XMLSchema#dayTimeDura
|
|
|
52
52
|
`);
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
This parser is a simple grammar extension to the [
|
|
55
|
+
This parser is a simple grammar extension to the [parser-sparql-1-1](https://github.com/comunica/traqula/tree/main/engines/parser-sparql-1-1).
|
|
56
56
|
As such, most, if not all, documentation of that parser holds for this one too.
|
package/dist/cjs/lib/Parser.js
CHANGED
|
@@ -5,15 +5,25 @@ const core_1 = require("@traqula/core");
|
|
|
5
5
|
const parser_sparql_1_1_1 = require("@traqula/parser-sparql-1-1");
|
|
6
6
|
const rules_sparql_1_1_1 = require("@traqula/rules-sparql-1-1");
|
|
7
7
|
const rules_sparql_1_1_adjust_1 = require("@traqula/rules-sparql-1-1-adjust");
|
|
8
|
+
/**
|
|
9
|
+
* Pre-configured {@link ParserBuilder} for SPARQL 1.1 with ADJUST function support,
|
|
10
|
+
* extending the SPARQL 1.1 parser builder with the
|
|
11
|
+
* [ADJUST built-in function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md).
|
|
12
|
+
*/
|
|
8
13
|
exports.adjustParserBuilder = core_1.ParserBuilder.create(parser_sparql_1_1_1.sparql11ParserBuilder)
|
|
9
14
|
// This typePatch is not needed, but we need to import g11 for our types
|
|
10
15
|
.typePatch()
|
|
11
16
|
.addRule(rules_sparql_1_1_adjust_1.gram.builtInAdjust)
|
|
12
17
|
.patchRule(rules_sparql_1_1_adjust_1.gram.builtInPatch);
|
|
18
|
+
/**
|
|
19
|
+
* Pre-configured {@link LexerBuilder} for SPARQL 1.1 with the ADJUST built-in token
|
|
20
|
+
* inserted before the `a` token in the token order.
|
|
21
|
+
*/
|
|
13
22
|
exports.adjustLexerBuilder = core_1.LexerBuilder.create(rules_sparql_1_1_1.lex.sparql11LexerBuilder).addBefore(rules_sparql_1_1_1.lex.a, rules_sparql_1_1_adjust_1.lex.BuiltInAdjust);
|
|
14
23
|
/**
|
|
15
|
-
*
|
|
16
|
-
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md)
|
|
24
|
+
* Parser that can parse a SPARQL 1.1 string (including the
|
|
25
|
+
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md))
|
|
26
|
+
* into a SPARQL 1.1 AST.
|
|
17
27
|
*/
|
|
18
28
|
class Parser extends rules_sparql_1_1_1.MinimalSparqlParser {
|
|
19
29
|
constructor(args = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../../lib/Parser.ts"],"names":[],"mappings":";;;AAAA,wCAAkF;AAClF,kEAAmE;AACnE,gEAAmG;AAEnG,8EAA6D;
|
|
1
|
+
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../../lib/Parser.ts"],"names":[],"mappings":";;;AAAA,wCAAkF;AAClF,kEAAmE;AACnE,gEAAmG;AAEnG,8EAA6D;AAE7D;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,oBAAa,CAAC,MAAM,CAAC,yCAAqB,CAAC;IAC5E,wEAAwE;KACvE,SAAS,EAAoC;KAC7C,OAAO,CAAC,8BAAI,CAAC,aAAa,CAAC;KAC3B,SAAS,CAAC,8BAAI,CAAC,YAAY,CAAC,CAAC;AAIhC;;;GAGG;AACU,QAAA,kBAAkB,GAAG,mBAAY,CAAC,MAAM,CAAC,sBAAG,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,sBAAG,CAAC,CAAC,EAAE,6BAAG,CAAC,aAAa,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAa,MAAO,SAAQ,sCAAgC;IAC1D,YACE,OAA4G,EAAE;QAE9G,MAAM,MAAM,GAAmB,2BAAmB,CAAC,KAAK,CAAC;YACvD,GAAG,IAAI;YACP,eAAe,EAAE,0BAAkB,CAAC,eAAe;YACnD,iBAAiB,EAAE,wCAAqB;SACzC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,CAAC;CACF;AAXD,wBAWC","sourcesContent":["import { ParserBuilder, LexerBuilder, type ParserBuildArgs } from '@traqula/core';\nimport { sparql11ParserBuilder } from '@traqula/parser-sparql-1-1';\nimport { sparqlCodepointEscape, lex as l11, MinimalSparqlParser } from '@traqula/rules-sparql-1-1';\nimport type { gram as g11, SparqlQuery, SparqlContext } from '@traqula/rules-sparql-1-1';\nimport { gram, lex } from '@traqula/rules-sparql-1-1-adjust';\n\n/**\n * Pre-configured {@link ParserBuilder} for SPARQL 1.1 with ADJUST function support,\n * extending the SPARQL 1.1 parser builder with the\n * [ADJUST built-in function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md).\n */\nexport const adjustParserBuilder = ParserBuilder.create(sparql11ParserBuilder)\n // This typePatch is not needed, but we need to import g11 for our types\n .typePatch<{ [g11.builtInCall.name]: [any]}>()\n .addRule(gram.builtInAdjust)\n .patchRule(gram.builtInPatch);\n\nexport type Adjust11Parser = ReturnType<typeof adjustParserBuilder.build>;\n\n/**\n * Pre-configured {@link LexerBuilder} for SPARQL 1.1 with the ADJUST built-in token\n * inserted before the `a` token in the token order.\n */\nexport const adjustLexerBuilder = LexerBuilder.create(l11.sparql11LexerBuilder).addBefore(l11.a, lex.BuiltInAdjust);\n\n/**\n * Parser that can parse a SPARQL 1.1 string (including the\n * [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md))\n * into a SPARQL 1.1 AST.\n */\nexport class Parser extends MinimalSparqlParser<SparqlQuery> {\n public constructor(\n args: Pick<ParserBuildArgs, 'parserConfig' | 'lexerConfig'> & { defaultContext?: Partial<SparqlContext> } = {},\n ) {\n const parser: Adjust11Parser = adjustParserBuilder.build({\n ...args,\n tokenVocabulary: adjustLexerBuilder.tokenVocabulary,\n queryPreProcessor: sparqlCodepointEscape,\n });\n super(parser, args.defaultContext);\n }\n}\n"]}
|
package/dist/esm/lib/Parser.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { ParserBuilder, LexerBuilder, type ParserBuildArgs } from '@traqula/core';
|
|
2
2
|
import { MinimalSparqlParser } from '@traqula/rules-sparql-1-1';
|
|
3
3
|
import type { gram as g11, SparqlQuery, SparqlContext } from '@traqula/rules-sparql-1-1';
|
|
4
|
+
/**
|
|
5
|
+
* Pre-configured {@link ParserBuilder} for SPARQL 1.1 with ADJUST function support,
|
|
6
|
+
* extending the SPARQL 1.1 parser builder with the
|
|
7
|
+
* [ADJUST built-in function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md).
|
|
8
|
+
*/
|
|
4
9
|
export declare const adjustParserBuilder: ParserBuilder<SparqlContext, "string" | "object" | "filter" | "copy" | "graphRef" | "load" | "clear" | "drop" | "create" | "add" | "move" | "modify" | "update" | "query" | "datasetClauses" | "bind" | "solutionModifier" | "expression" | "aggregate" | "functionCall" | "path" | "blankNode" | "queryUnit" | "selectQuery" | "subSelect" | "selectClause" | "constructQuery" | "describeQuery" | "askQuery" | "valuesClause" | "constructTemplate" | "constructTriples" | "updateUnit" | "update1" | "quadPattern" | "quadData" | "insertData" | "deleteData" | "deleteWhere" | "deleteClause" | "insertClause" | "graphOrDefault" | "graphRefAll" | "quads" | "quadsNotTriples" | "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" | "builtInCall" | "builtInRegex" | "builtInSubstr" | "builtInReplace" | "builtInExists" | "builtInNotexists" | "builtInCount" | "builtInSum" | "builtInMin" | "builtInMax" | "builtInAvg" | "builtInSample" | "builtInGroup_concat" | "usingClause" | "datasetClause" | "defaultGraphClause" | "usingClauses" | "namedGraphClause" | "sourceSelector" | "argList" | "expressionList" | "conditionalOrExpression" | "conditionalAndExpression" | "valueLogical" | "relationalExpression" | "numericExpression" | "additiveExpression" | "multiplicativeExpression" | "unaryExpression" | "primaryExpression" | "brackettedExpression" | "iriOrFunction" | "prologue" | "baseDecl" | "prefixDecl" | "verb" | "varOrTerm" | "varOrIri" | "var" | "graphTerm" | "rdfLiteral" | "numericLiteral" | "numericLiteralUnsigned" | "numericLiteralPositive" | "numericLiteralNegative" | "booleanLiteral" | "iri" | "iriFull" | "prefixedName" | "VerbA" | "pathEltOrInverse" | "pathSequence" | "pathAlternative" | "pathElt" | "pathMod" | "pathPrimary" | "pathNegatedPropertySet" | "pathOneInPropertySet" | "groupClause" | "groupCondition" | "havingClause" | "havingCondition" | "orderClause" | "orderCondition" | "limitOffsetClauses" | "limitClause" | "offsetClause" | "triplesBlock" | "triplesSameSubject" | "triplesSameSubjectPath" | "triplesTemplate" | "propertyList" | "propertyListPath" | "propertyListNotEmpty" | "propertyListPathNotEmpty" | "verbPath" | "verbSimple" | "objectList" | "objectListPath" | "objectPath" | "collection" | "collectionPath" | "triplesNode" | "triplesNodePath" | "blankNodePropertyList" | "blankNodePropertyListPath" | "graphNode" | "graphNodePath" | "whereClause" | "groupGraphPattern" | "groupGraphPatternSub" | "graphPatternNotTriples" | "optionalGraphPattern" | "graphGraphPattern" | "serviceGraphPattern" | "inlineData" | "dataBlock" | "inlineDataOneVar" | "inlineDataFull" | "dataBlockValue" | "minusGraphPattern" | "groupOrUnionGraphPattern" | "constraint" | "queryOrUpdate" | "builtInAdjust", {
|
|
5
10
|
string: import("@traqula/core").ParserRule<any, "string", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"string", import("@traqula/rules-sparql-1-1").TermLiteralStr, []>;
|
|
6
11
|
object: import("@traqula/core").ParserRule<any, "object", unknown, any[]> & import("@traqula/rules-sparql-1-1").SparqlGrammarRule<"object", import("@traqula/rules-sparql-1-1").TripleNesting, [import("@traqula/rules-sparql-1-1").GraphNode, import("@traqula/rules-sparql-1-1").TermIriFull | import("@traqula/rules-sparql-1-1").TermIriPrefixed | import("@traqula/rules-sparql-1-1").TermVariable | import("@traqula/rules-sparql-1-1").PropertyPathChain | import("@traqula/rules-sparql-1-1").PathModified | import("@traqula/rules-sparql-1-1").PathNegated]>;
|
|
@@ -211,10 +216,15 @@ export declare const adjustParserBuilder: ParserBuilder<SparqlContext, "string"
|
|
|
211
216
|
builtInAdjust: import("@traqula/core").ParserRule<SparqlContext, "builtInAdjust", g11.ExpressionFunctionX<[import("@traqula/rules-sparql-1-1").Expression, import("@traqula/rules-sparql-1-1").Expression]>, []>;
|
|
212
217
|
}>;
|
|
213
218
|
export type Adjust11Parser = ReturnType<typeof adjustParserBuilder.build>;
|
|
219
|
+
/**
|
|
220
|
+
* Pre-configured {@link LexerBuilder} for SPARQL 1.1 with the ADJUST built-in token
|
|
221
|
+
* inserted before the `a` token in the token order.
|
|
222
|
+
*/
|
|
214
223
|
export declare const adjustLexerBuilder: 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" | "BuiltInExists" | "BuiltInNotexists" | "BuiltInCount" | "BuiltInSum" | "BuiltInMin" | "BuiltInMax" | "BuiltInAvg" | "BuiltInSample" | "BuiltInGroup_concat" | "NamedGraph" | "DefaultGraph" | "Graph" | "GraphAll" | "BaseDecl" | "PrefixDecl" | "Select" | "Distinct" | "Reduced" | "As" | "Construct" | "Describe" | "Ask" | "From" | "Where" | "GroupByGroup" | "By" | "Having" | "Order" | "OrderAsc" | "OrderDesc" | "Limit" | "Offset" | "Values" | "Load" | "Silent" | "LoadInto" | "Clear" | "Drop" | "Create" | "Add" | "To" | "Move" | "Copy" | "ModifyWith" | "DeleteDataClause" | "DeleteWhereClause" | "DeleteClause" | "InsertDataClause" | "InsertClause" | "UsingClause" | "Optional" | "Service" | "Bind" | "Undef" | "Minus" | "Union" | "Filter" | "a" | "True" | "False" | "In" | "NotIn" | "Separator" | "LCurly" | "RCurly" | "Dot" | "Comma" | "Semi" | "LParen" | "RParen" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "Star" | "OpPlus" | "OpMinus" | "Exclamation" | "LogicAnd" | "LogicOr" | "Equal" | "NotEqual" | "LessThan" | "GreaterThan" | "LessThanEqual" | "GreaterThanEqual" | "Hathat" | "IriRef" | "PNameLn" | "PNameNs" | "BlankNodeLabel" | "Var1" | "Var2" | "LangTag" | "Integer" | "Decimal" | "Double" | "IntegerPositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteral1" | "StringLiteral2" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Nil" | "Anon" | "BuiltInAdjust">;
|
|
215
224
|
/**
|
|
216
|
-
*
|
|
217
|
-
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md)
|
|
225
|
+
* Parser that can parse a SPARQL 1.1 string (including the
|
|
226
|
+
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md))
|
|
227
|
+
* into a SPARQL 1.1 AST.
|
|
218
228
|
*/
|
|
219
229
|
export declare class Parser extends MinimalSparqlParser<SparqlQuery> {
|
|
220
230
|
constructor(args?: Pick<ParserBuildArgs, 'parserConfig' | 'lexerConfig'> & {
|
package/dist/esm/lib/Parser.js
CHANGED
|
@@ -2,15 +2,25 @@ import { ParserBuilder, LexerBuilder } from '@traqula/core';
|
|
|
2
2
|
import { sparql11ParserBuilder } from '@traqula/parser-sparql-1-1';
|
|
3
3
|
import { sparqlCodepointEscape, lex as l11, MinimalSparqlParser } from '@traqula/rules-sparql-1-1';
|
|
4
4
|
import { gram, lex } from '@traqula/rules-sparql-1-1-adjust';
|
|
5
|
+
/**
|
|
6
|
+
* Pre-configured {@link ParserBuilder} for SPARQL 1.1 with ADJUST function support,
|
|
7
|
+
* extending the SPARQL 1.1 parser builder with the
|
|
8
|
+
* [ADJUST built-in function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md).
|
|
9
|
+
*/
|
|
5
10
|
export const adjustParserBuilder = ParserBuilder.create(sparql11ParserBuilder)
|
|
6
11
|
// This typePatch is not needed, but we need to import g11 for our types
|
|
7
12
|
.typePatch()
|
|
8
13
|
.addRule(gram.builtInAdjust)
|
|
9
14
|
.patchRule(gram.builtInPatch);
|
|
15
|
+
/**
|
|
16
|
+
* Pre-configured {@link LexerBuilder} for SPARQL 1.1 with the ADJUST built-in token
|
|
17
|
+
* inserted before the `a` token in the token order.
|
|
18
|
+
*/
|
|
10
19
|
export const adjustLexerBuilder = LexerBuilder.create(l11.sparql11LexerBuilder).addBefore(l11.a, lex.BuiltInAdjust);
|
|
11
20
|
/**
|
|
12
|
-
*
|
|
13
|
-
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md)
|
|
21
|
+
* Parser that can parse a SPARQL 1.1 string (including the
|
|
22
|
+
* [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md))
|
|
23
|
+
* into a SPARQL 1.1 AST.
|
|
14
24
|
*/
|
|
15
25
|
export class Parser extends MinimalSparqlParser {
|
|
16
26
|
constructor(args = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../../lib/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAwB,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,GAAG,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEnG,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC5E,wEAAwE;KACvE,SAAS,EAAoC;KAC7C,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;KAC3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAIhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;AAEpH
|
|
1
|
+
{"version":3,"file":"Parser.js","sourceRoot":"","sources":["../../../lib/Parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAwB,MAAM,eAAe,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,GAAG,IAAI,GAAG,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEnG,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAE7D;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,aAAa,CAAC,MAAM,CAAC,qBAAqB,CAAC;IAC5E,wEAAwE;KACvE,SAAS,EAAoC;KAC7C,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;KAC3B,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AAIhC;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,aAAa,CAAC,CAAC;AAEpH;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,mBAAgC;IAC1D,YACE,OAA4G,EAAE;QAE9G,MAAM,MAAM,GAAmB,mBAAmB,CAAC,KAAK,CAAC;YACvD,GAAG,IAAI;YACP,eAAe,EAAE,kBAAkB,CAAC,eAAe;YACnD,iBAAiB,EAAE,qBAAqB;SACzC,CAAC,CAAC;QACH,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,CAAC;CACF","sourcesContent":["import { ParserBuilder, LexerBuilder, type ParserBuildArgs } from '@traqula/core';\nimport { sparql11ParserBuilder } from '@traqula/parser-sparql-1-1';\nimport { sparqlCodepointEscape, lex as l11, MinimalSparqlParser } from '@traqula/rules-sparql-1-1';\nimport type { gram as g11, SparqlQuery, SparqlContext } from '@traqula/rules-sparql-1-1';\nimport { gram, lex } from '@traqula/rules-sparql-1-1-adjust';\n\n/**\n * Pre-configured {@link ParserBuilder} for SPARQL 1.1 with ADJUST function support,\n * extending the SPARQL 1.1 parser builder with the\n * [ADJUST built-in function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md).\n */\nexport const adjustParserBuilder = ParserBuilder.create(sparql11ParserBuilder)\n // This typePatch is not needed, but we need to import g11 for our types\n .typePatch<{ [g11.builtInCall.name]: [any]}>()\n .addRule(gram.builtInAdjust)\n .patchRule(gram.builtInPatch);\n\nexport type Adjust11Parser = ReturnType<typeof adjustParserBuilder.build>;\n\n/**\n * Pre-configured {@link LexerBuilder} for SPARQL 1.1 with the ADJUST built-in token\n * inserted before the `a` token in the token order.\n */\nexport const adjustLexerBuilder = LexerBuilder.create(l11.sparql11LexerBuilder).addBefore(l11.a, lex.BuiltInAdjust);\n\n/**\n * Parser that can parse a SPARQL 1.1 string (including the\n * [ADJUST function](https://github.com/w3c/sparql-dev/blob/main/SEP/SEP-0002/sep-0002.md))\n * into a SPARQL 1.1 AST.\n */\nexport class Parser extends MinimalSparqlParser<SparqlQuery> {\n public constructor(\n args: Pick<ParserBuildArgs, 'parserConfig' | 'lexerConfig'> & { defaultContext?: Partial<SparqlContext> } = {},\n ) {\n const parser: Adjust11Parser = adjustParserBuilder.build({\n ...args,\n tokenVocabulary: adjustLexerBuilder.tokenVocabulary,\n queryPreProcessor: sparqlCodepointEscape,\n });\n super(parser, args.defaultContext);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@traqula/parser-sparql-1-1-adjust",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "SPARQL 1.1 + ADJUST parser",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -51,15 +51,15 @@
|
|
|
51
51
|
"spec:earl": "yarn spec:earl:base-1-0 && yarn spec:earl:query && yarn spec:earl:update"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@traqula/core": "^1.
|
|
55
|
-
"@traqula/parser-sparql-1-1": "^1.
|
|
56
|
-
"@traqula/rules-sparql-1-1": "^1.
|
|
57
|
-
"@traqula/rules-sparql-1-1-adjust": "^1.
|
|
54
|
+
"@traqula/core": "^1.1.1",
|
|
55
|
+
"@traqula/parser-sparql-1-1": "^1.1.1",
|
|
56
|
+
"@traqula/rules-sparql-1-1": "^1.1.1",
|
|
57
|
+
"@traqula/rules-sparql-1-1-adjust": "^1.1.1"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@traqula/test-utils": "^1.
|
|
60
|
+
"@traqula/test-utils": "^1.1.1",
|
|
61
61
|
"rdf-data-factory": "^2.0.1",
|
|
62
62
|
"rdf-test-suite": "^2.0.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "51799d80873e4f0fb0ca6ab778861f526d3a66d1"
|
|
65
65
|
}
|