@traqula/rules-sparql-1-1 0.0.23 → 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.
Files changed (75) hide show
  1. package/dist/cjs/lib/MinimalSparqlParser.js +35 -58
  2. package/dist/cjs/lib/MinimalSparqlParser.js.map +1 -0
  3. package/dist/cjs/lib/Sparql11types.js +2 -15
  4. package/dist/cjs/lib/Sparql11types.js.map +1 -0
  5. package/dist/cjs/lib/astFactory.js +107 -119
  6. package/dist/cjs/lib/astFactory.js.map +1 -0
  7. package/dist/cjs/lib/expressionHelpers.js +181 -191
  8. package/dist/cjs/lib/expressionHelpers.js.map +1 -0
  9. package/dist/cjs/lib/factoryMixins/ContextFactory.js +30 -52
  10. package/dist/cjs/lib/factoryMixins/ContextFactory.js.map +1 -0
  11. package/dist/cjs/lib/factoryMixins/ExpressionFactory.js +83 -102
  12. package/dist/cjs/lib/factoryMixins/ExpressionFactory.js.map +1 -0
  13. package/dist/cjs/lib/factoryMixins/GraphRefFactory.js +51 -73
  14. package/dist/cjs/lib/factoryMixins/GraphRefFactory.js.map +1 -0
  15. package/dist/cjs/lib/factoryMixins/PathFactory.js +68 -87
  16. package/dist/cjs/lib/factoryMixins/PathFactory.js.map +1 -0
  17. package/dist/cjs/lib/factoryMixins/Patternfactory.js +98 -120
  18. package/dist/cjs/lib/factoryMixins/Patternfactory.js.map +1 -0
  19. package/dist/cjs/lib/factoryMixins/QueryFactory.js +43 -65
  20. package/dist/cjs/lib/factoryMixins/QueryFactory.js.map +1 -0
  21. package/dist/cjs/lib/factoryMixins/SolutionModifiersFactory.js +55 -77
  22. package/dist/cjs/lib/factoryMixins/SolutionModifiersFactory.js.map +1 -0
  23. package/dist/cjs/lib/factoryMixins/TermFactory.js +81 -102
  24. package/dist/cjs/lib/factoryMixins/TermFactory.js.map +1 -0
  25. package/dist/cjs/lib/factoryMixins/UpdateOperationFactory.js +126 -147
  26. package/dist/cjs/lib/factoryMixins/UpdateOperationFactory.js.map +1 -0
  27. package/dist/cjs/lib/factoryMixins/mixins.js +21 -38
  28. package/dist/cjs/lib/factoryMixins/mixins.js.map +1 -0
  29. package/dist/cjs/lib/grammar/builtIn.js +277 -377
  30. package/dist/cjs/lib/grammar/builtIn.js.map +1 -0
  31. package/dist/cjs/lib/grammar/dataSetClause.js +110 -109
  32. package/dist/cjs/lib/grammar/dataSetClause.js.map +1 -0
  33. package/dist/cjs/lib/grammar/expression.js +387 -358
  34. package/dist/cjs/lib/grammar/expression.js.map +1 -0
  35. package/dist/cjs/lib/grammar/general.js +173 -158
  36. package/dist/cjs/lib/grammar/general.js.map +1 -0
  37. package/dist/cjs/lib/grammar/index.js +94 -111
  38. package/dist/cjs/lib/grammar/index.js.map +1 -0
  39. package/dist/cjs/lib/grammar/literals.js +282 -266
  40. package/dist/cjs/lib/grammar/literals.js.map +1 -0
  41. package/dist/cjs/lib/grammar/propertyPaths.js +206 -193
  42. package/dist/cjs/lib/grammar/propertyPaths.js.map +1 -0
  43. package/dist/cjs/lib/grammar/queryUnit.js +395 -372
  44. package/dist/cjs/lib/grammar/queryUnit.js.map +1 -0
  45. package/dist/cjs/lib/grammar/solutionModifier.js +281 -265
  46. package/dist/cjs/lib/grammar/solutionModifier.js.map +1 -0
  47. package/dist/cjs/lib/grammar/tripleBlock.js +390 -355
  48. package/dist/cjs/lib/grammar/tripleBlock.js.map +1 -0
  49. package/dist/cjs/lib/grammar/updateUnit.js +551 -519
  50. package/dist/cjs/lib/grammar/updateUnit.js.map +1 -0
  51. package/dist/cjs/lib/grammar/whereClause.js +486 -459
  52. package/dist/cjs/lib/grammar/whereClause.js.map +1 -0
  53. package/dist/cjs/lib/index.js +47 -54
  54. package/dist/cjs/lib/index.js.map +1 -0
  55. package/dist/cjs/lib/lexer/BuiltInCalls.js +188 -333
  56. package/dist/cjs/lib/lexer/BuiltInCalls.js.map +1 -0
  57. package/dist/cjs/lib/lexer/graph.js +10 -40
  58. package/dist/cjs/lib/lexer/graph.js.map +1 -0
  59. package/dist/cjs/lib/lexer/index.js +43 -48
  60. package/dist/cjs/lib/lexer/index.js.map +1 -0
  61. package/dist/cjs/lib/lexer/lexer.js +84 -195
  62. package/dist/cjs/lib/lexer/lexer.js.map +1 -0
  63. package/dist/cjs/lib/lexer/lexerPatterns.js +40 -132
  64. package/dist/cjs/lib/lexer/lexerPatterns.js.map +1 -0
  65. package/dist/cjs/lib/lexer/symbols.js +31 -106
  66. package/dist/cjs/lib/lexer/symbols.js.map +1 -0
  67. package/dist/cjs/lib/lexer/terminals.js +100 -102
  68. package/dist/cjs/lib/lexer/terminals.js.map +1 -0
  69. package/dist/cjs/lib/sparql11HelperTypes.js +2 -15
  70. package/dist/cjs/lib/sparql11HelperTypes.js.map +1 -0
  71. package/dist/cjs/lib/utils.js +40 -58
  72. package/dist/cjs/lib/utils.js.map +1 -0
  73. package/dist/cjs/lib/validation/validators.js +197 -186
  74. package/dist/cjs/lib/validation/validators.js.map +1 -0
  75. package/package.json +10 -10
