@traqula/rules-sparql-1-1 0.0.21 → 0.0.23

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 (188) hide show
  1. package/dist/cjs/lib/MinimalSparqlParser.js +64 -0
  2. package/dist/cjs/lib/Sparql11types.js +16 -0
  3. package/dist/cjs/lib/astFactory.js +121 -0
  4. package/dist/cjs/lib/expressionHelpers.js +215 -0
  5. package/dist/cjs/lib/factoryMixins/ContextFactory.js +55 -0
  6. package/dist/cjs/lib/factoryMixins/ExpressionFactory.js +105 -0
  7. package/dist/cjs/lib/factoryMixins/GraphRefFactory.js +76 -0
  8. package/dist/cjs/lib/factoryMixins/PathFactory.js +90 -0
  9. package/dist/cjs/lib/factoryMixins/Patternfactory.js +123 -0
  10. package/dist/cjs/lib/factoryMixins/QueryFactory.js +68 -0
  11. package/dist/cjs/lib/factoryMixins/SolutionModifiersFactory.js +80 -0
  12. package/dist/cjs/lib/factoryMixins/TermFactory.js +105 -0
  13. package/dist/cjs/lib/factoryMixins/UpdateOperationFactory.js +150 -0
  14. package/dist/cjs/lib/factoryMixins/mixins.js +43 -0
  15. package/dist/cjs/lib/grammar/builtIn.js +385 -0
  16. package/dist/cjs/lib/grammar/dataSetClause.js +118 -0
  17. package/dist/cjs/lib/grammar/expression.js +384 -0
  18. package/dist/cjs/lib/grammar/general.js +168 -0
  19. package/dist/cjs/lib/grammar/index.js +115 -0
  20. package/dist/cjs/lib/grammar/literals.js +282 -0
  21. package/dist/cjs/lib/grammar/propertyPaths.js +206 -0
  22. package/dist/cjs/lib/grammar/queryUnit.js +390 -0
  23. package/dist/cjs/lib/grammar/solutionModifier.js +280 -0
  24. package/dist/cjs/lib/grammar/tripleBlock.js +384 -0
  25. package/dist/cjs/lib/grammar/updateUnit.js +546 -0
  26. package/dist/cjs/lib/grammar/whereClause.js +483 -0
  27. package/dist/cjs/lib/index.js +56 -0
  28. package/dist/cjs/lib/lexer/BuiltInCalls.js +337 -0
  29. package/dist/cjs/lib/lexer/graph.js +41 -0
  30. package/dist/cjs/lib/lexer/index.js +50 -0
  31. package/dist/cjs/lib/lexer/lexer.js +199 -0
  32. package/dist/cjs/lib/lexer/lexerPatterns.js +133 -0
  33. package/dist/cjs/lib/lexer/symbols.js +107 -0
  34. package/dist/cjs/lib/lexer/terminals.js +103 -0
  35. package/dist/cjs/lib/sparql11HelperTypes.js +16 -0
  36. package/dist/cjs/lib/utils.js +64 -0
  37. package/dist/cjs/lib/validation/validators.js +214 -0
  38. package/dist/cjs/package.json +1 -0
  39. package/dist/esm/lib/MinimalSparqlParser.js.map +1 -0
  40. package/dist/esm/lib/Sparql11types.js.map +1 -0
  41. package/dist/esm/lib/astFactory.js.map +1 -0
  42. package/{lib → dist/esm/lib}/expressionHelpers.d.ts +1 -1
  43. package/dist/esm/lib/expressionHelpers.js.map +1 -0
  44. package/dist/esm/lib/factoryMixins/ContextFactory.js.map +1 -0
  45. package/dist/esm/lib/factoryMixins/ExpressionFactory.js.map +1 -0
  46. package/dist/esm/lib/factoryMixins/GraphRefFactory.js.map +1 -0
  47. package/dist/esm/lib/factoryMixins/PathFactory.js.map +1 -0
  48. package/dist/esm/lib/factoryMixins/Patternfactory.js.map +1 -0
  49. package/dist/esm/lib/factoryMixins/QueryFactory.js.map +1 -0
  50. package/dist/esm/lib/factoryMixins/SolutionModifiersFactory.js.map +1 -0
  51. package/dist/esm/lib/factoryMixins/TermFactory.js.map +1 -0
  52. package/dist/esm/lib/factoryMixins/UpdateOperationFactory.js.map +1 -0
  53. package/dist/esm/lib/factoryMixins/mixins.js.map +1 -0
  54. package/{lib → dist/esm/lib}/grammar/builtIn.d.ts +1 -1
  55. package/dist/esm/lib/grammar/builtIn.js.map +1 -0
  56. package/{lib → dist/esm/lib}/grammar/dataSetClause.d.ts +1 -1
  57. package/dist/esm/lib/grammar/dataSetClause.js.map +1 -0
  58. package/dist/esm/lib/grammar/expression.js.map +1 -0
  59. package/dist/esm/lib/grammar/general.js.map +1 -0
  60. package/dist/esm/lib/grammar/index.js.map +1 -0
  61. package/dist/esm/lib/grammar/literals.js.map +1 -0
  62. package/{lib → dist/esm/lib}/grammar/propertyPaths.d.ts +3 -3
  63. package/dist/esm/lib/grammar/propertyPaths.js.map +1 -0
  64. package/dist/esm/lib/grammar/queryUnit.js.map +1 -0
  65. package/dist/esm/lib/grammar/solutionModifier.js.map +1 -0
  66. package/{lib → dist/esm/lib}/grammar/tripleBlock.d.ts +4 -4
  67. package/dist/esm/lib/grammar/tripleBlock.js.map +1 -0
  68. package/dist/esm/lib/grammar/updateUnit.js.map +1 -0
  69. package/dist/esm/lib/grammar/whereClause.js.map +1 -0
  70. package/dist/esm/lib/index.js.map +1 -0
  71. package/{lib → dist/esm/lib}/lexer/BuiltInCalls.d.ts +1 -1
  72. package/dist/esm/lib/lexer/BuiltInCalls.js.map +1 -0
  73. package/{lib → dist/esm/lib}/lexer/graph.d.ts +1 -1
  74. package/dist/esm/lib/lexer/graph.js.map +1 -0
  75. package/dist/esm/lib/lexer/index.js.map +1 -0
  76. package/{lib → dist/esm/lib}/lexer/lexer.d.ts +2 -2
  77. package/dist/esm/lib/lexer/lexer.js.map +1 -0
  78. package/dist/esm/lib/lexer/lexerPatterns.js.map +1 -0
  79. package/{lib → dist/esm/lib}/lexer/symbols.d.ts +1 -1
  80. package/dist/esm/lib/lexer/symbols.js.map +1 -0
  81. package/{lib → dist/esm/lib}/lexer/terminals.d.ts +1 -1
  82. package/{lib → dist/esm/lib}/lexer/terminals.js +1 -1
  83. package/dist/esm/lib/lexer/terminals.js.map +1 -0
  84. package/dist/esm/lib/sparql11HelperTypes.js.map +1 -0
  85. package/dist/esm/lib/utils.js.map +1 -0
  86. package/dist/esm/lib/validation/validators.js.map +1 -0
  87. package/package.json +14 -18
  88. package/lib/MinimalSparqlParser.js.map +0 -1
  89. package/lib/Sparql11types.js.map +0 -1
  90. package/lib/astFactory.js.map +0 -1
  91. package/lib/expressionHelpers.js.map +0 -1
  92. package/lib/factoryMixins/ContextFactory.js.map +0 -1
  93. package/lib/factoryMixins/ExpressionFactory.js.map +0 -1
  94. package/lib/factoryMixins/GraphRefFactory.js.map +0 -1
  95. package/lib/factoryMixins/PathFactory.js.map +0 -1
  96. package/lib/factoryMixins/Patternfactory.js.map +0 -1
  97. package/lib/factoryMixins/QueryFactory.js.map +0 -1
  98. package/lib/factoryMixins/SolutionModifiersFactory.js.map +0 -1
  99. package/lib/factoryMixins/TermFactory.js.map +0 -1
  100. package/lib/factoryMixins/UpdateOperationFactory.js.map +0 -1
  101. package/lib/factoryMixins/mixins.js.map +0 -1
  102. package/lib/grammar/builtIn.js.map +0 -1
  103. package/lib/grammar/dataSetClause.js.map +0 -1
  104. package/lib/grammar/expression.js.map +0 -1
  105. package/lib/grammar/general.js.map +0 -1
  106. package/lib/grammar/index.js.map +0 -1
  107. package/lib/grammar/literals.js.map +0 -1
  108. package/lib/grammar/propertyPaths.js.map +0 -1
  109. package/lib/grammar/queryUnit.js.map +0 -1
  110. package/lib/grammar/solutionModifier.js.map +0 -1
  111. package/lib/grammar/tripleBlock.js.map +0 -1
  112. package/lib/grammar/updateUnit.js.map +0 -1
  113. package/lib/grammar/whereClause.js.map +0 -1
  114. package/lib/index.cjs +0 -14673
  115. package/lib/index.js.map +0 -1
  116. package/lib/lexer/BuiltInCalls.js.map +0 -1
  117. package/lib/lexer/graph.js.map +0 -1
  118. package/lib/lexer/index.js.map +0 -1
  119. package/lib/lexer/lexer.js.map +0 -1
  120. package/lib/lexer/lexerPatterns.js.map +0 -1
  121. package/lib/lexer/symbols.js.map +0 -1
  122. package/lib/lexer/terminals.js.map +0 -1
  123. package/lib/sparql11HelperTypes.js.map +0 -1
  124. package/lib/utils.js.map +0 -1
  125. package/lib/validation/validators.js.map +0 -1
  126. /package/{lib → dist/esm/lib}/MinimalSparqlParser.d.ts +0 -0
  127. /package/{lib → dist/esm/lib}/MinimalSparqlParser.js +0 -0
  128. /package/{lib → dist/esm/lib}/Sparql11types.d.ts +0 -0
  129. /package/{lib → dist/esm/lib}/Sparql11types.js +0 -0
  130. /package/{lib → dist/esm/lib}/astFactory.d.ts +0 -0
  131. /package/{lib → dist/esm/lib}/astFactory.js +0 -0
  132. /package/{lib → dist/esm/lib}/expressionHelpers.js +0 -0
  133. /package/{lib → dist/esm/lib}/factoryMixins/ContextFactory.d.ts +0 -0
  134. /package/{lib → dist/esm/lib}/factoryMixins/ContextFactory.js +0 -0
  135. /package/{lib → dist/esm/lib}/factoryMixins/ExpressionFactory.d.ts +0 -0
  136. /package/{lib → dist/esm/lib}/factoryMixins/ExpressionFactory.js +0 -0
  137. /package/{lib → dist/esm/lib}/factoryMixins/GraphRefFactory.d.ts +0 -0
  138. /package/{lib → dist/esm/lib}/factoryMixins/GraphRefFactory.js +0 -0
  139. /package/{lib → dist/esm/lib}/factoryMixins/PathFactory.d.ts +0 -0
  140. /package/{lib → dist/esm/lib}/factoryMixins/PathFactory.js +0 -0
  141. /package/{lib → dist/esm/lib}/factoryMixins/Patternfactory.d.ts +0 -0
  142. /package/{lib → dist/esm/lib}/factoryMixins/Patternfactory.js +0 -0
  143. /package/{lib → dist/esm/lib}/factoryMixins/QueryFactory.d.ts +0 -0
  144. /package/{lib → dist/esm/lib}/factoryMixins/QueryFactory.js +0 -0
  145. /package/{lib → dist/esm/lib}/factoryMixins/SolutionModifiersFactory.d.ts +0 -0
  146. /package/{lib → dist/esm/lib}/factoryMixins/SolutionModifiersFactory.js +0 -0
  147. /package/{lib → dist/esm/lib}/factoryMixins/TermFactory.d.ts +0 -0
  148. /package/{lib → dist/esm/lib}/factoryMixins/TermFactory.js +0 -0
  149. /package/{lib → dist/esm/lib}/factoryMixins/UpdateOperationFactory.d.ts +0 -0
  150. /package/{lib → dist/esm/lib}/factoryMixins/UpdateOperationFactory.js +0 -0
  151. /package/{lib → dist/esm/lib}/factoryMixins/mixins.d.ts +0 -0
  152. /package/{lib → dist/esm/lib}/factoryMixins/mixins.js +0 -0
  153. /package/{lib → dist/esm/lib}/grammar/builtIn.js +0 -0
  154. /package/{lib → dist/esm/lib}/grammar/dataSetClause.js +0 -0
  155. /package/{lib → dist/esm/lib}/grammar/expression.d.ts +0 -0
  156. /package/{lib → dist/esm/lib}/grammar/expression.js +0 -0
  157. /package/{lib → dist/esm/lib}/grammar/general.d.ts +0 -0
  158. /package/{lib → dist/esm/lib}/grammar/general.js +0 -0
  159. /package/{lib → dist/esm/lib}/grammar/index.d.ts +0 -0
  160. /package/{lib → dist/esm/lib}/grammar/index.js +0 -0
  161. /package/{lib → dist/esm/lib}/grammar/literals.d.ts +0 -0
  162. /package/{lib → dist/esm/lib}/grammar/literals.js +0 -0
  163. /package/{lib → dist/esm/lib}/grammar/propertyPaths.js +0 -0
  164. /package/{lib → dist/esm/lib}/grammar/queryUnit.d.ts +0 -0
  165. /package/{lib → dist/esm/lib}/grammar/queryUnit.js +0 -0
  166. /package/{lib → dist/esm/lib}/grammar/solutionModifier.d.ts +0 -0
  167. /package/{lib → dist/esm/lib}/grammar/solutionModifier.js +0 -0
  168. /package/{lib → dist/esm/lib}/grammar/tripleBlock.js +0 -0
  169. /package/{lib → dist/esm/lib}/grammar/updateUnit.d.ts +0 -0
  170. /package/{lib → dist/esm/lib}/grammar/updateUnit.js +0 -0
  171. /package/{lib → dist/esm/lib}/grammar/whereClause.d.ts +0 -0
  172. /package/{lib → dist/esm/lib}/grammar/whereClause.js +0 -0
  173. /package/{lib → dist/esm/lib}/index.d.ts +0 -0
  174. /package/{lib → dist/esm/lib}/index.js +0 -0
  175. /package/{lib → dist/esm/lib}/lexer/BuiltInCalls.js +0 -0
  176. /package/{lib → dist/esm/lib}/lexer/graph.js +0 -0
  177. /package/{lib → dist/esm/lib}/lexer/index.d.ts +0 -0
  178. /package/{lib → dist/esm/lib}/lexer/index.js +0 -0
  179. /package/{lib → dist/esm/lib}/lexer/lexer.js +0 -0
  180. /package/{lib → dist/esm/lib}/lexer/lexerPatterns.d.ts +0 -0
  181. /package/{lib → dist/esm/lib}/lexer/lexerPatterns.js +0 -0
  182. /package/{lib → dist/esm/lib}/lexer/symbols.js +0 -0
  183. /package/{lib → dist/esm/lib}/sparql11HelperTypes.d.ts +0 -0
  184. /package/{lib → dist/esm/lib}/sparql11HelperTypes.js +0 -0
  185. /package/{lib → dist/esm/lib}/utils.d.ts +0 -0
  186. /package/{lib → dist/esm/lib}/utils.js +0 -0
  187. /package/{lib → dist/esm/lib}/validation/validators.d.ts +0 -0
  188. /package/{lib → dist/esm/lib}/validation/validators.js +0 -0
