@traqula/rules-sparql-1-2 0.0.23 → 0.0.25
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 -0
- package/dist/cjs/lib/AstFactory.js +75 -94
- package/dist/cjs/lib/AstFactory.js.map +1 -0
- package/dist/cjs/lib/grammar.js +662 -602
- package/dist/cjs/lib/grammar.js.map +1 -0
- package/dist/cjs/lib/index.js +45 -50
- package/dist/cjs/lib/index.js.map +1 -0
- package/dist/cjs/lib/lexer.js +39 -92
- package/dist/cjs/lib/lexer.js.map +1 -0
- package/dist/cjs/lib/parserUtils.js +33 -42
- package/dist/cjs/lib/parserUtils.js.map +1 -0
- package/dist/cjs/lib/sparql12HelperTypes.js +2 -15
- package/dist/cjs/lib/sparql12HelperTypes.js.map +1 -0
- package/dist/cjs/lib/sparql12Types.js +2 -15
- package/dist/cjs/lib/sparql12Types.js.map +1 -0
- package/dist/cjs/lib/validators.js +82 -97
- package/dist/cjs/lib/validators.js.map +1 -0
- package/dist/esm/lib/AstFactory.d.ts +3 -0
- package/dist/esm/lib/AstFactory.js +4 -1
- package/dist/esm/lib/AstFactory.js.map +1 -1
- package/dist/esm/lib/grammar.d.ts +4 -4
- package/dist/esm/lib/grammar.js +12 -6
- package/dist/esm/lib/grammar.js.map +1 -1
- package/dist/esm/lib/lexer.d.ts +1 -1
- package/dist/esm/lib/parserUtils.d.ts +7 -4
- package/dist/esm/lib/parserUtils.js +15 -3
- package/dist/esm/lib/parserUtils.js.map +1 -1
- package/package.json +10 -10
package/dist/esm/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<"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" | "
|
|
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" | "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" | "Semi" | "LCurly" | "RCurly" | "Dot" | "Star" | "LParen" | "RParen" | "Nil" | "Comma" | "LSquare" | "RSquare" | "Pipe" | "Slash" | "Hat" | "Question" | "OpPlus" | "OpMinus" | "Exclamation" | "LogicAnd" | "LogicOr" | "Equal" | "NotEqual" | "LessThan" | "GreaterThan" | "LessThanEqual" | "GreaterThanEqual" | "Hathat" | "IriRef" | "PNameLn" | "PNameNs" | "BlankNodeLabel" | "Var1" | "Var2" | "Integer" | "Decimal" | "Double" | "IntegerPositive" | "DecimalPositive" | "DoublePositive" | "IntegerNegative" | "DecimalNegative" | "DoubleNegative" | "StringLiteral1" | "StringLiteral2" | "StringLiteralLong1" | "StringLiteralLong2" | "Ws" | "Comment" | "Anon" | "Version" | "Tilde" | "AnnotationOpen" | "AnnotationClose" | "ReificationOpen" | "ReificationClose" | "TripleTermOpen" | "TripleTermClose" | "BuiltInLangdir" | "BuiltInStrLangdir" | "BuiltInHasLang" | "BuiltInHasLangdir" | "BuiltInIsTriple" | "BuiltInTriple" | "BuiltInSubject" | "BuiltInPredicate" | "BuiltInObject" | "LANG_DIR">;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { TransformerSubTyped } from '@traqula/core';
|
|
2
2
|
import type { SparqlContext, SparqlGeneratorContext } from './sparql12HelperTypes.js';
|
|
3
3
|
import type { Sparql12Nodes } from './sparql12Types.js';
|
|
4
|
-
export declare function completeParseContext(context: Partial<SparqlContext
|
|
5
|
-
|
|
4
|
+
export declare function completeParseContext(context: Partial<SparqlContext>): SparqlContext;
|
|
5
|
+
export declare function completeGeneratorContext(context: Partial<SparqlGeneratorContext & {
|
|
6
6
|
offset?: number;
|
|
7
|
-
}>):
|
|
8
|
-
origSource: string;
|
|
7
|
+
}>): SparqlGeneratorContext & {
|
|
9
8
|
offset?: number;
|
|
10
9
|
};
|
|
10
|
+
export declare function copyParseContext<T extends Partial<SparqlContext & SparqlGeneratorContext & {
|
|
11
|
+
origSource: string;
|
|
12
|
+
offset?: number;
|
|
13
|
+
}>>(context: T): T;
|
|
11
14
|
export declare class AstTransformer extends TransformerSubTyped<Sparql12Nodes> {
|
|
12
15
|
}
|
|
@@ -2,17 +2,29 @@ import { TransformerSubTyped, traqulaIndentation } from '@traqula/core';
|
|
|
2
2
|
import { AstFactory } from './AstFactory.js';
|
|
3
3
|
export function completeParseContext(context) {
|
|
4
4
|
return {
|
|
5
|
-
astFactory: context.astFactory ?? new AstFactory(),
|
|
5
|
+
astFactory: context.astFactory ?? new AstFactory({ tracksSourceLocation: false }),
|
|
6
6
|
baseIRI: context.baseIRI,
|
|
7
7
|
prefixes: { ...context.prefixes },
|
|
8
|
-
origSource: context.origSource ?? '',
|
|
9
|
-
offset: context.offset,
|
|
10
8
|
parseMode: context.parseMode ? new Set(context.parseMode) : new Set(['canParseVars', 'canCreateBlankNodes']),
|
|
11
9
|
skipValidation: context.skipValidation ?? false,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function completeGeneratorContext(context) {
|
|
13
|
+
return {
|
|
14
|
+
astFactory: context.astFactory ?? new AstFactory(),
|
|
15
|
+
origSource: context.origSource ?? '',
|
|
16
|
+
offset: context.offset,
|
|
12
17
|
indentInc: context.indentInc ?? 2,
|
|
13
18
|
[traqulaIndentation]: context[traqulaIndentation] ?? 0,
|
|
14
19
|
};
|
|
15
20
|
}
|
|
21
|
+
export function copyParseContext(context) {
|
|
22
|
+
return {
|
|
23
|
+
...context,
|
|
24
|
+
prefixes: { ...context.prefixes },
|
|
25
|
+
parseMode: new Set(context.parseMode),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
16
28
|
export class AstTransformer extends TransformerSubTyped {
|
|
17
29
|
}
|
|
18
30
|
//# sourceMappingURL=parserUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parserUtils.js","sourceRoot":"","sources":["../../../lib/parserUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,MAAM,UAAU,oBAAoB,CAClC,
|
|
1
|
+
{"version":3,"file":"parserUtils.js","sourceRoot":"","sources":["../../../lib/parserUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C,MAAM,UAAU,oBAAoB,CAClC,OAA+B;IAE/B,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,UAAU,CAAC,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;QACjF,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE;QACjC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAE,cAAc,EAAE,qBAAqB,CAAE,CAAC;QAC9G,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,KAAK;KAChD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAA8D;IAE9D,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,UAAU,EAAE;QAClD,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;QACjC,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,IAAI,CAAC;KACvD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gBAAgB,CAE9B,OAAU;IAEV,OAAO;QACL,GAAG,OAAO;QACV,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE;QACjC,SAAS,EAAE,IAAI,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,MAAM,OAAO,cAAe,SAAQ,mBAAkC;CAAG","sourcesContent":["import { TransformerSubTyped, traqulaIndentation } from '@traqula/core';\nimport { AstFactory } from './AstFactory.js';\nimport type { SparqlContext, SparqlGeneratorContext } from './sparql12HelperTypes.js';\nimport type { Sparql12Nodes } from './sparql12Types.js';\n\nexport function completeParseContext(\n context: Partial<SparqlContext>,\n): SparqlContext {\n return {\n astFactory: context.astFactory ?? new AstFactory({ tracksSourceLocation: false }),\n baseIRI: context.baseIRI,\n prefixes: { ...context.prefixes },\n parseMode: context.parseMode ? new Set(context.parseMode) : new Set([ 'canParseVars', 'canCreateBlankNodes' ]),\n skipValidation: context.skipValidation ?? false,\n };\n}\n\nexport function completeGeneratorContext(\n context: Partial<SparqlGeneratorContext & { offset?: number }>,\n): SparqlGeneratorContext & { offset?: number } {\n return {\n astFactory: context.astFactory ?? new AstFactory(),\n origSource: context.origSource ?? '',\n offset: context.offset,\n indentInc: context.indentInc ?? 2,\n [traqulaIndentation]: context[traqulaIndentation] ?? 0,\n };\n}\n\nexport function copyParseContext<T extends\nPartial<SparqlContext & SparqlGeneratorContext & { origSource: string; offset?: number }>>(\n context: T,\n): T {\n return {\n ...context,\n prefixes: { ...context.prefixes },\n parseMode: new Set(context.parseMode),\n };\n}\n\nexport class AstTransformer extends TransformerSubTyped<Sparql12Nodes> {}\n"]}
|
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.25",
|
|
5
5
|
"description": "Traqula Lexer and Grammar Rules for sparql 1.2",
|
|
6
6
|
"lsd:module": true,
|
|
7
7
|
"license": "MIT",
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/esm/lib/index.js",
|
|
29
29
|
"files": [
|
|
30
|
-
"dist/**/*.d.ts",
|
|
31
|
-
"dist/**/*.js",
|
|
32
|
-
"dist/**/*.js.map",
|
|
33
|
-
"dist
|
|
30
|
+
"dist/*/lib/**/*.d.ts",
|
|
31
|
+
"dist/*/lib/**/*.js",
|
|
32
|
+
"dist/*/lib/**/*.js.map",
|
|
33
|
+
"dist/cjs/package.json"
|
|
34
34
|
],
|
|
35
35
|
"engines": {
|
|
36
36
|
"node": "^20.19.0 || >=22.12.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
|
-
"build": "yarn build:ts && yarn build:
|
|
39
|
+
"build": "yarn build:ts && yarn build:cjs",
|
|
40
40
|
"build:ts": "node \"../../node_modules/typescript/bin/tsc\" -b",
|
|
41
|
-
"build:
|
|
41
|
+
"build:cjs": "node \"../../node_modules/typescript/bin/tsc\" -b tsconfig.cjs.json"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@traqula/core": "^0.0.
|
|
45
|
-
"@traqula/rules-sparql-1-1": "^0.0.
|
|
44
|
+
"@traqula/core": "^0.0.25",
|
|
45
|
+
"@traqula/rules-sparql-1-1": "^0.0.25"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "52cfb2b513294dc154febc0209ac811ceeb6785b"
|
|
48
48
|
}
|