@@ -1,123 +1,101 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
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 Patternfactory_exports = {};
20
- __export(Patternfactory_exports, {
21
- PatternFactoryMixin: () => PatternFactoryMixin
22
- });
23
- module.exports = __toCommonJS(Patternfactory_exports);
24
- const nodeType = "pattern";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PatternFactoryMixin = PatternFactoryMixin;
4
+ const nodeType = 'pattern';
5
+ // eslint-disable-next-line ts/explicit-function-return-type
25
6
  function PatternFactoryMixin(Base) {
26
- return class PatternFactory extends Base {
27
- isPattern(obj) {
28
- return this.isOfType(obj, nodeType);
29
- }
30
- patternBgp(triples, loc) {
31
- return { type: nodeType, subType: "bgp", triples, loc };
32
- }
33
- isPatternBgp(obj) {
34
- return this.isOfSubType(obj, nodeType, "bgp");
35
- }
36
- patternGroup(patterns, loc) {
37
- return { type: nodeType, subType: "group", patterns, loc };
38
- }
39
- isPatternGroup(obj) {
40
- return this.isOfSubType(obj, nodeType, "group");
41
- }
42
- patternGraph(name, patterns, loc) {
43
- return { type: nodeType, subType: "graph", name, patterns, loc };
44
- }
45
- isPatternGraph(obj) {
46
- return this.isOfSubType(obj, nodeType, "graph");
47
- }
48
- patternOptional(patterns, loc) {
49
- return { type: nodeType, subType: "optional", patterns, loc };
50
- }
51
- isPatternOptional(obj) {
52
- return this.isOfSubType(obj, nodeType, "optional");
53
- }
54
- patternValues(variables, values, loc) {
55
- return { type: nodeType, subType: "values", variables, values, loc };
56
- }
57
- isPatternValues(obj) {
58
- return this.isOfSubType(obj, nodeType, "values");
59
- }
60
- patternFilter(expression, loc) {
61
- return {
62
- type: nodeType,
63
- subType: "filter",
64
- expression,
65
- loc
66
- };
67
- }
68
- isPatternFilter(obj) {
69
- return this.isOfSubType(obj, nodeType, "filter");
70
- }
71
- patternBind(expression, variable, loc) {
72
- return {
73
- type: nodeType,
74
- subType: "bind",
75
- expression,
76
- variable,
77
- loc
78
- };
79
- }
80
- isPatternBind(obj) {
81
- return this.isOfSubType(obj, nodeType, "bind");
82
- }
83
- patternUnion(patterns, loc) {
84
- return {
85
- type: nodeType,
86
- subType: "union",
87
- patterns,
88
- loc
89
- };
90
- }
91
- isPatternUnion(obj) {
92
- return this.isOfSubType(obj, nodeType, "union");
93
- }
94
- patternMinus(patterns, loc) {
95
- return {
96
- type: nodeType,
97
- subType: "minus",
98
- patterns,
99
- loc
100
- };
101
- }
102
- isPatternMinus(obj) {
103
- return this.isOfSubType(obj, nodeType, "minus");
104
- }
105
- patternService(name, patterns, silent, loc) {
106
- return {
107
- type: nodeType,
108
- subType: "service",
109
- silent,
110
- name,
111
- patterns,
112
- loc
113
- };
114
- }
115
- isPatternService(obj) {
116
- return this.isOfSubType(obj, nodeType, "service");
117
- }
118
- };
7
+ return class PatternFactory extends Base {
8
+ isPattern(obj) {
9
+ return this.isOfType(obj, nodeType);
10
+ }
11
+ patternBgp(triples, loc) {
12
+ return { type: nodeType, subType: 'bgp', triples, loc };
13
+ }
14
+ isPatternBgp(obj) {
15
+ return this.isOfSubType(obj, nodeType, 'bgp');
16
+ }
17
+ patternGroup(patterns, loc) {
18
+ return { type: nodeType, subType: 'group', patterns, loc };
19
+ }
20
+ isPatternGroup(obj) {
21
+ return this.isOfSubType(obj, nodeType, 'group');
22
+ }
23
+ patternGraph(name, patterns, loc) {
24
+ return { type: nodeType, subType: 'graph', name, patterns, loc };
25
+ }
26
+ isPatternGraph(obj) {
27
+ return this.isOfSubType(obj, nodeType, 'graph');
28
+ }
29
+ patternOptional(patterns, loc) {
30
+ return { type: nodeType, subType: 'optional', patterns, loc };
31
+ }
32
+ isPatternOptional(obj) {
33
+ return this.isOfSubType(obj, nodeType, 'optional');
34
+ }
35
+ patternValues(variables, values, loc) {
36
+ return { type: nodeType, subType: 'values', variables, values, loc };
37
+ }
38
+ isPatternValues(obj) {
39
+ return this.isOfSubType(obj, nodeType, 'values');
40
+ }
41
+ patternFilter(expression, loc) {
42
+ return {
43
+ type: nodeType,
44
+ subType: 'filter',
45
+ expression,
46
+ loc,
47
+ };
48
+ }
49
+ isPatternFilter(obj) {
50
+ return this.isOfSubType(obj, nodeType, 'filter');
51
+ }
52
+ patternBind(expression, variable, loc) {
53
+ return {
54
+ type: nodeType,
55
+ subType: 'bind',
56
+ expression,
57
+ variable,
58
+ loc,
59
+ };
60
+ }
61
+ isPatternBind(obj) {
62
+ return this.isOfSubType(obj, nodeType, 'bind');
63
+ }
64
+ patternUnion(patterns, loc) {
65
+ return {
66
+ type: nodeType,
67
+ subType: 'union',
68
+ patterns,
69
+ loc,
70
+ };
71
+ }
72
+ isPatternUnion(obj) {
73
+ return this.isOfSubType(obj, nodeType, 'union');
74
+ }
75
+ patternMinus(patterns, loc) {
76
+ return {
77
+ type: nodeType,
78
+ subType: 'minus',
79
+ patterns,
80
+ loc,
81
+ };
82
+ }
83
+ isPatternMinus(obj) {
84
+ return this.isOfSubType(obj, nodeType, 'minus');
85
+ }
86
+ patternService(name, patterns, silent, loc) {
87
+ return {
88
+ type: nodeType,
89
+ subType: 'service',
90
+ silent,
91
+ name,
92
+ patterns,
93
+ loc,
94
+ };
95
+ }
96
+ isPatternService(obj) {
97
+ return this.isOfSubType(obj, nodeType, 'service');
98
+ }
99
+ };
119
100
  }