@@ -0,0 +1,385 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var builtIn_exports = {};
30
+ __export(builtIn_exports, {
31
+ aggregate: () => aggregate,
32
+ aggregateAvg: () => aggregateAvg,
33
+ aggregateCount: () => aggregateCount,
34
+ aggregateGroup_concat: () => aggregateGroup_concat,
35
+ aggregateMax: () => aggregateMax,
36
+ aggregateMin: () => aggregateMin,
37
+ aggregateSample: () => aggregateSample,
38
+ aggregateSum: () => aggregateSum,
39
+ builtInAbs: () => builtInAbs,
40
+ builtInBnodeSparqlJs: () => builtInBnodeSparqlJs,
41
+ builtInBound: () => builtInBound,
42
+ builtInCall: () => builtInCall,
43
+ builtInCallList: () => builtInCallList,
44
+ builtInCeil: () => builtInCeil,
45
+ builtInCoalesce: () => builtInCoalesce,
46
+ builtInConcat: () => builtInConcat,
47
+ builtInContains: () => builtInContains,
48
+ builtInDatatype: () => builtInDatatype,
49
+ builtInDay: () => builtInDay,
50
+ builtInEncode_for_uri: () => builtInEncode_for_uri,
51
+ builtInFloor: () => builtInFloor,
52
+ builtInHours: () => builtInHours,
53
+ builtInIf: () => builtInIf,
54
+ builtInIri: () => builtInIri,
55
+ builtInIsblank: () => builtInIsblank,
56
+ builtInIsiri: () => builtInIsiri,
57
+ builtInIsliteral: () => builtInIsliteral,
58
+ builtInIsnumeric: () => builtInIsnumeric,
59
+ builtInIsuri: () => builtInIsuri,
60
+ builtInLang: () => builtInLang,
61
+ builtInLangmatches: () => builtInLangmatches,
62
+ builtInLcase: () => builtInLcase,
63
+ builtInMd5: () => builtInMd5,
64
+ builtInMinutes: () => builtInMinutes,
65
+ builtInMonth: () => builtInMonth,
66
+ builtInNow: () => builtInNow,
67
+ builtInRand: () => builtInRand,
68
+ builtInRound: () => builtInRound,
69
+ builtInSameterm: () => builtInSameterm,
70
+ builtInSeconds: () => builtInSeconds,
71
+ builtInSha1: () => builtInSha1,
72
+ builtInSha256: () => builtInSha256,
73
+ builtInSha384: () => builtInSha384,
74
+ builtInSha512: () => builtInSha512,
75
+ builtInStr: () => builtInStr,
76
+ builtInStrafter: () => builtInStrafter,
77
+ builtInStrbefore: () => builtInStrbefore,
78
+ builtInStrdt: () => builtInStrdt,
79
+ builtInStrends: () => builtInStrends,
80
+ builtInStrlang: () => builtInStrlang,
81
+ builtInStrlen: () => builtInStrlen,
82
+ builtInStrstarts: () => builtInStrstarts,
83
+ builtInStruuid: () => builtInStruuid,
84
+ builtInTimezone: () => builtInTimezone,
85
+ builtInTz: () => builtInTz,
86
+ builtInUcase: () => builtInUcase,
87
+ builtInUri: () => builtInUri,
88
+ builtInUuid: () => builtInUuid,
89
+ builtInYear: () => builtInYear,
90
+ existsFunc: () => existsFunc,
91
+ notExistsFunc: () => notExistsFunc,
92
+ regexExpression: () => regexExpression,
93
+ strReplaceExpression: () => strReplaceExpression,
94
+ substringExpression: () => substringExpression
95
+ });
96
+ module.exports = __toCommonJS(builtIn_exports);
97
+ var import_core = require("@traqula/core");
98
+ var import_expressionHelpers = require("../expressionHelpers.js");
99
+ var l = __toESM(require("../lexer/index.js"), 1);
100
+ var import_expression = require("./expression.js");
101
+ var import_literals = require("./literals.js");
102
+ const builtInStr = (0, import_expressionHelpers.funcExpr1)(l.builtIn.str);
103
+ const builtInLang = (0, import_expressionHelpers.funcExpr1)(l.builtIn.lang);
104
+ const builtInLangmatches = (0, import_expressionHelpers.funcExpr2)(l.builtIn.langmatches);
105
+ const builtInDatatype = (0, import_expressionHelpers.funcExpr1)(l.builtIn.datatype);
106
+ const builtInBound = (0, import_expressionHelpers.funcVar1)(l.builtIn.bound);
107
+ const builtInIri = (0, import_expressionHelpers.funcExpr1)(l.builtIn.iri);
108
+ const builtInUri = (0, import_expressionHelpers.funcExpr1)(l.builtIn.uri);
109
+ const builtInBnodeSparqlJs = (0, import_expressionHelpers.funcExprOrNil1)(l.builtIn.bnode);
110
+ const builtInRand = (0, import_expressionHelpers.funcNil1)(l.builtIn.rand);
111
+ const builtInAbs = (0, import_expressionHelpers.funcExpr1)(l.builtIn.abs);
112
+ const builtInCeil = (0, import_expressionHelpers.funcExpr1)(l.builtIn.ceil);
113
+ const builtInFloor = (0, import_expressionHelpers.funcExpr1)(l.builtIn.floor);
114
+ const builtInRound = (0, import_expressionHelpers.funcExpr1)(l.builtIn.round);
115
+ const builtInConcat = (0, import_expressionHelpers.funcExprList1)(l.builtIn.concat);
116
+ const builtInStrlen = (0, import_expressionHelpers.funcExpr1)(l.builtIn.strlen);
117
+ const builtInUcase = (0, import_expressionHelpers.funcExpr1)(l.builtIn.ucase);
118
+ const builtInLcase = (0, import_expressionHelpers.funcExpr1)(l.builtIn.lcase);
119
+ const builtInEncode_for_uri = (0, import_expressionHelpers.funcExpr1)(l.builtIn.encode_for_uri);
120
+ const builtInContains = (0, import_expressionHelpers.funcExpr2)(l.builtIn.contains);
121
+ const builtInStrstarts = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strstarts);
122
+ const builtInStrends = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strends);
123
+ const builtInStrbefore = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strbefore);
124
+ const builtInStrafter = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strafter);
125
+ const builtInYear = (0, import_expressionHelpers.funcExpr1)(l.builtIn.year);
126
+ const builtInMonth = (0, import_expressionHelpers.funcExpr1)(l.builtIn.month);
127
+ const builtInDay = (0, import_expressionHelpers.funcExpr1)(l.builtIn.day);
128
+ const builtInHours = (0, import_expressionHelpers.funcExpr1)(l.builtIn.hours);
129
+ const builtInMinutes = (0, import_expressionHelpers.funcExpr1)(l.builtIn.minutes);
130
+ const builtInSeconds = (0, import_expressionHelpers.funcExpr1)(l.builtIn.seconds);
131
+ const builtInTimezone = (0, import_expressionHelpers.funcExpr1)(l.builtIn.timezone);
132
+ const builtInTz = (0, import_expressionHelpers.funcExpr1)(l.builtIn.tz);
133
+ const builtInNow = (0, import_expressionHelpers.funcNil1)(l.builtIn.now);
134
+ const builtInUuid = (0, import_expressionHelpers.funcNil1)(l.builtIn.uuid);
135
+ const builtInStruuid = (0, import_expressionHelpers.funcNil1)(l.builtIn.struuid);
136
+ const builtInMd5 = (0, import_expressionHelpers.funcExpr1)(l.builtIn.md5);
137
+ const builtInSha1 = (0, import_expressionHelpers.funcExpr1)(l.builtIn.sha1);
138
+ const builtInSha256 = (0, import_expressionHelpers.funcExpr1)(l.builtIn.sha256);
139
+ const builtInSha384 = (0, import_expressionHelpers.funcExpr1)(l.builtIn.sha384);
140
+ const builtInSha512 = (0, import_expressionHelpers.funcExpr1)(l.builtIn.sha512);
141
+ const builtInCoalesce = (0, import_expressionHelpers.funcExprList1)(l.builtIn.coalesce);
142
+ const builtInIf = (0, import_expressionHelpers.funcExpr3)(l.builtIn.if_);
143
+ const builtInStrlang = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strlang);
144
+ const builtInStrdt = (0, import_expressionHelpers.funcExpr2)(l.builtIn.strdt);
145
+ const builtInSameterm = (0, import_expressionHelpers.funcExpr2)(l.builtIn.sameterm);
146
+ const builtInIsiri = (0, import_expressionHelpers.funcExpr1)(l.builtIn.isiri);
147
+ const builtInIsuri = (0, import_expressionHelpers.funcExpr1)(l.builtIn.isuri);
148
+ const builtInIsblank = (0, import_expressionHelpers.funcExpr1)(l.builtIn.isblank);
149
+ const builtInIsliteral = (0, import_expressionHelpers.funcExpr1)(l.builtIn.isliteral);
150
+ const builtInIsnumeric = (0, import_expressionHelpers.funcExpr1)(l.builtIn.isnumeric);
151
+ function builtInCallList(SUBRULE) {
152
+ return [
153
+ { ALT: () => SUBRULE(aggregate) },
154
+ { ALT: () => SUBRULE(builtInStr) },
155
+ { ALT: () => SUBRULE(builtInLang) },
156
+ { ALT: () => SUBRULE(builtInLangmatches) },
157
+ { ALT: () => SUBRULE(builtInDatatype) },
158
+ { ALT: () => SUBRULE(builtInBound) },
159
+ { ALT: () => SUBRULE(builtInIri) },
160
+ { ALT: () => SUBRULE(builtInUri) },
161
+ { ALT: () => SUBRULE(builtInBnodeSparqlJs) },
162
+ { ALT: () => SUBRULE(builtInRand) },
163
+ { ALT: () => SUBRULE(builtInAbs) },
164
+ { ALT: () => SUBRULE(builtInCeil) },
165
+ { ALT: () => SUBRULE(builtInFloor) },
166
+ { ALT: () => SUBRULE(builtInRound) },
167
+ { ALT: () => SUBRULE(builtInConcat) },
168
+ { ALT: () => SUBRULE(substringExpression) },
169
+ { ALT: () => SUBRULE(builtInStrlen) },
170
+ { ALT: () => SUBRULE(strReplaceExpression) },
171
+ { ALT: () => SUBRULE(builtInUcase) },
172
+ { ALT: () => SUBRULE(builtInLcase) },
173
+ { ALT: () => SUBRULE(builtInEncode_for_uri) },
174
+ { ALT: () => SUBRULE(builtInContains) },
175
+ { ALT: () => SUBRULE(builtInStrstarts) },
176
+ { ALT: () => SUBRULE(builtInStrends) },
177
+ { ALT: () => SUBRULE(builtInStrbefore) },
178
+ { ALT: () => SUBRULE(builtInStrafter) },
179
+ { ALT: () => SUBRULE(builtInYear) },
180
+ { ALT: () => SUBRULE(builtInMonth) },
181
+ { ALT: () => SUBRULE(builtInDay) },
182
+ { ALT: () => SUBRULE(builtInHours) },
183
+ { ALT: () => SUBRULE(builtInMinutes) },
184
+ { ALT: () => SUBRULE(builtInSeconds) },
185
+ { ALT: () => SUBRULE(builtInTimezone) },
186
+ { ALT: () => SUBRULE(builtInTz) },
187
+ { ALT: () => SUBRULE(builtInNow) },
188
+ { ALT: () => SUBRULE(builtInUuid) },
189
+ { ALT: () => SUBRULE(builtInStruuid) },
190
+ { ALT: () => SUBRULE(builtInMd5) },
191
+ { ALT: () => SUBRULE(builtInSha1) },
192
+ { ALT: () => SUBRULE(builtInSha256) },
193
+ { ALT: () => SUBRULE(builtInSha384) },
194
+ { ALT: () => SUBRULE(builtInSha512) },
195
+ { ALT: () => SUBRULE(builtInCoalesce) },
196
+ { ALT: () => SUBRULE(builtInIf) },
197
+ { ALT: () => SUBRULE(builtInStrlang) },
198
+ { ALT: () => SUBRULE(builtInStrdt) },
199
+ { ALT: () => SUBRULE(builtInSameterm) },
200
+ { ALT: () => SUBRULE(builtInIsiri) },
201
+ { ALT: () => SUBRULE(builtInIsuri) },
202
+ { ALT: () => SUBRULE(builtInIsblank) },
203
+ { ALT: () => SUBRULE(builtInIsliteral) },
204
+ { ALT: () => SUBRULE(builtInIsnumeric) },
205
+ { ALT: () => SUBRULE(regexExpression) },
206
+ { ALT: () => SUBRULE(existsFunc) },
207
+ { ALT: () => SUBRULE(notExistsFunc) }
208
+ ];
209
+ }
210
+ const builtInCall = {
211
+ name: "builtInCall",
212
+ impl: ({ OR, SUBRULE, cache }) => () => {
213
+ const cached = cache.get(builtInCall);
214
+ if (cached) {
215
+ return OR(cached);
216
+ }
217
+ const builtIns = builtInCallList(SUBRULE);
218
+ cache.set(builtInCall, builtIns);
219
+ return OR(builtIns);
220
+ }
221
+ };
222
+ const regexExpression = (0, import_expressionHelpers.funcExpr2or3)(l.builtIn.regex);
223
+ const substringExpression = (0, import_expressionHelpers.funcExpr2or3)(l.builtIn.substr);
224
+ const strReplaceExpression = (0, import_expressionHelpers.funcExpr3or4)(l.builtIn.replace);
225
+ const existsFunc = (0, import_expressionHelpers.funcGroupGraphPattern)(l.builtIn.exists);
226
+ const notExistsFunc = (0, import_expressionHelpers.funcGroupGraphPattern)(l.builtIn.notexists);
227
+ const aggregateCount = {
228
+ name: (0, import_core.unCapitalize)(l.builtIn.count.name),
229
+ impl: ({ ACTION, CONSUME, SUBRULE, OR, OPTION }) => (C) => {
230
+ const operatorToken = CONSUME(l.builtIn.count);
231
+ CONSUME(l.symbols.LParen);
232
+ const distinctToken = OPTION(() => CONSUME(l.distinct));
233
+ const expressionVal = OR([
234
+ { ALT: () => {
235
+ const starToken = CONSUME(l.symbols.star);
236
+ return ACTION(() => C.astFactory.wildcard(C.astFactory.sourceLocation(starToken)));
237
+ } },
238
+ { ALT: () => SUBRULE(import_expression.expression) }
239
+ ]);
240
+ const closeToken = CONSUME(l.symbols.RParen);
241
+ return ACTION(() => {
242
+ const F = C.astFactory;
243
+ if (C.astFactory.isWildcard(expressionVal)) {
244
+ return F.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
245
+ }
246
+ return F.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
247
+ });
248
+ }
249
+ };
250
+ const aggregateSum = (0, import_expressionHelpers.baseAggregateFunc)(l.builtIn.sum);
251
+ const aggregateMin = (0, import_expressionHelpers.baseAggregateFunc)(l.builtIn.min);
252
+ const aggregateMax = (0, import_expressionHelpers.baseAggregateFunc)(l.builtIn.max);
253
+ const aggregateAvg = (0, import_expressionHelpers.baseAggregateFunc)(l.builtIn.avg);
254
+ const aggregateSample = (0, import_expressionHelpers.baseAggregateFunc)(l.builtIn.sample);
255
+ const aggregateGroup_concat = {
256
+ name: (0, import_core.unCapitalize)(l.builtIn.groupConcat.name),
257
+ impl: ({ ACTION, CONSUME, OPTION1, SUBRULE, OPTION2 }) => (C) => {
258
+ const operatorToken = CONSUME(l.builtIn.groupConcat);
259
+ CONSUME(l.symbols.LParen);
260
+ const distinctToken = OPTION1(() => CONSUME(l.distinct));
261
+ const expr = SUBRULE(import_expression.expression);
262
+ const sep = OPTION2(() => {
263
+ CONSUME(l.symbols.semi);
264
+ CONSUME(l.separator);
265
+ CONSUME(l.symbols.equal);
266
+ return SUBRULE(import_literals.string);
267
+ });
268
+ const closeToken = CONSUME(l.symbols.RParen);
269
+ return ACTION(() => {
270
+ const F = C.astFactory;
271
+ return F.aggregate(operatorToken.image, Boolean(distinctToken), expr, sep?.value ?? " ", F.sourceLocation(operatorToken, closeToken));
272
+ });
273
+ }
274
+ };
275
+ const aggregate = {
276
+ name: "aggregate",
277
+ impl: ({ ACTION, SUBRULE, OR }) => (C) => {
278
+ const wasInAggregate = ACTION(() => C.parseMode.has("inAggregate"));
279
+ ACTION(() => C.parseMode.add("inAggregate"));
280
+ const result = OR([
281
+ { ALT: () => SUBRULE(aggregateCount) },
282
+ { ALT: () => SUBRULE(aggregateSum) },
283
+ { ALT: () => SUBRULE(aggregateMin) },
284
+ { ALT: () => SUBRULE(aggregateMax) },
285
+ { ALT: () => SUBRULE(aggregateAvg) },
286
+ { ALT: () => SUBRULE(aggregateSample) },
287
+ { ALT: () => SUBRULE(aggregateGroup_concat) }
288
+ ]);
289
+ ACTION(() => !wasInAggregate && C.parseMode.delete("inAggregate"));
290
+ ACTION(() => {
291
+ if (!C.parseMode.has("canParseAggregate")) {
292
+ throw new Error("Aggregates are only allowed in SELECT, HAVING, and ORDER BY clauses.");
293
+ }
294
+ if (C.parseMode.has("inAggregate")) {
295
+ throw new Error("An aggregate function is not allowed within an aggregate function.");
296
+ }
297
+ });
298
+ return result;
299
+ },
300
+ gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F }) => {
301
+ F.printFilter(ast, () => {
302
+ PRINT_WORD(ast.aggregation.toUpperCase(), "(");
303
+ if (ast.distinct) {
304
+ PRINT_WORD("DISTINCT");
305
+ }
306
+ });
307
+ const arg = ast.expression[0];
308
+ if (F.isWildcard(arg)) {
309
+ F.printFilter(ast, () => PRINT_WORD("*"));
310
+ } else {
311
+ SUBRULE(import_expression.expression, arg);
312
+ }
313
+ if (F.isExpressionAggregateSeparator(ast)) {
314
+ F.printFilter(ast, () => PRINT_WORD(";", "SEPARATOR", "=", (0, import_literals.stringEscapedLexical)(ast.separator)));
315
+ }
316
+ F.printFilter(ast, () => PRINT_WORD(")"));
317
+ }
318
+ };
319
+ // Annotate the CommonJS export names for ESM import in node:
320
+ 0 && (module.exports = {
321
+ aggregate,
322
+ aggregateAvg,
323
+ aggregateCount,
324
+ aggregateGroup_concat,
325
+ aggregateMax,
326
+ aggregateMin,
327
+ aggregateSample,
328
+ aggregateSum,
329
+ builtInAbs,
330
+ builtInBnodeSparqlJs,
331
+ builtInBound,
332
+ builtInCall,
333
+ builtInCallList,
334
+ builtInCeil,
335
+ builtInCoalesce,
336
+ builtInConcat,
337
+ builtInContains,
338
+ builtInDatatype,
339
+ builtInDay,
340
+ builtInEncode_for_uri,
341
+ builtInFloor,
342
+ builtInHours,
343
+ builtInIf,
344
+ builtInIri,
345
+ builtInIsblank,
346
+ builtInIsiri,
347
+ builtInIsliteral,
348
+ builtInIsnumeric,
349
+ builtInIsuri,
350
+ builtInLang,
351
+ builtInLangmatches,
352
+ builtInLcase,
353
+ builtInMd5,
354
+ builtInMinutes,
355
+ builtInMonth,
356
+ builtInNow,
357
+ builtInRand,
358
+ builtInRound,
359
+ builtInSameterm,
360
+ builtInSeconds,
361
+ builtInSha1,
362
+ builtInSha256,
363
+ builtInSha384,
364
+ builtInSha512,
365
+ builtInStr,
366
+ builtInStrafter,
367
+ builtInStrbefore,
368
+ builtInStrdt,
369
+ builtInStrends,
370
+ builtInStrlang,
371
+ builtInStrlen,
372
+ builtInStrstarts,
373
+ builtInStruuid,
374
+ builtInTimezone,
375
+ builtInTz,
376
+ builtInUcase,
377
+ builtInUri,
378
+ builtInUuid,
379
+ builtInYear,
380
+ existsFunc,
381
+ notExistsFunc,
382
+ regexExpression,
383
+ strReplaceExpression,
384
+ substringExpression
385
+ });
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var dataSetClause_exports = {};
30
+ __export(dataSetClause_exports, {
31
+ datasetClause: () => datasetClause,
32
+ datasetClauseStar: () => datasetClauseStar,
33
+ datasetClauseUsing: () => datasetClauseUsing,
34
+ datasetClauseUsingStar: () => datasetClauseUsingStar,
35
+ defaultGraphClause: () => defaultGraphClause,
36
+ namedGraphClause: () => namedGraphClause,
37
+ sourceSelector: () => sourceSelector,
38
+ usingClause: () => usingClause,
39
+ usingClauseStar: () => usingClauseStar
40
+ });
41
+ module.exports = __toCommonJS(dataSetClause_exports);
42
+ var l = __toESM(require("../lexer/index.js"), 1);
43
+ var import_literals = require("./literals.js");
44
+ function datasetClauseUsing(name, token) {
45
+ return {
46
+ name,
47
+ impl: ({ ACTION, SUBRULE, CONSUME, OR }) => (C) => {
48
+ const start = CONSUME(token);
49
+ return OR([
50
+ { ALT: () => {
51
+ const iri2 = SUBRULE(defaultGraphClause);
52
+ return ACTION(() => C.astFactory.wrap({ clauseType: "default", value: iri2 }, C.astFactory.sourceLocation(start, iri2)));
53
+ } },
54
+ { ALT: () => {
55
+ const namedClause = SUBRULE(namedGraphClause);
56
+ return ACTION(() => C.astFactory.wrap({
57
+ clauseType: "named",
58
+ value: namedClause.val
59
+ }, C.astFactory.sourceLocation(start, namedClause)));
60
+ } }
61
+ ]);
62
+ }
63
+ };
64
+ }
65
+ const datasetClause = datasetClauseUsing("datasetClause", l.from);
66
+ const defaultGraphClause = {
67
+ name: "defaultGraphClause",
68
+ impl: ({ SUBRULE }) => () => SUBRULE(sourceSelector)
69
+ };
70
+ const usingClause = datasetClauseUsing("usingClause", l.usingClause);
71
+ function datasetClauseUsingStar(name, subRule, fromUsing) {
72
+ return {
73
+ name,
74
+ impl: ({ ACTION, MANY, SUBRULE }) => (C) => {
75
+ const clauses = [];
76
+ MANY(() => {
77
+ const clause = SUBRULE(subRule);
78
+ clauses.push(clause);
79
+ });
80
+ return ACTION(() => C.astFactory.datasetClauses(clauses.map((clause) => clause.val), C.astFactory.sourceLocation(...clauses)));
81
+ },
82
+ gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F }) => {
83
+ for (const clause of ast.clauses) {
84
+ F.printFilter(ast, () => PRINT_WORD(fromUsing));
85
+ if (clause.clauseType === "named") {
86
+ F.printFilter(ast, () => PRINT_WORD("NAMED"));
87
+ }
88
+ SUBRULE(import_literals.iri, clause.value);
89
+ }
90
+ }
91
+ };
92
+ }
93
+ const datasetClauseStar = datasetClauseUsingStar("datasetClauses", datasetClause, "FROM");
94
+ const usingClauseStar = datasetClauseUsingStar("usingClauses", usingClause, "USING");
95
+ const namedGraphClause = {
96
+ name: "namedGraphClause",
97
+ impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
98
+ const named = CONSUME(l.graph.named);
99
+ const iri2 = SUBRULE(sourceSelector);
100
+ return ACTION(() => C.astFactory.wrap(iri2, C.astFactory.sourceLocation(named, iri2)));
101
+ }
102
+ };
103
+ const sourceSelector = {
104
+ name: "sourceSelector",
105
+ impl: ({ SUBRULE }) => () => SUBRULE(import_literals.iri)
106
+ };
107
+ // Annotate the CommonJS export names for ESM import in node:
108
+ 0 && (module.exports = {
109
+ datasetClause,
110
+ datasetClauseStar,
111
+ datasetClauseUsing,
112
+ datasetClauseUsingStar,
113
+ defaultGraphClause,
114
+ namedGraphClause,
115
+ sourceSelector,
116
+ usingClause,
117
+ usingClauseStar
118
+ });