@traqula/rules-sparql-1-1 0.0.22 → 0.0.24
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/dist/cjs/lib/MinimalSparqlParser.js +35 -58
- package/dist/cjs/lib/MinimalSparqlParser.js.map +1 -0
- package/dist/cjs/lib/Sparql11types.js +2 -15
- package/dist/cjs/lib/Sparql11types.js.map +1 -0
- package/dist/cjs/lib/astFactory.js +107 -119
- package/dist/cjs/lib/astFactory.js.map +1 -0
- package/dist/cjs/lib/expressionHelpers.js +181 -191
- package/dist/cjs/lib/expressionHelpers.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/ContextFactory.js +30 -52
- package/dist/cjs/lib/factoryMixins/ContextFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/ExpressionFactory.js +83 -102
- package/dist/cjs/lib/factoryMixins/ExpressionFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/GraphRefFactory.js +51 -73
- package/dist/cjs/lib/factoryMixins/GraphRefFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/PathFactory.js +68 -87
- package/dist/cjs/lib/factoryMixins/PathFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/Patternfactory.js +98 -120
- package/dist/cjs/lib/factoryMixins/Patternfactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/QueryFactory.js +43 -65
- package/dist/cjs/lib/factoryMixins/QueryFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/SolutionModifiersFactory.js +55 -77
- package/dist/cjs/lib/factoryMixins/SolutionModifiersFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/TermFactory.js +81 -102
- package/dist/cjs/lib/factoryMixins/TermFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/UpdateOperationFactory.js +126 -147
- package/dist/cjs/lib/factoryMixins/UpdateOperationFactory.js.map +1 -0
- package/dist/cjs/lib/factoryMixins/mixins.js +21 -38
- package/dist/cjs/lib/factoryMixins/mixins.js.map +1 -0
- package/dist/cjs/lib/grammar/builtIn.js +277 -377
- package/dist/cjs/lib/grammar/builtIn.js.map +1 -0
- package/dist/cjs/lib/grammar/dataSetClause.js +110 -109
- package/dist/cjs/lib/grammar/dataSetClause.js.map +1 -0
- package/dist/cjs/lib/grammar/expression.js +387 -358
- package/dist/cjs/lib/grammar/expression.js.map +1 -0
- package/dist/cjs/lib/grammar/general.js +173 -158
- package/dist/cjs/lib/grammar/general.js.map +1 -0
- package/dist/cjs/lib/grammar/index.js +94 -111
- package/dist/cjs/lib/grammar/index.js.map +1 -0
- package/dist/cjs/lib/grammar/literals.js +282 -266
- package/dist/cjs/lib/grammar/literals.js.map +1 -0
- package/dist/cjs/lib/grammar/propertyPaths.js +206 -193
- package/dist/cjs/lib/grammar/propertyPaths.js.map +1 -0
- package/dist/cjs/lib/grammar/queryUnit.js +395 -372
- package/dist/cjs/lib/grammar/queryUnit.js.map +1 -0
- package/dist/cjs/lib/grammar/solutionModifier.js +281 -265
- package/dist/cjs/lib/grammar/solutionModifier.js.map +1 -0
- package/dist/cjs/lib/grammar/tripleBlock.js +390 -355
- package/dist/cjs/lib/grammar/tripleBlock.js.map +1 -0
- package/dist/cjs/lib/grammar/updateUnit.js +551 -519
- package/dist/cjs/lib/grammar/updateUnit.js.map +1 -0
- package/dist/cjs/lib/grammar/whereClause.js +486 -459
- package/dist/cjs/lib/grammar/whereClause.js.map +1 -0
- package/dist/cjs/lib/index.js +47 -54
- package/dist/cjs/lib/index.js.map +1 -0
- package/dist/cjs/lib/lexer/BuiltInCalls.js +188 -333
- package/dist/cjs/lib/lexer/BuiltInCalls.js.map +1 -0
- package/dist/cjs/lib/lexer/graph.js +10 -40
- package/dist/cjs/lib/lexer/graph.js.map +1 -0
- package/dist/cjs/lib/lexer/index.js +43 -48
- package/dist/cjs/lib/lexer/index.js.map +1 -0
- package/dist/cjs/lib/lexer/lexer.js +84 -195
- package/dist/cjs/lib/lexer/lexer.js.map +1 -0
- package/dist/cjs/lib/lexer/lexerPatterns.js +40 -132
- package/dist/cjs/lib/lexer/lexerPatterns.js.map +1 -0
- package/dist/cjs/lib/lexer/symbols.js +31 -106
- package/dist/cjs/lib/lexer/symbols.js.map +1 -0
- package/dist/cjs/lib/lexer/terminals.js +100 -102
- package/dist/cjs/lib/lexer/terminals.js.map +1 -0
- package/dist/cjs/lib/sparql11HelperTypes.js +2 -15
- package/dist/cjs/lib/sparql11HelperTypes.js.map +1 -0
- package/dist/cjs/lib/utils.js +40 -58
- package/dist/cjs/lib/utils.js.map +1 -0
- package/dist/cjs/lib/validation/validators.js +197 -186
- package/dist/cjs/lib/validation/validators.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/package.json +10 -9
|
@@ -1,64 +1,41 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var MinimalSparqlParser_exports = {};
|
|
20
|
-
__export(MinimalSparqlParser_exports, {
|
|
21
|
-
MinimalSparqlParser: () => MinimalSparqlParser,
|
|
22
|
-
completeParseContext: () => completeParseContext
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(MinimalSparqlParser_exports);
|
|
25
|
-
var import_core = require("@traqula/core");
|
|
26
|
-
var import_astFactory = require("./astFactory.js");
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MinimalSparqlParser = void 0;
|
|
4
|
+
exports.completeParseContext = completeParseContext;
|
|
5
|
+
const core_1 = require("@traqula/core");
|
|
6
|
+
const astFactory_js_1 = require("./astFactory.js");
|
|
27
7
|
function completeParseContext(context) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
8
|
+
return {
|
|
9
|
+
astFactory: context.astFactory ?? new astFactory_js_1.AstFactory(),
|
|
10
|
+
baseIRI: context.baseIRI,
|
|
11
|
+
prefixes: { ...context.prefixes },
|
|
12
|
+
origSource: context.origSource ?? '',
|
|
13
|
+
offset: context.offset,
|
|
14
|
+
parseMode: context.parseMode ? new Set(context.parseMode) : new Set(['canParseVars', 'canCreateBlankNodes']),
|
|
15
|
+
skipValidation: context.skipValidation ?? false,
|
|
16
|
+
[core_1.traqulaIndentation]: context[core_1.traqulaIndentation] ?? 0,
|
|
17
|
+
indentInc: context.indentInc ?? 2,
|
|
18
|
+
};
|
|
39
19
|
}
|
|
40
20
|
class MinimalSparqlParser {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
21
|
+
parser;
|
|
22
|
+
constructor(parser) {
|
|
23
|
+
this.parser = parser;
|
|
24
|
+
}
|
|
25
|
+
F = new astFactory_js_1.AstFactory();
|
|
26
|
+
parse(query, context = {}) {
|
|
27
|
+
return this.parser.queryOrUpdate(query, completeParseContext(context));
|
|
28
|
+
}
|
|
29
|
+
parsePath(query, context = {}) {
|
|
30
|
+
const result = this.parser.path(query, completeParseContext(context));
|
|
31
|
+
if (this.F.isPathPure(result)) {
|
|
32
|
+
return {
|
|
33
|
+
...result,
|
|
34
|
+
prefixes: {},
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
56
38
|
}
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
39
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
MinimalSparqlParser,
|
|
63
|
-
completeParseContext
|
|
64
|
-
});
|
|
40
|
+
exports.MinimalSparqlParser = MinimalSparqlParser;
|
|
41
|
+
//# sourceMappingURL=MinimalSparqlParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MinimalSparqlParser.js","sourceRoot":"","sources":["../../../lib/MinimalSparqlParser.ts"],"names":[],"mappings":";;;AAUA,oDAcC;AAxBD,wCAAmD;AACnD,mDAA6C;AAS7C,SAAgB,oBAAoB,CAClC,OAAkG;IAElG,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,IAAI,0BAAU,EAAE;QAClD,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE;QACjC,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,EAAE;QACpC,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,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;QAC/C,CAAC,yBAAkB,CAAC,EAAE,OAAO,CAAC,yBAAkB,CAAC,IAAI,CAAC;QACtD,SAAS,EAAE,OAAO,CAAC,SAAS,IAAI,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,MAAa,mBAAmB;IACM;IAApC,YAAoC,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;IAC/C,CAAC,GAAG,IAAI,0BAAU,EAAE,CAAC;IAE/B,KAAK,CAAC,KAAa,EAAE,UAAkC,EAAE;QAC9D,OAAO,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,UAAkC,EAAE;QAElE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAC;QACtE,IAAI,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC9B,OAAO;gBACL,GAAG,MAAM;gBACT,QAAQ,EAAE,EAAE;aACb,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnBD,kDAmBC","sourcesContent":["import { traqulaIndentation } from '@traqula/core';\nimport { AstFactory } from './astFactory.js';\nimport type { SparqlContext, SparqlGeneratorContext } from './sparql11HelperTypes.js';\nimport type { Path, TermIri } from './Sparql11types.js';\n\ninterface Parser<ParseRet> {\n queryOrUpdate: (input: string, context: SparqlContext) => ParseRet;\n path: (input: string, context: SparqlContext) => TermIri | Path;\n}\n\nexport function completeParseContext(\n context: Partial<SparqlContext & SparqlGeneratorContext & { origSource: string; offset?: number }>,\n): SparqlContext & SparqlGeneratorContext & { origSource: string; offset?: number } {\n return {\n astFactory: context.astFactory ?? new AstFactory(),\n baseIRI: context.baseIRI,\n prefixes: { ...context.prefixes },\n origSource: context.origSource ?? '',\n offset: context.offset,\n parseMode: context.parseMode ? new Set(context.parseMode) : new Set([ 'canParseVars', 'canCreateBlankNodes' ]),\n skipValidation: context.skipValidation ?? false,\n [traqulaIndentation]: context[traqulaIndentation] ?? 0,\n indentInc: context.indentInc ?? 2,\n };\n}\n\nexport class MinimalSparqlParser<ParseRet> {\n public constructor(private readonly parser: Parser<ParseRet>) {}\n private readonly F = new AstFactory();\n\n public parse(query: string, context: Partial<SparqlContext> = {}): ParseRet {\n return this.parser.queryOrUpdate(query, completeParseContext(context));\n }\n\n public parsePath(query: string, context: Partial<SparqlContext> = {}):\n (Path & { prefixes: object }) | TermIri {\n const result = this.parser.path(query, completeParseContext(context));\n if (this.F.isPathPure(result)) {\n return {\n ...result,\n prefixes: {},\n };\n }\n return result;\n }\n}\n"]}
|
|
@@ -1,16 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var Sparql11types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(Sparql11types_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//# sourceMappingURL=Sparql11types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sparql11types.js","sourceRoot":"","sources":["../../../lib/Sparql11types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Localized, Node } from '@traqula/core';\n\nexport type Sparql11Nodes =\n | GraphRef\n | GraphQuads\n | UpdateOperation\n | Update\n | Query\n | DatasetClauses\n | TripleCollection\n | TripleNesting\n | Pattern\n | SolutionModifier\n | Expression\n | Path\n | ContextDefinition\n | Wildcard\n | Term;\n\nexport type GraphRefBase = Node & {\n type: 'graphRef';\n subType: string;\n};\nexport type GraphRefDefault = GraphRefBase & {\n subType: 'default';\n};\nexport type GraphRefNamed = GraphRefBase & {\n subType: 'named';\n};\nexport type GraphRefAll = GraphRefBase & {\n subType: 'all';\n};\nexport type GraphRefSpecific = GraphRefBase & {\n subType: 'specific';\n graph: TermIri;\n};\nexport type GraphRef =\n | GraphRefDefault\n | GraphRefNamed\n | GraphRefAll\n | GraphRefSpecific;\n\nexport type Quads = PatternBgp | GraphQuads;\n\nexport type GraphQuads = Node & {\n type: 'graph';\n graph: TermIri | TermVariable;\n triples: PatternBgp;\n};\n\n// https://www.w3.org/TR/sparql11-query/#rUpdate1\nexport type UpdateOperationBase = Node & { type: 'updateOperation'; subType: string };\nexport type UpdateOperationLoad = UpdateOperationBase & {\n subType: 'load';\n silent: boolean;\n source: TermIri;\n destination?: GraphRefSpecific;\n};\ntype UpdateOperationClearDropCreateBase = UpdateOperationBase & {\n subType: 'clear' | 'drop' | 'create';\n silent: boolean;\n destination: GraphRef;\n};\nexport type UpdateOperationClear = UpdateOperationClearDropCreateBase & { subType: 'clear' };\nexport type UpdateOperationDrop = UpdateOperationClearDropCreateBase & { subType: 'drop' };\nexport type UpdateOperationCreate = UpdateOperationClearDropCreateBase & {\n subType: 'create';\n destination: GraphRefSpecific;\n};\ntype UpdateOperationAddMoveCopy = UpdateOperationBase & {\n subType: 'add' | 'move' | 'copy';\n silent: boolean;\n source: GraphRefDefault | GraphRefSpecific;\n destination: GraphRefDefault | GraphRefSpecific;\n};\nexport type UpdateOperationAdd = UpdateOperationAddMoveCopy & { subType: 'add' };\nexport type UpdateOperationMove = UpdateOperationAddMoveCopy & { subType: 'move' };\nexport type UpdateOperationCopy = UpdateOperationAddMoveCopy & { subType: 'copy' };\ntype UpdateOperationInsertDeleteDelWhere = UpdateOperationBase & {\n subType: 'insertdata' | 'deletedata' | 'deletewhere';\n data: Quads[];\n};\nexport type UpdateOperationInsertData = UpdateOperationInsertDeleteDelWhere & { subType: 'insertdata' };\nexport type UpdateOperationDeleteData = UpdateOperationInsertDeleteDelWhere & { subType: 'deletedata' };\nexport type UpdateOperationDeleteWhere = UpdateOperationInsertDeleteDelWhere & { subType: 'deletewhere' };\nexport type UpdateOperationModify = UpdateOperationBase & {\n subType: 'modify';\n graph: TermIri | undefined;\n insert: Quads[];\n delete: Quads[];\n from: DatasetClauses;\n where: PatternGroup;\n};\nexport type UpdateOperation =\n | UpdateOperationLoad\n | UpdateOperationClear\n | UpdateOperationDrop\n | UpdateOperationCreate\n | UpdateOperationAdd\n | UpdateOperationMove\n | UpdateOperationCopy\n | UpdateOperationInsertData\n | UpdateOperationDeleteData\n | UpdateOperationDeleteWhere\n | UpdateOperationModify;\n\n// https://www.w3.org/TR/sparql11-query/#rUpdate\nexport type Update = Node & {\n type: 'update';\n updates: {\n operation?: UpdateOperation;\n context: ContextDefinition[];\n }[];\n};\n\n// https://www.w3.org/TR/sparql11-query/#rQueryUnit\nexport type QueryBase = Node & {\n type: 'query';\n subType: string;\n\n context: ContextDefinition[];\n values?: PatternValues;\n solutionModifiers: SolutionModifiers;\n datasets: DatasetClauses;\n where?: PatternGroup;\n};\nexport type QuerySelect = QueryBase & {\n subType: 'select';\n variables: (TermVariable | PatternBind)[] | [Wildcard];\n distinct?: true;\n reduced?: true;\n where: PatternGroup;\n};\nexport type QueryConstruct = QueryBase & {\n subType: 'construct';\n template: PatternBgp;\n where: PatternGroup;\n};\nexport type QueryDescribe = QueryBase & {\n subType: 'describe';\n variables: (TermVariable | TermIri)[] | [Wildcard];\n};\nexport type QueryAsk = QueryBase & {\n subType: 'ask';\n where: PatternGroup;\n};\nexport type Query =\n | QuerySelect\n | QueryConstruct\n | QueryDescribe\n | QueryAsk;\n\nexport type SparqlQuery = Query | Update;\n\n// https://www.w3.org/TR/sparql11-query/#rDatasetClause\nexport type DatasetClauses = Node & {\n type: 'datasetClauses';\n clauses: { clauseType: 'default' | 'named'; value: TermIri }[];\n};\n\n// https://www.w3.org/TR/sparql11-query/#rGraphNode\nexport type TripleCollectionBase = Node & {\n type: 'tripleCollection';\n subType: string;\n triples: TripleNesting[];\n identifier: Term;\n};\n/**\n * The subject of the triples does not have a string manifestation.\n */\nexport type TripleCollectionList = TripleCollectionBase & {\n subType: 'list';\n identifier: TermBlank;\n};\n/**\n * Bot subject and predicate of the triples do not have a string manifestation.\n */\nexport type TripleCollectionBlankNodeProperties = TripleCollectionBase & {\n subType: 'blankNodeProperties';\n identifier: TermBlank;\n};\nexport type TripleCollection =\n | TripleCollectionList\n | TripleCollectionBlankNodeProperties;\n\n// https://www.w3.org/TR/sparql11-query/#rGraphNode\nexport type GraphNode = Term | TripleCollection;\n\n// https://www.w3.org/TR/sparql11-query/#rTriplesBlock\nexport type TripleNesting = Node & {\n type: 'triple';\n subject: GraphNode;\n predicate: TermIri | TermVariable | Path;\n object: GraphNode;\n};\n\nexport type PatternBase = Node & { type: 'pattern'; subType: string };\nexport type PatternFilter = PatternBase & {\n subType: 'filter';\n expression: Expression;\n};\nexport type PatternMinus = PatternBase & {\n subType: 'minus';\n patterns: Pattern[];\n};\n\nexport type PatternGroup = PatternBase & {\n subType: 'group';\n patterns: Pattern[];\n};\nexport type PatternOptional = PatternBase & {\n subType: 'optional';\n patterns: Pattern[];\n};\nexport type PatternGraph = PatternBase & {\n subType: 'graph';\n name: TermIri | TermVariable;\n patterns: Pattern[];\n};\nexport type PatternUnion = PatternBase & {\n subType: 'union';\n patterns: PatternGroup[];\n};\nexport type BasicGraphPattern = (TripleNesting | TripleCollection)[];\nexport type PatternBgp = PatternBase & {\n subType: 'bgp';\n /**\n * Only the first appearance of a subject and predicate have a string manifestation\n */\n triples: BasicGraphPattern;\n};\nexport type PatternBind = PatternBase & {\n subType: 'bind';\n expression: Expression;\n variable: TermVariable;\n};\nexport type PatternService = PatternBase & {\n subType: 'service';\n name: TermIri | TermVariable;\n silent: boolean;\n patterns: Pattern[];\n};\n/**\n * A single list of assignments maps the variable identifier to the value\n */\nexport type ValuePatternRow = Record<string, TermIri | TermLiteral | undefined>;\nexport type PatternValues = PatternBase & {\n subType: 'values';\n variables: TermVariable[];\n values: ValuePatternRow[];\n};\nexport type SubSelect = QuerySelect;\n\nexport type Pattern =\n | PatternBgp\n | PatternGroup\n | PatternUnion\n | PatternOptional\n | PatternMinus\n | PatternGraph\n | PatternService\n | PatternFilter\n | PatternBind\n | PatternValues\n | SubSelect;\n\nexport type SolutionModifiers = {\n group?: SolutionModifierGroup;\n having?: SolutionModifierHaving;\n order?: SolutionModifierOrder;\n limitOffset?: SolutionModifierLimitOffset;\n};\nexport type SolutionModifierBase = Node & { type: 'solutionModifier'; subType: string };\nexport type SolutionModifierGroupBind = Localized & {\n variable: TermVariable;\n value: Expression;\n};\nexport type SolutionModifierGroup = SolutionModifierBase & {\n subType: 'group';\n groupings: (Expression | SolutionModifierGroupBind)[];\n};\nexport type SolutionModifierHaving = SolutionModifierBase & {\n subType: 'having';\n having: Expression[];\n};\nexport type Ordering = Localized & {\n descending: boolean;\n expression: Expression;\n};\nexport type SolutionModifierOrder = SolutionModifierBase & {\n subType: 'order';\n orderDefs: Ordering[];\n};\nexport type SolutionModifierLimitOffset = SolutionModifierBase\n & { subType: 'limitOffset'; limit: number | undefined; offset: number | undefined };\n\nexport type SolutionModifier =\n | SolutionModifierGroup\n | SolutionModifierHaving\n | SolutionModifierOrder\n | SolutionModifierLimitOffset;\n\nexport type ExpressionBase = Node & { type: 'expression'; subType: string };\n\ntype ExpressionAggregateBase = ExpressionBase & {\n subType: 'aggregate';\n distinct: boolean;\n expression: [Expression | Wildcard];\n};\nexport type ExpressionAggregateDefault = ExpressionAggregateBase & {\n expression: [Expression];\n aggregation: string;\n};\nexport type ExpressionAggregateOnWildcard = ExpressionAggregateBase & {\n expression: [Wildcard];\n aggregation: string;\n};\nexport type ExpressionAggregateSeparator = ExpressionAggregateBase & {\n expression: [Expression];\n aggregation: string;\n separator: string;\n};\nexport type ExpressionAggregate =\n | ExpressionAggregateDefault\n | ExpressionAggregateOnWildcard\n | ExpressionAggregateSeparator;\n\nexport type ExpressionOperation = ExpressionBase & {\n subType: 'operation';\n operator: string;\n args: Expression[];\n};\n\nexport type ExpressionPatternOperation = ExpressionBase & {\n subType: 'patternOperation';\n operator: string;\n // Can be a pattern in case of exists and not exists\n args: PatternGroup;\n};\n\nexport type ExpressionFunctionCall = ExpressionBase & {\n subType: 'functionCall';\n function: TermIri;\n distinct: boolean;\n args: Expression[];\n};\n\nexport type Expression =\n | ExpressionOperation\n | ExpressionPatternOperation\n | ExpressionFunctionCall\n | ExpressionAggregate\n | TermIri\n | TermVariable\n | TermLiteral;\n\nexport type PropertyPathBase = Node & { type: 'path'; subType: string };\nexport type PropertyPathChain = PropertyPathBase & {\n subType: '|' | '/';\n items: Path[];\n};\n\nexport type PathModified = PropertyPathBase & {\n subType: '?' | '*' | '+' | '^';\n items: [Path];\n};\n\nexport type PathNegatedElt = PropertyPathBase & {\n subType: '^';\n items: [TermIri];\n};\n\nexport type PathAlternativeLimited = PropertyPathBase & {\n subType: '|';\n items: (TermIri | PathNegatedElt)[];\n};\n\nexport type PathNegated = PropertyPathBase & {\n subType: '!';\n items: [TermIri | PathNegatedElt | PathAlternativeLimited];\n};\n\n// [[88]](https://www.w3.org/TR/sparql11-query/#rPath)\nexport type Path =\n | TermIri\n | PropertyPathChain\n | PathModified\n | PathNegated;\nexport type PathPure = PropertyPathChain | PathModified | PathNegated;\n\nexport type ContextDefinitionBase_ = Node & { type: 'contextDef'; subType: string };\nexport type ContextDefinitionPrefix = ContextDefinitionBase_ & {\n subType: 'prefix';\n key: string;\n value: TermIriFull;\n};\nexport type ContextDefinitionBase = ContextDefinitionBase_ & {\n subType: 'base';\n value: TermIriFull;\n};\nexport type ContextDefinition = ContextDefinitionPrefix | ContextDefinitionBase;\n\nexport type Wildcard = Node & {\n type: 'wildcard';\n};\n\nexport type TermBase = Node & { type: 'term'; subType: string };\nexport type TermLiteralBase = TermBase & {\n subType: 'literal';\n value: string;\n};\nexport type TermLiteralStr = TermLiteralBase & { langOrIri: undefined };\nexport type TermLiteralLangStr = TermLiteralBase & { langOrIri: string };\nexport type TermLiteralTyped = TermLiteralBase & { langOrIri: TermIri };\nexport type TermLiteral = TermLiteralStr | TermLiteralLangStr | TermLiteralTyped;\n\nexport type TermVariable = TermBase & {\n subType: 'variable';\n value: string;\n};\n\nexport type TermIriBase = TermBase & { subType: 'namedNode' };\nexport type TermIriFull = TermIriBase & { value: string };\nexport type TermIriPrefixed = TermIriBase & {\n value: string;\n prefix: string;\n};\nexport type TermIri = TermIriFull | TermIriPrefixed;\n\nexport type TermBlank = TermBase & { subType: 'blankNode' } & { label: string };\n\nexport type GraphTerm = TermIri | TermBlank | TermLiteral;\nexport type Term = GraphTerm | TermVariable;\n"]}
|
|
@@ -1,121 +1,109 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
triples,
|
|
108
|
-
loc
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
isGraphQuads(obj) {
|
|
112
|
-
return super.isOfType(obj, "graph");
|
|
113
|
-
}
|
|
114
|
-
isUpdate(obj) {
|
|
115
|
-
return super.isOfType(obj, "update");
|
|
116
|
-
}
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AstFactory = void 0;
|
|
4
|
+
const core_1 = require("@traqula/core");
|
|
5
|
+
const ContextFactory_js_1 = require("./factoryMixins/ContextFactory.js");
|
|
6
|
+
const ExpressionFactory_js_1 = require("./factoryMixins/ExpressionFactory.js");
|
|
7
|
+
const GraphRefFactory_js_1 = require("./factoryMixins/GraphRefFactory.js");
|
|
8
|
+
const mixins_js_1 = require("./factoryMixins/mixins.js");
|
|
9
|
+
const PathFactory_js_1 = require("./factoryMixins/PathFactory.js");
|
|
10
|
+
const Patternfactory_js_1 = require("./factoryMixins/Patternfactory.js");
|
|
11
|
+
const QueryFactory_js_1 = require("./factoryMixins/QueryFactory.js");
|
|
12
|
+
const SolutionModifiersFactory_js_1 = require("./factoryMixins/SolutionModifiersFactory.js");
|
|
13
|
+
const TermFactory_js_1 = require("./factoryMixins/TermFactory.js");
|
|
14
|
+
const UpdateOperationFactory_js_1 = require("./factoryMixins/UpdateOperationFactory.js");
|
|
15
|
+
class AstFactory extends (0, mixins_js_1.asArg)(core_1.AstCoreFactory)
|
|
16
|
+
.call(ContextFactory_js_1.ContextFactoryMixin)
|
|
17
|
+
.call(ExpressionFactory_js_1.ExpressionFactoryMixin)
|
|
18
|
+
.call(GraphRefFactory_js_1.GraphRefFactoryMixin)
|
|
19
|
+
.call(PathFactory_js_1.PathFactoryMixin)
|
|
20
|
+
.call(Patternfactory_js_1.PatternFactoryMixin)
|
|
21
|
+
.call(QueryFactory_js_1.QueryFactoryMixin)
|
|
22
|
+
.call(SolutionModifiersFactory_js_1.SolutionModifiersFactoryMixin)
|
|
23
|
+
.call(TermFactory_js_1.TermFactoryMixin)
|
|
24
|
+
.call(UpdateOperationFactory_js_1.UpdateOperationFactoryMixin)
|
|
25
|
+
.returns() {
|
|
26
|
+
alwaysSparql11(obj) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
isPath(obj) {
|
|
30
|
+
return this.isPathPure(obj) || this.isTermNamed(obj);
|
|
31
|
+
}
|
|
32
|
+
isExpression(obj) {
|
|
33
|
+
return this.isExpressionPure(obj) || this.isTermNamed(obj) || this.isTermVariable(obj) || this.isTermLiteral(obj);
|
|
34
|
+
}
|
|
35
|
+
graphNodeIdentifier(graphNode) {
|
|
36
|
+
return graphNode.type === 'tripleCollection' ? graphNode.identifier : graphNode;
|
|
37
|
+
}
|
|
38
|
+
triple(subject, predicate, object, loc) {
|
|
39
|
+
return {
|
|
40
|
+
type: 'triple',
|
|
41
|
+
subject,
|
|
42
|
+
predicate,
|
|
43
|
+
object,
|
|
44
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
isTriple(obj) {
|
|
48
|
+
return this.isOfType(obj, 'triple');
|
|
49
|
+
}
|
|
50
|
+
datasetClauses(clauses, loc) {
|
|
51
|
+
return {
|
|
52
|
+
type: 'datasetClauses',
|
|
53
|
+
clauses,
|
|
54
|
+
loc,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
isDatasetClauses(obj) {
|
|
58
|
+
return this.isOfType(obj, 'datasetClauses');
|
|
59
|
+
}
|
|
60
|
+
wildcard(loc) {
|
|
61
|
+
return { type: 'wildcard', loc };
|
|
62
|
+
}
|
|
63
|
+
isWildcard(obj) {
|
|
64
|
+
return this.isOfType(obj, 'wildcard');
|
|
65
|
+
}
|
|
66
|
+
isTripleCollection(obj) {
|
|
67
|
+
return this.isOfType(obj, 'tripleCollection');
|
|
68
|
+
}
|
|
69
|
+
tripleCollectionBlankNodeProperties(identifier, triples, loc) {
|
|
70
|
+
return {
|
|
71
|
+
type: 'tripleCollection',
|
|
72
|
+
subType: 'blankNodeProperties',
|
|
73
|
+
identifier,
|
|
74
|
+
triples,
|
|
75
|
+
loc,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
isTripleCollectionBlankNodeProperties(obj) {
|
|
79
|
+
return this.isOfSubType(obj, 'tripleCollection', 'blankNodeProperties');
|
|
80
|
+
}
|
|
81
|
+
tripleCollectionList(identifier, triples, loc) {
|
|
82
|
+
return {
|
|
83
|
+
type: 'tripleCollection',
|
|
84
|
+
subType: 'list',
|
|
85
|
+
identifier,
|
|
86
|
+
triples,
|
|
87
|
+
loc,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
isTripleCollectionList(obj) {
|
|
91
|
+
return this.isOfSubType(obj, 'tripleCollection', 'list');
|
|
92
|
+
}
|
|
93
|
+
graphQuads(graph, triples, loc) {
|
|
94
|
+
return {
|
|
95
|
+
type: 'graph',
|
|
96
|
+
graph,
|
|
97
|
+
triples,
|
|
98
|
+
loc,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
isGraphQuads(obj) {
|
|
102
|
+
return super.isOfType(obj, 'graph');
|
|
103
|
+
}
|
|
104
|
+
isUpdate(obj) {
|
|
105
|
+
return super.isOfType(obj, 'update');
|
|
106
|
+
}
|
|
117
107
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
AstFactory
|
|
121
|
-
});
|
|
108
|
+
exports.AstFactory = AstFactory;
|
|
109
|
+
//# sourceMappingURL=astFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"astFactory.js","sourceRoot":"","sources":["../../../lib/astFactory.ts"],"names":[],"mappings":"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","sourcesContent":["import type { SourceLocation, SubTyped, Typed } from '@traqula/core';\nimport { AstCoreFactory } from '@traqula/core';\nimport { ContextFactoryMixin } from './factoryMixins/ContextFactory.js';\nimport { ExpressionFactoryMixin } from './factoryMixins/ExpressionFactory.js';\nimport { GraphRefFactoryMixin } from './factoryMixins/GraphRefFactory.js';\nimport { asArg } from './factoryMixins/mixins.js';\nimport { PathFactoryMixin } from './factoryMixins/PathFactory.js';\nimport { PatternFactoryMixin } from './factoryMixins/Patternfactory.js';\nimport { QueryFactoryMixin } from './factoryMixins/QueryFactory.js';\nimport { SolutionModifiersFactoryMixin } from './factoryMixins/SolutionModifiersFactory.js';\nimport { TermFactoryMixin } from './factoryMixins/TermFactory.js';\nimport { UpdateOperationFactoryMixin } from './factoryMixins/UpdateOperationFactory.js';\nimport type {\n DatasetClauses,\n GraphNode,\n GraphQuads,\n PatternBgp,\n Sparql11Nodes,\n Term,\n TermBlank,\n TermIri,\n TermVariable,\n TripleCollectionBlankNodeProperties,\n TripleCollectionList,\n TripleNesting,\n Update,\n Wildcard,\n} from './Sparql11types.js';\n\nexport class AstFactory extends asArg(AstCoreFactory)\n .call(ContextFactoryMixin)\n .call(ExpressionFactoryMixin)\n .call(GraphRefFactoryMixin)\n .call(PathFactoryMixin)\n .call(PatternFactoryMixin)\n .call(QueryFactoryMixin)\n .call(SolutionModifiersFactoryMixin)\n .call(TermFactoryMixin)\n .call(UpdateOperationFactoryMixin)\n .returns() {\n public alwaysSparql11(obj: object): obj is Sparql11Nodes {\n return true;\n }\n\n public isPath(obj: object): obj is SubTyped<'term', 'namedNode'> | Typed<'path'> {\n return this.isPathPure(obj) || this.isTermNamed(obj);\n }\n\n public isExpression(obj: object):\n obj is SubTyped<'term', 'namedNode' | 'variable' | 'literal'> | Typed<'expression'> {\n return this.isExpressionPure(obj) || this.isTermNamed(obj) || this.isTermVariable(obj) || this.isTermLiteral(obj);\n }\n\n public graphNodeIdentifier(graphNode: GraphNode): Term {\n return graphNode.type === 'tripleCollection' ? graphNode.identifier : graphNode;\n }\n\n public triple(\n subject: TripleNesting['subject'],\n predicate: TripleNesting['predicate'],\n object: TripleNesting['object'],\n loc?: SourceLocation,\n ): TripleNesting {\n return {\n type: 'triple',\n subject,\n predicate,\n object,\n loc: loc ?? this.sourceLocation(subject, predicate, object),\n };\n }\n\n public isTriple(obj: object): obj is Typed<'triple'> {\n return this.isOfType(obj, 'triple');\n }\n\n public datasetClauses(clauses: DatasetClauses['clauses'], loc: SourceLocation): DatasetClauses {\n return {\n type: 'datasetClauses',\n clauses,\n loc,\n };\n }\n\n public isDatasetClauses(obj: object): obj is Typed<'datasetClauses'> {\n return this.isOfType(obj, 'datasetClauses');\n }\n\n public wildcard(loc: SourceLocation): Wildcard {\n return { type: 'wildcard', loc };\n }\n\n public isWildcard(obj: object): obj is Typed<'wildcard'> {\n return this.isOfType(obj, 'wildcard');\n }\n\n public isTripleCollection(obj: object): obj is Typed<'tripleCollection'> {\n return this.isOfType(obj, 'tripleCollection');\n }\n\n public tripleCollectionBlankNodeProperties(\n identifier: TermBlank,\n triples: TripleNesting[],\n loc: SourceLocation,\n ): TripleCollectionBlankNodeProperties {\n return {\n type: 'tripleCollection',\n subType: 'blankNodeProperties',\n identifier,\n triples,\n loc,\n };\n }\n\n public isTripleCollectionBlankNodeProperties(obj: object):\n obj is SubTyped<'tripleCollection', 'blankNodeProperties'> {\n return this.isOfSubType(obj, 'tripleCollection', 'blankNodeProperties');\n }\n\n public tripleCollectionList(\n identifier: TermBlank,\n triples: TripleNesting[],\n loc: SourceLocation,\n ): TripleCollectionList {\n return {\n type: 'tripleCollection',\n subType: 'list',\n identifier,\n triples,\n loc,\n };\n }\n\n public isTripleCollectionList(obj: object):\n obj is SubTyped<'tripleCollection', 'list'> {\n return this.isOfSubType(obj, 'tripleCollection', 'list');\n }\n\n public graphQuads(graph: TermIri | TermVariable, triples: PatternBgp, loc: SourceLocation): GraphQuads {\n return {\n type: 'graph',\n graph,\n triples,\n loc,\n };\n }\n\n public isGraphQuads(obj: object): obj is GraphQuads {\n return super.isOfType(obj, 'graph');\n }\n\n public isUpdate(obj: object): obj is Update {\n return super.isOfType(obj, 'update');\n }\n}\n"]}
|