120
- // Annotate the CommonJS export names for ESM import in node:
121
- 0 && (module.exports = {
122
- PatternFactoryMixin
123
- });
101
+ //# sourceMappingURL=Patternfactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Patternfactory.js","sourceRoot":"","sources":["../../../../lib/factoryMixins/Patternfactory.ts"],"names":[],"mappings":";;AAyBA,kDA2HC;AA9HD,MAAM,QAAQ,GAAa,SAAS,CAAC;AAErC,4DAA4D;AAC5D,SAAgB,mBAAmB,CAA4C,IAAW;IACxF,OAAO,MAAM,cAAe,SAAQ,IAAI;QAC/B,SAAS,CAAC,GAAW;YAC1B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;QAEM,UAAU,CAAC,OAA0B,EAAE,GAAmB;YAC/D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;QAC1D,CAAC;QAEM,YAAY,C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N,IAAI;gBACJ,QAAQ;gBACR,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,gBAAgB,CAAC,GAAW;YACjC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AstCoreFactory, SourceLocation, Typed, SubTyped } from '@traqula/core';\nimport type {\n BasicGraphPattern,\n Expression,\n Pattern,\n PatternBgp,\n PatternBind,\n PatternFilter,\n PatternGraph,\n PatternGroup,\n PatternMinus,\n PatternOptional,\n PatternService,\n PatternUnion,\n PatternValues,\n TermIri,\n TermVariable,\n ValuePatternRow,\n} from '../Sparql11types.js';\nimport type { Constructor } from './mixins.js';\n\ntype NodeType = 'pattern';\nconst nodeType: NodeType = 'pattern';\n\n// eslint-disable-next-line ts/explicit-function-return-type\nexport function PatternFactoryMixin<TBase extends Constructor<AstCoreFactory>>(Base: TBase) {\n return class PatternFactory extends Base {\n public isPattern(obj: object): obj is Typed<NodeType> {\n return this.isOfType(obj, nodeType);\n }\n\n public patternBgp(triples: BasicGraphPattern, loc: SourceLocation): PatternBgp {\n return { type: nodeType, subType: 'bgp', triples, loc };\n }\n\n public isPatternBgp(obj: object): obj is SubTyped<NodeType, 'bgp'> {\n return this.isOfSubType(obj, nodeType, 'bgp');\n }\n\n public patternGroup(patterns: Pattern[], loc: SourceLocation): PatternGroup {\n return { type: nodeType, subType: 'group', patterns, loc };\n }\n\n public isPatternGroup(obj: object): obj is SubTyped<NodeType, 'group'> {\n return this.isOfSubType(obj, nodeType, 'group');\n }\n\n public patternGraph(name: TermIri | TermVariable, patterns: Pattern[], loc: SourceLocation): PatternGraph {\n return { type: nodeType, subType: 'graph', name, patterns, loc };\n }\n\n public isPatternGraph(obj: object): obj is SubTyped<NodeType, 'graph'> {\n return this.isOfSubType(obj, nodeType, 'graph');\n }\n\n public patternOptional(patterns: Pattern[], loc: SourceLocation): PatternOptional {\n return { type: nodeType, subType: 'optional', patterns, loc };\n }\n\n public isPatternOptional(obj: object): obj is SubTyped<NodeType, 'optional'> {\n return this.isOfSubType(obj, nodeType, 'optional');\n }\n\n public patternValues(variables: TermVariable[], values: ValuePatternRow[], loc: SourceLocation): PatternValues {\n return { type: nodeType, subType: 'values', variables, values, loc };\n }\n\n public isPatternValues(obj: object): obj is SubTyped<NodeType, 'values'> {\n return this.isOfSubType(obj, nodeType, 'values');\n }\n\n public patternFilter(expression: Expression, loc: SourceLocation): PatternFilter {\n return {\n type: nodeType,\n subType: 'filter',\n expression,\n loc,\n };\n }\n\n public isPatternFilter(obj: object): obj is SubTyped<NodeType, 'filter'> {\n return this.isOfSubType(obj, nodeType, 'filter');\n }\n\n public patternBind(\n expression: Expression,\n variable: TermVariable,\n loc: SourceLocation,\n ): PatternBind {\n return {\n type: nodeType,\n subType: 'bind',\n expression,\n variable,\n loc,\n };\n }\n\n public isPatternBind(obj: object): obj is SubTyped<NodeType, 'bind'> {\n return this.isOfSubType(obj, nodeType, 'bind');\n }\n\n public patternUnion(patterns: PatternGroup[], loc: SourceLocation): PatternUnion {\n return {\n type: nodeType,\n subType: 'union',\n patterns,\n loc,\n };\n }\n\n public isPatternUnion(obj: object): obj is SubTyped<NodeType, 'union'> {\n return this.isOfSubType(obj, nodeType, 'union');\n }\n\n public patternMinus(patterns: Pattern[], loc: SourceLocation): PatternMinus {\n return {\n type: nodeType,\n subType: 'minus',\n patterns,\n loc,\n };\n }\n\n public isPatternMinus(obj: object): obj is SubTyped<NodeType, 'minus'> {\n return this.isOfSubType(obj, nodeType, 'minus');\n }\n\n public patternService(\n name: TermIri | TermVariable,\n patterns: Pattern[],\n silent: boolean,\n loc: SourceLocation,\n ): PatternService {\n return {\n type: nodeType,\n subType: 'service',\n silent,\n name,\n patterns,\n loc,\n };\n }\n\n public isPatternService(obj: object): obj is SubTyped<NodeType, 'service'> {\n return this.isOfSubType(obj, nodeType, 'service');\n }\n };\n}\n"]}
@@ -1,68 +1,46 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
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 QueryFactory_exports = {};
20
- __export(QueryFactory_exports, {
21
- QueryFactoryMixin: () => QueryFactoryMixin
22
- });
23
- module.exports = __toCommonJS(QueryFactory_exports);
24
- const nodeType = "query";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QueryFactoryMixin = QueryFactoryMixin;
4
+ const nodeType = 'query';
5
+ // eslint-disable-next-line ts/explicit-function-return-type
25
6
  function QueryFactoryMixin(Base) {
26
- return class QueryFactory extends Base {
27
- isQuery(obj) {
28
- return this.isOfType(obj, nodeType);
29
- }
30
- isQuerySelect(obj) {
31
- return this.isOfSubType(obj, nodeType, "select");
32
- }
33
- queryConstruct(loc, context, template, where, solutionModifiers, datasets, values) {
34
- return {
35
- type: "query",
36
- subType: "construct",
37
- context,
38
- template,
39
- where,
40
- solutionModifiers,
41
- datasets,
42
- values,
43
- loc
44
- };
45
- }
46
- isQueryConstruct(obj) {
47
- return this.isOfSubType(obj, nodeType, "construct");
48
- }
49
- isQueryDescribe(obj) {
50
- return this.isOfSubType(obj, nodeType, "describe");
51
- }
52
- isQueryAsk(obj) {
53
- return this.isOfSubType(obj, nodeType, "ask");
54
- }
55
- querySelect(arg, loc) {
56
- return {
57
- type: nodeType,
58
- subType: "select",
59
- ...arg,
60
- loc
61
- };
62
- }
63
- };
7
+ return class QueryFactory extends Base {
8
+ isQuery(obj) {
9
+ return this.isOfType(obj, nodeType);
10
+ }
11
+ isQuerySelect(obj) {
12
+ return this.isOfSubType(obj, nodeType, 'select');
13
+ }
14
+ queryConstruct(loc, context, template, where, solutionModifiers, datasets, values) {
15
+ return {
16
+ type: 'query',
17
+ subType: 'construct',
18
+ context,
19
+ template,
20
+ where,
21
+ solutionModifiers,
22
+ datasets,
23
+ values,
24
+ loc,
25
+ };
26
+ }
27
+ isQueryConstruct(obj) {
28
+ return this.isOfSubType(obj, nodeType, 'construct');
29
+ }
30
+ isQueryDescribe(obj) {
31
+ return this.isOfSubType(obj, nodeType, 'describe');
32
+ }
33
+ isQueryAsk(obj) {
34
+ return this.isOfSubType(obj, nodeType, 'ask');
35
+ }
36
+ querySelect(arg, loc) {
37
+ return {
38
+ type: nodeType,
39
+ subType: 'select',
40
+ ...arg,
41
+ loc,
42
+ };
43
+ }
44
+ };
64
45
  }
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
67
- QueryFactoryMixin
68
- });
46
+ //# sourceMappingURL=QueryFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"QueryFactory.js","sourceRoot":"","sources":["../../../../lib/factoryMixins/QueryFactory.ts"],"names":[],"mappings":";;AAiBA,8CAqDC;AAxDD,MAAM,QAAQ,GAAa,OAAO,CAAC;AAEnC,4DAA4D;AAC5D,SAAgB,iBAAiB,CAA4C,IAAW;IACtF,OAAO,MAAM,YAAa,SAAQ,IAAI;QAC7B,OAAO,CAAC,GAAW;YACxB,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;QAEM,aAAa,CAAC,GAAW;YAC9B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC;QAEM,cAAc,CACnB,GAAmB,EACnB,OAA4B,EAC5B,QAAoB,EACpB,KAAmB,EACnB,iBAAoC,EACpC,QAAwB,EACxB,MAAsB;YAEtB,OAAO;gBACL,IAAI,EAAE,OAAO;gBACb,OAAO,EAAE,WAAW;gBACpB,OAAO;gBACP,QAAQ;gBACR,KAAK;gBACL,iBAAiB;gBACjB,QAAQ;gBACR,MAAM;gBACN,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,gBAAgB,CAAC,GAAW;YACjC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;QACtD,CAAC;QAEM,eAAe,CAAC,GAAW;YAChC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;QACrD,CAAC;QAEM,UAAU,CAAC,GAAW;YAC3B,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;QAChD,CAAC;QAEM,WAAW,CAAC,GAAkD,EAAE,GAAmB;YACxF,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;gBACjB,GAAG,GAAG;gBACN,GAAG;aACJ,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AstCoreFactory, SourceLocation, Typed, SubTyped } from '@traqula/core';\nimport type {\n ContextDefinition,\n DatasetClauses,\n PatternBgp,\n PatternGroup,\n PatternValues,\n QueryConstruct,\n QuerySelect,\n SolutionModifiers,\n} from '../Sparql11types.js';\nimport type { Constructor } from './mixins.js';\n\ntype NodeType = 'query';\nconst nodeType: NodeType = 'query';\n\n// eslint-disable-next-line ts/explicit-function-return-type\nexport function QueryFactoryMixin<TBase extends Constructor<AstCoreFactory>>(Base: TBase) {\n return class QueryFactory extends Base {\n public isQuery(obj: object): obj is Typed<NodeType> {\n return this.isOfType(obj, nodeType);\n }\n\n public isQuerySelect(obj: object): obj is SubTyped<NodeType, 'select'> {\n return this.isOfSubType(obj, nodeType, 'select');\n }\n\n public queryConstruct(\n loc: SourceLocation,\n context: ContextDefinition[],\n template: PatternBgp,\n where: PatternGroup,\n solutionModifiers: SolutionModifiers,\n datasets: DatasetClauses,\n values?: PatternValues,\n ): QueryConstruct {\n return {\n type: 'query',\n subType: 'construct',\n context,\n template,\n where,\n solutionModifiers,\n datasets,\n values,\n loc,\n };\n }\n\n public isQueryConstruct(obj: object): obj is SubTyped<NodeType, 'construct'> {\n return this.isOfSubType(obj, nodeType, 'construct');\n }\n\n public isQueryDescribe(obj: object): obj is SubTyped<NodeType, 'describe'> {\n return this.isOfSubType(obj, nodeType, 'describe');\n }\n\n public isQueryAsk(obj: object): obj is SubTyped<NodeType, 'ask'> {\n return this.isOfSubType(obj, nodeType, 'ask');\n }\n\n public querySelect(arg: Omit<QuerySelect, 'type' | 'subType' | 'loc'>, loc: SourceLocation): QuerySelect {\n return {\n type: nodeType,\n subType: 'select',\n ...arg,\n loc,\n };\n }\n };\n}\n"]}
@@ -1,80 +1,58 @@
1
1
  "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
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 SolutionModifiersFactory_exports = {};
20
- __export(SolutionModifiersFactory_exports, {
21
- SolutionModifiersFactoryMixin: () => SolutionModifiersFactoryMixin
22
- });
23
- module.exports = __toCommonJS(SolutionModifiersFactory_exports);
24
- const nodeType = "solutionModifier";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SolutionModifiersFactoryMixin = SolutionModifiersFactoryMixin;
4
+ const nodeType = 'solutionModifier';
5
+ // eslint-disable-next-line ts/explicit-function-return-type
25
6
  function SolutionModifiersFactoryMixin(Base) {
26
- return class SolutionModifiersFactory extends Base {
27
- isSolutionModifier(obj) {
28
- return this.isOfType(obj, nodeType);
29
- }
30
- solutionModifierHaving(having, loc) {
31
- return {
32
- type: nodeType,
33
- subType: "having",
34
- having,
35
- loc
36
- };
37
- }
38
- isSolutionModifierHaving(obj) {
39
- return this.isOfSubType(obj, nodeType, "having");
40
- }
41
- solutionModifierOrder(orderDefs, loc) {
42
- return {
43
- type: nodeType,
44
- subType: "order",
45
- orderDefs,
46
- loc
47
- };
48
- }
49
- isSolutionModifierOrder(obj) {
50
- return this.isOfSubType(obj, nodeType, "order");
51
- }
52
- solutionModifierLimitOffset(limit, offset, loc) {
53
- return {
54
- type: nodeType,
55
- subType: "limitOffset",
56
- limit,
57
- offset,
58
- loc
59
- };
60
- }
61
- isSolutionModifierLimitOffset(obj) {
62
- return this.isOfSubType(obj, nodeType, "limitOffset");
63
- }
64
- solutionModifierGroup(groupings, loc) {
65
- return {
66
- type: "solutionModifier",
67
- subType: "group",
68
- groupings,
69
- loc
70
- };
71
- }
72
- isSolutionModifierGroup(obj) {
73
- return this.isOfSubType(obj, nodeType, "group");
74
- }
75
- };
7
+ return class SolutionModifiersFactory extends Base {
8
+ isSolutionModifier(obj) {
9
+ return this.isOfType(obj, nodeType);
10
+ }
11
+ solutionModifierHaving(having, loc) {
12
+ return {
13
+ type: nodeType,
14
+ subType: 'having',
15
+ having,
16
+ loc,
17
+ };
18
+ }
19
+ isSolutionModifierHaving(obj) {
20
+ return this.isOfSubType(obj, nodeType, 'having');
21
+ }
22
+ solutionModifierOrder(orderDefs, loc) {
23
+ return {
24
+ type: nodeType,
25
+ subType: 'order',
26
+ orderDefs,
27
+ loc,
28
+ };
29
+ }
30
+ isSolutionModifierOrder(obj) {
31
+ return this.isOfSubType(obj, nodeType, 'order');
32
+ }
33
+ solutionModifierLimitOffset(limit, offset, loc) {
34
+ return {
35
+ type: nodeType,
36
+ subType: 'limitOffset',
37
+ limit,
38
+ offset,
39
+ loc,
40
+ };
41
+ }
42
+ isSolutionModifierLimitOffset(obj) {
43
+ return this.isOfSubType(obj, nodeType, 'limitOffset');
44
+ }
45
+ solutionModifierGroup(groupings, loc) {
46
+ return {
47
+ type: 'solutionModifier',
48
+ subType: 'group',
49
+ groupings,
50
+ loc,
51
+ };
52
+ }
53
+ isSolutionModifierGroup(obj) {
54
+ return this.isOfSubType(obj, nodeType, 'group');
55
+ }
56
+ };
76
57
  }
77
- // Annotate the CommonJS export names for ESM import in node:
78
- 0 && (module.exports = {
79
- SolutionModifiersFactoryMixin
80
- });
58
+ //# sourceMappingURL=SolutionModifiersFactory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolutionModifiersFactory.js","sourceRoot":"","sources":["../../../../lib/factoryMixins/SolutionModifiersFactory.ts"],"names":[],"mappings":";;AAgBA,sEAgEC;AAnED,MAAM,QAAQ,GAAa,kBAAkB,CAAC;AAE9C,4DAA4D;AAC5D,SAAgB,6BAA6B,CAA4C,IAAW;IAClG,OAAO,MAAM,wBAAyB,SAAQ,IAAI;QACzC,kBAAkB,CAAC,GAAW;YACnC,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;QAEM,sBAAsB,CAAC,MAAoB,EAAE,GAAmB;YACrE,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,QAAQ;gBACjB,MAAM;gBACN,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,wBAAwB,CAAC,GAAW;YACzC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACnD,CAAC;QAEM,qBAAqB,CAAC,SAAqB,EAAE,GAAmB;YACrE,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,OAAO;gBAChB,SAAS;gBACT,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,uBAAuB,CAAC,GAAW;YACxC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;QAEM,2BAA2B,CAChC,KAAyB,EACzB,MAA0B,EAC1B,GAAmB;YAEnB,OAAO;gBACL,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,aAAa;gBACtB,KAAK;gBACL,MAAM;gBACN,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,6BAA6B,CAAC,GAAW;YAC9C,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QACxD,CAAC;QAEM,qBAAqB,CAAC,SAAqD,EAAE,GAAmB;YAErG,OAAO;gBACL,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,OAAO;gBAChB,SAAS;gBACT,GAAG;aACJ,CAAC;QACJ,CAAC;QAEM,uBAAuB,CAAC,GAAW;YACxC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type { AstCoreFactory, SourceLocation, Typed, SubTyped } from '@traqula/core';\nimport type {\n Expression,\n Ordering,\n SolutionModifierGroup,\n SolutionModifierGroupBind,\n SolutionModifierHaving,\n SolutionModifierLimitOffset,\n SolutionModifierOrder,\n} from '../Sparql11types.js';\nimport type { Constructor } from './mixins.js';\n\ntype NodeType = 'solutionModifier';\nconst nodeType: NodeType = 'solutionModifier';\n\n// eslint-disable-next-line ts/explicit-function-return-type\nexport function SolutionModifiersFactoryMixin<TBase extends Constructor<AstCoreFactory>>(Base: TBase) {\n return class SolutionModifiersFactory extends Base {\n public isSolutionModifier(obj: object): obj is Typed<NodeType> {\n return this.isOfType(obj, nodeType);\n }\n\n public solutionModifierHaving(having: Expression[], loc: SourceLocation): SolutionModifierHaving {\n return {\n type: nodeType,\n subType: 'having',\n having,\n loc,\n };\n }\n\n public isSolutionModifierHaving(obj: object): obj is SubTyped<NodeType, 'having'> {\n return this.isOfSubType(obj, nodeType, 'having');\n }\n\n public solutionModifierOrder(orderDefs: Ordering[], loc: SourceLocation): SolutionModifierOrder {\n return {\n type: nodeType,\n subType: 'order',\n orderDefs,\n loc,\n };\n }\n\n public isSolutionModifierOrder(obj: object): obj is SubTyped<NodeType, 'order'> {\n return this.isOfSubType(obj, nodeType, 'order');\n }\n\n public solutionModifierLimitOffset(\n limit: number | undefined,\n offset: number | undefined,\n loc: SourceLocation,\n ): SolutionModifierLimitOffset {\n return {\n type: nodeType,\n subType: 'limitOffset',\n limit,\n offset,\n loc,\n };\n }\n\n public isSolutionModifierLimitOffset(obj: object): obj is SubTyped<NodeType, 'limitOffset'> {\n return this.isOfSubType(obj, nodeType, 'limitOffset');\n }\n\n public solutionModifierGroup(groupings: (Expression | SolutionModifierGroupBind)[], loc: SourceLocation):\n SolutionModifierGroup {\n return {\n type: 'solutionModifier',\n subType: 'group',\n groupings,\n loc,\n };\n }\n\n public isSolutionModifierGroup(obj: object): obj is SubTyped<NodeType, 'group'> {\n return this.isOfSubType(obj, nodeType, 'group');\n }\n };\n}\n"]}