@traqula/rules-sparql-1-2 0.0.14 → 0.0.16
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/lib/{Factory.d.ts → AstFactory.d.ts} +2 -2
- package/lib/{Factory.js → AstFactory.js} +3 -3
- package/lib/AstFactory.js.map +1 -0
- package/lib/grammar.d.ts +2 -2
- package/lib/grammar.js +56 -34
- package/lib/grammar.js.map +1 -1
- package/lib/index.cjs +897 -795
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/lexer.d.ts +1 -1
- package/lib/parserUtils.d.ts +3 -3
- package/lib/parserUtils.js +5 -2
- package/lib/parserUtils.js.map +1 -1
- package/lib/sparql12HelperTypes.d.ts +6 -5
- package/lib/sparql12HelperTypes.js.map +1 -1
- package/lib/validators.js +7 -2
- package/lib/validators.js.map +1 -1
- package/package.json +4 -4
- package/lib/Factory.js.map +0 -1
package/lib/index.cjs
CHANGED
|
@@ -20,7 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// lib/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
-
|
|
23
|
+
AstFactory: () => AstFactory2,
|
|
24
24
|
completeParseContext: () => completeParseContext,
|
|
25
25
|
findPatternBoundedVars: () => findPatternBoundedVars2,
|
|
26
26
|
gram: () => grammar_exports2,
|
|
@@ -80,357 +80,8 @@ __export(grammar_exports2, {
|
|
|
80
80
|
versionSpecifier: () => versionSpecifier
|
|
81
81
|
});
|
|
82
82
|
|
|
83
|
-
// ../
|
|
84
|
-
var
|
|
85
|
-
__export(grammar_exports, {
|
|
86
|
-
add: () => add2,
|
|
87
|
-
additiveExpression: () => additiveExpression,
|
|
88
|
-
aggregate: () => aggregate,
|
|
89
|
-
aggregateAvg: () => aggregateAvg,
|
|
90
|
-
aggregateCount: () => aggregateCount,
|
|
91
|
-
aggregateGroup_concat: () => aggregateGroup_concat,
|
|
92
|
-
aggregateMax: () => aggregateMax,
|
|
93
|
-
aggregateMin: () => aggregateMin,
|
|
94
|
-
aggregateSample: () => aggregateSample,
|
|
95
|
-
aggregateSum: () => aggregateSum,
|
|
96
|
-
argList: () => argList,
|
|
97
|
-
askQuery: () => askQuery,
|
|
98
|
-
baseAggregateFunc: () => baseAggregateFunc,
|
|
99
|
-
baseDecl: () => baseDecl2,
|
|
100
|
-
bind: () => bind2,
|
|
101
|
-
blankNode: () => blankNode,
|
|
102
|
-
blankNodePropertyList: () => blankNodePropertyList,
|
|
103
|
-
blankNodePropertyListPath: () => blankNodePropertyListPath,
|
|
104
|
-
booleanLiteral: () => booleanLiteral,
|
|
105
|
-
brackettedExpression: () => brackettedExpression,
|
|
106
|
-
builtInAbs: () => builtInAbs,
|
|
107
|
-
builtInBnodeSparqlJs: () => builtInBnodeSparqlJs,
|
|
108
|
-
builtInBound: () => builtInBound,
|
|
109
|
-
builtInCall: () => builtInCall,
|
|
110
|
-
builtInCallList: () => builtInCallList,
|
|
111
|
-
builtInCeil: () => builtInCeil,
|
|
112
|
-
builtInCoalesce: () => builtInCoalesce,
|
|
113
|
-
builtInConcat: () => builtInConcat,
|
|
114
|
-
builtInContains: () => builtInContains,
|
|
115
|
-
builtInDatatype: () => builtInDatatype,
|
|
116
|
-
builtInDay: () => builtInDay,
|
|
117
|
-
builtInEncode_for_uri: () => builtInEncode_for_uri,
|
|
118
|
-
builtInFloor: () => builtInFloor,
|
|
119
|
-
builtInHours: () => builtInHours,
|
|
120
|
-
builtInIf: () => builtInIf,
|
|
121
|
-
builtInIri: () => builtInIri,
|
|
122
|
-
builtInIsblank: () => builtInIsblank,
|
|
123
|
-
builtInIsiri: () => builtInIsiri,
|
|
124
|
-
builtInIsliteral: () => builtInIsliteral,
|
|
125
|
-
builtInIsnumeric: () => builtInIsnumeric,
|
|
126
|
-
builtInIsuri: () => builtInIsuri,
|
|
127
|
-
builtInLang: () => builtInLang,
|
|
128
|
-
builtInLangmatches: () => builtInLangmatches,
|
|
129
|
-
builtInLcase: () => builtInLcase,
|
|
130
|
-
builtInMd5: () => builtInMd5,
|
|
131
|
-
builtInMinutes: () => builtInMinutes,
|
|
132
|
-
builtInMonth: () => builtInMonth,
|
|
133
|
-
builtInNow: () => builtInNow,
|
|
134
|
-
builtInRand: () => builtInRand,
|
|
135
|
-
builtInRound: () => builtInRound,
|
|
136
|
-
builtInSameterm: () => builtInSameterm,
|
|
137
|
-
builtInSeconds: () => builtInSeconds,
|
|
138
|
-
builtInSha1: () => builtInSha1,
|
|
139
|
-
builtInSha256: () => builtInSha256,
|
|
140
|
-
builtInSha384: () => builtInSha384,
|
|
141
|
-
builtInSha512: () => builtInSha512,
|
|
142
|
-
builtInStr: () => builtInStr,
|
|
143
|
-
builtInStrafter: () => builtInStrafter,
|
|
144
|
-
builtInStrbefore: () => builtInStrbefore,
|
|
145
|
-
builtInStrdt: () => builtInStrdt,
|
|
146
|
-
builtInStrends: () => builtInStrends,
|
|
147
|
-
builtInStrlang: () => builtInStrlang,
|
|
148
|
-
builtInStrlen: () => builtInStrlen,
|
|
149
|
-
builtInStrstarts: () => builtInStrstarts,
|
|
150
|
-
builtInStruuid: () => builtInStruuid,
|
|
151
|
-
builtInTimezone: () => builtInTimezone,
|
|
152
|
-
builtInTz: () => builtInTz,
|
|
153
|
-
builtInUcase: () => builtInUcase,
|
|
154
|
-
builtInUri: () => builtInUri,
|
|
155
|
-
builtInUuid: () => builtInUuid,
|
|
156
|
-
builtInYear: () => builtInYear,
|
|
157
|
-
canCreateBlankNodes: () => canCreateBlankNodes,
|
|
158
|
-
clear: () => clear2,
|
|
159
|
-
collection: () => collection,
|
|
160
|
-
collectionPath: () => collectionPath,
|
|
161
|
-
conditionalAndExpression: () => conditionalAndExpression,
|
|
162
|
-
conditionalOrExpression: () => conditionalOrExpression,
|
|
163
|
-
constraint: () => constraint,
|
|
164
|
-
constructQuery: () => constructQuery,
|
|
165
|
-
constructTemplate: () => constructTemplate,
|
|
166
|
-
constructTriples: () => constructTriples,
|
|
167
|
-
copy: () => copy2,
|
|
168
|
-
create: () => create2,
|
|
169
|
-
dataBlock: () => dataBlock,
|
|
170
|
-
dataBlockValue: () => dataBlockValue,
|
|
171
|
-
datasetClause: () => datasetClause,
|
|
172
|
-
datasetClauseStar: () => datasetClauseStar,
|
|
173
|
-
datasetClauseUsing: () => datasetClauseUsing,
|
|
174
|
-
datasetClauseUsingStar: () => datasetClauseUsingStar,
|
|
175
|
-
defaultGraphClause: () => defaultGraphClause,
|
|
176
|
-
deleteClause: () => deleteClause2,
|
|
177
|
-
deleteData: () => deleteData,
|
|
178
|
-
deleteWhere: () => deleteWhere,
|
|
179
|
-
describeQuery: () => describeQuery,
|
|
180
|
-
drop: () => drop3,
|
|
181
|
-
existsFunc: () => existsFunc,
|
|
182
|
-
expression: () => expression,
|
|
183
|
-
expressionList: () => expressionList,
|
|
184
|
-
filter: () => filter3,
|
|
185
|
-
funcExpr1: () => funcExpr1,
|
|
186
|
-
funcExpr2: () => funcExpr2,
|
|
187
|
-
funcExpr2or3: () => funcExpr2or3,
|
|
188
|
-
funcExpr3: () => funcExpr3,
|
|
189
|
-
funcExpr3or4: () => funcExpr3or4,
|
|
190
|
-
funcExprList1: () => funcExprList1,
|
|
191
|
-
funcExprOrNil1: () => funcExprOrNil1,
|
|
192
|
-
funcGroupGraphPattern: () => funcGroupGraphPattern,
|
|
193
|
-
funcNil1: () => funcNil1,
|
|
194
|
-
funcVar1: () => funcVar1,
|
|
195
|
-
functionCall: () => functionCall,
|
|
196
|
-
generatePattern: () => generatePattern,
|
|
197
|
-
graphGraphPattern: () => graphGraphPattern,
|
|
198
|
-
graphNode: () => graphNode,
|
|
199
|
-
graphNodePath: () => graphNodePath,
|
|
200
|
-
graphOrDefault: () => graphOrDefault,
|
|
201
|
-
graphPatternNotTriples: () => graphPatternNotTriples,
|
|
202
|
-
graphRef: () => graphRef,
|
|
203
|
-
graphRefAll: () => graphRefAll,
|
|
204
|
-
graphTerm: () => graphTerm,
|
|
205
|
-
groupClause: () => groupClause,
|
|
206
|
-
groupCondition: () => groupCondition,
|
|
207
|
-
groupGraphPattern: () => groupGraphPattern,
|
|
208
|
-
groupGraphPatternSub: () => groupGraphPatternSub,
|
|
209
|
-
groupOrUnionGraphPattern: () => groupOrUnionGraphPattern,
|
|
210
|
-
havingClause: () => havingClause,
|
|
211
|
-
havingCondition: () => havingCondition,
|
|
212
|
-
inlineData: () => inlineData,
|
|
213
|
-
inlineDataFull: () => inlineDataFull,
|
|
214
|
-
inlineDataOneVar: () => inlineDataOneVar,
|
|
215
|
-
insertClause: () => insertClause2,
|
|
216
|
-
insertData: () => insertData,
|
|
217
|
-
iri: () => iri2,
|
|
218
|
-
iriFull: () => iriFull,
|
|
219
|
-
iriOrFunction: () => iriOrFunction,
|
|
220
|
-
limitClause: () => limitClause,
|
|
221
|
-
limitOffsetClauses: () => limitOffsetClauses,
|
|
222
|
-
load: () => load2,
|
|
223
|
-
minusGraphPattern: () => minusGraphPattern,
|
|
224
|
-
modify: () => modify,
|
|
225
|
-
move: () => move2,
|
|
226
|
-
multiplicativeExpression: () => multiplicativeExpression,
|
|
227
|
-
namedGraphClause: () => namedGraphClause,
|
|
228
|
-
notExistsFunc: () => notExistsFunc,
|
|
229
|
-
numericExpression: () => numericExpression,
|
|
230
|
-
numericLiteral: () => numericLiteral,
|
|
231
|
-
numericLiteralNegative: () => numericLiteralNegative,
|
|
232
|
-
numericLiteralPositive: () => numericLiteralPositive,
|
|
233
|
-
numericLiteralUnsigned: () => numericLiteralUnsigned,
|
|
234
|
-
object: () => object,
|
|
235
|
-
objectList: () => objectList,
|
|
236
|
-
objectListPath: () => objectListPath,
|
|
237
|
-
objectPath: () => objectPath,
|
|
238
|
-
offsetClause: () => offsetClause,
|
|
239
|
-
optionalGraphPattern: () => optionalGraphPattern,
|
|
240
|
-
orderClause: () => orderClause,
|
|
241
|
-
orderCondition: () => orderCondition,
|
|
242
|
-
path: () => path,
|
|
243
|
-
pathAlternative: () => pathAlternative,
|
|
244
|
-
pathChainHelper: () => pathChainHelper,
|
|
245
|
-
pathElt: () => pathElt,
|
|
246
|
-
pathEltOrInverse: () => pathEltOrInverse,
|
|
247
|
-
pathGenerator: () => pathGenerator,
|
|
248
|
-
pathMod: () => pathMod,
|
|
249
|
-
pathNegatedPropertySet: () => pathNegatedPropertySet,
|
|
250
|
-
pathOneInPropertySet: () => pathOneInPropertySet,
|
|
251
|
-
pathPrimary: () => pathPrimary,
|
|
252
|
-
pathSequence: () => pathSequence,
|
|
253
|
-
prefixDecl: () => prefixDecl2,
|
|
254
|
-
prefixedName: () => prefixedName,
|
|
255
|
-
primaryExpression: () => primaryExpression,
|
|
256
|
-
prologue: () => prologue,
|
|
257
|
-
propertyList: () => propertyList,
|
|
258
|
-
propertyListNotEmpty: () => propertyListNotEmpty,
|
|
259
|
-
propertyListPath: () => propertyListPath,
|
|
260
|
-
propertyListPathNotEmpty: () => propertyListPathNotEmpty,
|
|
261
|
-
quadData: () => quadData,
|
|
262
|
-
quadPattern: () => quadPattern,
|
|
263
|
-
quads: () => quads,
|
|
264
|
-
quadsNotTriples: () => quadsNotTriples,
|
|
265
|
-
query: () => query,
|
|
266
|
-
queryOrUpdate: () => queryOrUpdate,
|
|
267
|
-
queryUnit: () => queryUnit,
|
|
268
|
-
rdfLiteral: () => rdfLiteral,
|
|
269
|
-
regexExpression: () => regexExpression,
|
|
270
|
-
relationalExpression: () => relationalExpression,
|
|
271
|
-
selectClause: () => selectClause,
|
|
272
|
-
selectQuery: () => selectQuery,
|
|
273
|
-
serviceGraphPattern: () => serviceGraphPattern,
|
|
274
|
-
solutionModifier: () => solutionModifier,
|
|
275
|
-
sourceSelector: () => sourceSelector,
|
|
276
|
-
strReplaceExpression: () => strReplaceExpression,
|
|
277
|
-
string: () => string,
|
|
278
|
-
stringEscapedLexical: () => stringEscapedLexical,
|
|
279
|
-
subSelect: () => subSelect,
|
|
280
|
-
substringExpression: () => substringExpression,
|
|
281
|
-
triplesBlock: () => triplesBlock,
|
|
282
|
-
triplesNode: () => triplesNode,
|
|
283
|
-
triplesNodePath: () => triplesNodePath,
|
|
284
|
-
triplesSameSubject: () => triplesSameSubject,
|
|
285
|
-
triplesSameSubjectPath: () => triplesSameSubjectPath,
|
|
286
|
-
triplesTemplate: () => triplesTemplate,
|
|
287
|
-
unaryExpression: () => unaryExpression,
|
|
288
|
-
update: () => update,
|
|
289
|
-
update1: () => update1,
|
|
290
|
-
updateUnit: () => updateUnit,
|
|
291
|
-
usingClause: () => usingClause2,
|
|
292
|
-
usingClauseStar: () => usingClauseStar,
|
|
293
|
-
valueLogical: () => valueLogical,
|
|
294
|
-
valuesClause: () => valuesClause,
|
|
295
|
-
varOrIri: () => varOrIri,
|
|
296
|
-
varOrTerm: () => varOrTerm,
|
|
297
|
-
var_: () => var_,
|
|
298
|
-
verb: () => verb,
|
|
299
|
-
verbA: () => verbA,
|
|
300
|
-
verbPath: () => verbPath,
|
|
301
|
-
verbSimple: () => verbSimple,
|
|
302
|
-
whereClause: () => whereClause
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
// ../rules-sparql-1-1/lib/lexer/index.js
|
|
306
|
-
var lexer_exports = {};
|
|
307
|
-
__export(lexer_exports, {
|
|
308
|
-
a: () => a,
|
|
309
|
-
add: () => add,
|
|
310
|
-
allBaseTokens: () => allBaseTokens,
|
|
311
|
-
as: () => as,
|
|
312
|
-
ask: () => ask,
|
|
313
|
-
baseDecl: () => baseDecl,
|
|
314
|
-
bind: () => bind,
|
|
315
|
-
builtIn: () => BuiltInCalls_exports,
|
|
316
|
-
by: () => by,
|
|
317
|
-
clear: () => clear,
|
|
318
|
-
construct: () => construct,
|
|
319
|
-
copy: () => copy,
|
|
320
|
-
create: () => create,
|
|
321
|
-
dataClause: () => dataClause,
|
|
322
|
-
deleteClause: () => deleteClause,
|
|
323
|
-
describe: () => describe,
|
|
324
|
-
distinct: () => distinct,
|
|
325
|
-
drop: () => drop2,
|
|
326
|
-
false_: () => false_,
|
|
327
|
-
filter: () => filter2,
|
|
328
|
-
from: () => from,
|
|
329
|
-
graph: () => graph_exports,
|
|
330
|
-
groupByGroup: () => groupByGroup,
|
|
331
|
-
having: () => having,
|
|
332
|
-
in_: () => in_,
|
|
333
|
-
insertClause: () => insertClause,
|
|
334
|
-
limit: () => limit,
|
|
335
|
-
load: () => load,
|
|
336
|
-
loadInto: () => loadInto,
|
|
337
|
-
minus: () => minus,
|
|
338
|
-
modifyWith: () => modifyWith,
|
|
339
|
-
move: () => move,
|
|
340
|
-
notIn: () => notIn,
|
|
341
|
-
offset: () => offset,
|
|
342
|
-
optional: () => optional,
|
|
343
|
-
order: () => order,
|
|
344
|
-
orderAsc: () => orderAsc,
|
|
345
|
-
orderDesc: () => orderDesc,
|
|
346
|
-
prefixDecl: () => prefixDecl,
|
|
347
|
-
reduced: () => reduced,
|
|
348
|
-
select: () => select,
|
|
349
|
-
separator: () => separator,
|
|
350
|
-
service: () => service,
|
|
351
|
-
silent: () => silent,
|
|
352
|
-
sparql11LexerBuilder: () => sparql11LexerBuilder,
|
|
353
|
-
symbols: () => symbols_exports,
|
|
354
|
-
terminals: () => terminals_exports,
|
|
355
|
-
to: () => to,
|
|
356
|
-
true_: () => true_,
|
|
357
|
-
undef: () => undef,
|
|
358
|
-
union: () => union,
|
|
359
|
-
usingClause: () => usingClause,
|
|
360
|
-
values: () => values2,
|
|
361
|
-
where: () => where
|
|
362
|
-
});
|
|
363
|
-
|
|
364
|
-
// ../rules-sparql-1-1/lib/lexer/BuiltInCalls.js
|
|
365
|
-
var BuiltInCalls_exports = {};
|
|
366
|
-
__export(BuiltInCalls_exports, {
|
|
367
|
-
BuiltInCalls: () => BuiltInCalls,
|
|
368
|
-
abs: () => abs,
|
|
369
|
-
allBuiltInCalls: () => allBuiltInCalls,
|
|
370
|
-
avg: () => avg,
|
|
371
|
-
bnode: () => bnode,
|
|
372
|
-
bound: () => bound,
|
|
373
|
-
ceil: () => ceil,
|
|
374
|
-
coalesce: () => coalesce,
|
|
375
|
-
concat: () => concat,
|
|
376
|
-
contains: () => contains,
|
|
377
|
-
count: () => count,
|
|
378
|
-
datatype: () => datatype,
|
|
379
|
-
day: () => day,
|
|
380
|
-
encode_for_uri: () => encode_for_uri,
|
|
381
|
-
exists: () => exists,
|
|
382
|
-
floor: () => floor,
|
|
383
|
-
groupConcat: () => groupConcat,
|
|
384
|
-
hours: () => hours,
|
|
385
|
-
if_: () => if_,
|
|
386
|
-
iri: () => iri,
|
|
387
|
-
isblank: () => isblank,
|
|
388
|
-
isiri: () => isiri,
|
|
389
|
-
isliteral: () => isliteral,
|
|
390
|
-
isnumeric: () => isnumeric,
|
|
391
|
-
isuri: () => isuri,
|
|
392
|
-
lang: () => lang,
|
|
393
|
-
langmatches: () => langmatches,
|
|
394
|
-
lcase: () => lcase,
|
|
395
|
-
max: () => max,
|
|
396
|
-
md5: () => md5,
|
|
397
|
-
min: () => min,
|
|
398
|
-
minutes: () => minutes,
|
|
399
|
-
month: () => month,
|
|
400
|
-
notexists: () => notexists,
|
|
401
|
-
now: () => now,
|
|
402
|
-
rand: () => rand,
|
|
403
|
-
regex: () => regex,
|
|
404
|
-
replace: () => replace,
|
|
405
|
-
round: () => round,
|
|
406
|
-
sameterm: () => sameterm,
|
|
407
|
-
sample: () => sample,
|
|
408
|
-
seconds: () => seconds,
|
|
409
|
-
sha1: () => sha1,
|
|
410
|
-
sha256: () => sha256,
|
|
411
|
-
sha384: () => sha384,
|
|
412
|
-
sha512: () => sha512,
|
|
413
|
-
str: () => str,
|
|
414
|
-
strafter: () => strafter,
|
|
415
|
-
strbefore: () => strbefore,
|
|
416
|
-
strdt: () => strdt,
|
|
417
|
-
strends: () => strends,
|
|
418
|
-
strlang: () => strlang,
|
|
419
|
-
strlen: () => strlen,
|
|
420
|
-
strstarts: () => strstarts,
|
|
421
|
-
struuid: () => struuid,
|
|
422
|
-
substr: () => substr,
|
|
423
|
-
sum: () => sum,
|
|
424
|
-
timezone: () => timezone,
|
|
425
|
-
tz: () => tz,
|
|
426
|
-
ucase: () => ucase,
|
|
427
|
-
uri: () => uri,
|
|
428
|
-
uuid: () => uuid,
|
|
429
|
-
year: () => year
|
|
430
|
-
});
|
|
431
|
-
|
|
432
|
-
// ../core/lib/CoreFactory.js
|
|
433
|
-
var CoreFactory = class {
|
|
83
|
+
// ../core/lib/AstCoreFactory.js
|
|
84
|
+
var AstCoreFactory = class {
|
|
434
85
|
wrap(val, loc) {
|
|
435
86
|
return { val, loc };
|
|
436
87
|
}
|
|
@@ -9767,6 +9418,15 @@ applyMixins(Parser, [
|
|
|
9767
9418
|
PerformanceTracer
|
|
9768
9419
|
]);
|
|
9769
9420
|
|
|
9421
|
+
// ../core/lib/utils.js
|
|
9422
|
+
function unCapitalize(str2) {
|
|
9423
|
+
return str2.charAt(0).toLowerCase() + str2.slice(1);
|
|
9424
|
+
}
|
|
9425
|
+
function createToken2(config) {
|
|
9426
|
+
return createToken(config);
|
|
9427
|
+
}
|
|
9428
|
+
var traqulaIndentation = "When you use this string, you expect traqula to handle indentation after every newline";
|
|
9429
|
+
|
|
9770
9430
|
// ../core/lib/lexer-builder/LexerBuilder.js
|
|
9771
9431
|
var LexerBuilder = class _LexerBuilder {
|
|
9772
9432
|
tokens;
|
|
@@ -9864,127 +9524,466 @@ var LexerBuilder = class _LexerBuilder {
|
|
|
9864
9524
|
}
|
|
9865
9525
|
};
|
|
9866
9526
|
|
|
9867
|
-
// ../core/lib/
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
}
|
|
9527
|
+
// ../core/lib/Transformers.js
|
|
9528
|
+
var TransformerType = class {
|
|
9529
|
+
safeObjectVisit(value, mapper) {
|
|
9530
|
+
if (value && typeof value === "object") {
|
|
9531
|
+
if (Array.isArray(value)) {
|
|
9532
|
+
return value.map((x) => this.safeObjectVisit(x, mapper));
|
|
9533
|
+
}
|
|
9534
|
+
return mapper(value);
|
|
9535
|
+
}
|
|
9536
|
+
return value;
|
|
9537
|
+
}
|
|
9538
|
+
transformNode(curObject, nodeCallBacks) {
|
|
9539
|
+
let continueCheck;
|
|
9540
|
+
let transformation;
|
|
9541
|
+
const casted = curObject;
|
|
9542
|
+
if (casted.type) {
|
|
9543
|
+
continueCheck = nodeCallBacks[casted.type]?.continue;
|
|
9544
|
+
transformation = nodeCallBacks[casted.type]?.transform;
|
|
9545
|
+
}
|
|
9546
|
+
let shouldContinue = true;
|
|
9547
|
+
if (continueCheck) {
|
|
9548
|
+
shouldContinue = continueCheck(curObject);
|
|
9549
|
+
}
|
|
9550
|
+
if (!shouldContinue) {
|
|
9551
|
+
return curObject;
|
|
9552
|
+
}
|
|
9553
|
+
const copy3 = { ...curObject };
|
|
9554
|
+
for (const [key, value] of Object.entries(copy3)) {
|
|
9555
|
+
copy3[key] = this.safeObjectVisit(value, (obj) => this.transformNode(obj, nodeCallBacks));
|
|
9556
|
+
}
|
|
9557
|
+
if (transformation) {
|
|
9558
|
+
return transformation(copy3);
|
|
9559
|
+
}
|
|
9560
|
+
return copy3;
|
|
9561
|
+
}
|
|
9562
|
+
visitNode(curObject, nodeCallBacks) {
|
|
9563
|
+
let callback;
|
|
9564
|
+
const casted = curObject;
|
|
9565
|
+
if (casted.type) {
|
|
9566
|
+
callback = nodeCallBacks[casted.type];
|
|
9567
|
+
}
|
|
9568
|
+
let shouldIterate = true;
|
|
9569
|
+
if (callback) {
|
|
9570
|
+
shouldIterate = callback(curObject);
|
|
9571
|
+
}
|
|
9572
|
+
if (shouldIterate) {
|
|
9573
|
+
for (const value of Object.values(curObject)) {
|
|
9574
|
+
this.safeObjectVisit(value, (obj) => this.visitNode(obj, nodeCallBacks));
|
|
9575
|
+
}
|
|
9576
|
+
}
|
|
9577
|
+
}
|
|
9578
|
+
};
|
|
9579
|
+
var TransformerSubType = class extends TransformerType {
|
|
9580
|
+
// Public visitObjects(curObject: object, visitor: (current: object) => void): void {
|
|
9581
|
+
// for (const value of Object.values(curObject)) {
|
|
9582
|
+
// this.safeObjectVisit(value, obj => this.visitObjects(obj, visitor));
|
|
9583
|
+
// }
|
|
9584
|
+
// }
|
|
9585
|
+
transformNodeSpecific(curObject, nodeCallBacks, nodeSpecificCallBacks = {}) {
|
|
9586
|
+
let continueCheck;
|
|
9587
|
+
let transformation;
|
|
9588
|
+
const casted = curObject;
|
|
9589
|
+
if (casted.type && casted.subType) {
|
|
9590
|
+
const specific = nodeSpecificCallBacks[casted.type];
|
|
9591
|
+
if (specific) {
|
|
9592
|
+
continueCheck = specific[casted.subType]?.continue;
|
|
9593
|
+
transformation = specific[casted.subType]?.transform;
|
|
9594
|
+
}
|
|
9595
|
+
}
|
|
9596
|
+
let shouldContinue = true;
|
|
9597
|
+
if (continueCheck) {
|
|
9598
|
+
shouldContinue = continueCheck(curObject);
|
|
9599
|
+
}
|
|
9600
|
+
if (!shouldContinue) {
|
|
9601
|
+
return curObject;
|
|
9602
|
+
}
|
|
9603
|
+
const copy3 = { ...curObject };
|
|
9604
|
+
for (const [key, value] of Object.entries(copy3)) {
|
|
9605
|
+
copy3[key] = this.safeObjectVisit(value, (obj) => this.transformNodeSpecific(obj, nodeCallBacks, nodeSpecificCallBacks));
|
|
9606
|
+
}
|
|
9607
|
+
if (transformation) {
|
|
9608
|
+
return transformation(copy3);
|
|
9609
|
+
}
|
|
9610
|
+
return copy3;
|
|
9611
|
+
}
|
|
9612
|
+
/**
|
|
9613
|
+
* When both nodeCallBack and NodeSpecific callBack are matched, will only look at nodeSpecifCallback
|
|
9614
|
+
*/
|
|
9615
|
+
visitNodeSpecific(curObject, nodeCallBacks, nodeSpecificCallBacks = {}) {
|
|
9616
|
+
let callback;
|
|
9617
|
+
const casted = curObject;
|
|
9618
|
+
if (casted.type && casted.subType) {
|
|
9619
|
+
const specific = nodeSpecificCallBacks[casted.type];
|
|
9620
|
+
if (specific) {
|
|
9621
|
+
callback = specific[casted.subType];
|
|
9622
|
+
}
|
|
9623
|
+
}
|
|
9624
|
+
if (!callback && casted.type) {
|
|
9625
|
+
callback = nodeCallBacks[curObject.type];
|
|
9626
|
+
}
|
|
9627
|
+
let shouldIterate = true;
|
|
9628
|
+
if (callback) {
|
|
9629
|
+
shouldIterate = callback(curObject) ?? true;
|
|
9630
|
+
}
|
|
9631
|
+
if (shouldIterate) {
|
|
9632
|
+
for (const value of Object.values(curObject)) {
|
|
9633
|
+
this.safeObjectVisit(value, (obj) => this.visitNodeSpecific(obj, nodeCallBacks, nodeSpecificCallBacks));
|
|
9634
|
+
}
|
|
9635
|
+
}
|
|
9636
|
+
}
|
|
9637
|
+
};
|
|
9638
|
+
|
|
9639
|
+
// ../rules-sparql-1-1/lib/grammar/index.js
|
|
9640
|
+
var grammar_exports = {};
|
|
9641
|
+
__export(grammar_exports, {
|
|
9642
|
+
add: () => add2,
|
|
9643
|
+
additiveExpression: () => additiveExpression,
|
|
9644
|
+
aggregate: () => aggregate,
|
|
9645
|
+
aggregateAvg: () => aggregateAvg,
|
|
9646
|
+
aggregateCount: () => aggregateCount,
|
|
9647
|
+
aggregateGroup_concat: () => aggregateGroup_concat,
|
|
9648
|
+
aggregateMax: () => aggregateMax,
|
|
9649
|
+
aggregateMin: () => aggregateMin,
|
|
9650
|
+
aggregateSample: () => aggregateSample,
|
|
9651
|
+
aggregateSum: () => aggregateSum,
|
|
9652
|
+
argList: () => argList,
|
|
9653
|
+
askQuery: () => askQuery,
|
|
9654
|
+
baseAggregateFunc: () => baseAggregateFunc,
|
|
9655
|
+
baseDecl: () => baseDecl2,
|
|
9656
|
+
bind: () => bind2,
|
|
9657
|
+
blankNode: () => blankNode,
|
|
9658
|
+
blankNodePropertyList: () => blankNodePropertyList,
|
|
9659
|
+
blankNodePropertyListPath: () => blankNodePropertyListPath,
|
|
9660
|
+
booleanLiteral: () => booleanLiteral,
|
|
9661
|
+
brackettedExpression: () => brackettedExpression,
|
|
9662
|
+
builtInAbs: () => builtInAbs,
|
|
9663
|
+
builtInBnodeSparqlJs: () => builtInBnodeSparqlJs,
|
|
9664
|
+
builtInBound: () => builtInBound,
|
|
9665
|
+
builtInCall: () => builtInCall,
|
|
9666
|
+
builtInCallList: () => builtInCallList,
|
|
9667
|
+
builtInCeil: () => builtInCeil,
|
|
9668
|
+
builtInCoalesce: () => builtInCoalesce,
|
|
9669
|
+
builtInConcat: () => builtInConcat,
|
|
9670
|
+
builtInContains: () => builtInContains,
|
|
9671
|
+
builtInDatatype: () => builtInDatatype,
|
|
9672
|
+
builtInDay: () => builtInDay,
|
|
9673
|
+
builtInEncode_for_uri: () => builtInEncode_for_uri,
|
|
9674
|
+
builtInFloor: () => builtInFloor,
|
|
9675
|
+
builtInHours: () => builtInHours,
|
|
9676
|
+
builtInIf: () => builtInIf,
|
|
9677
|
+
builtInIri: () => builtInIri,
|
|
9678
|
+
builtInIsblank: () => builtInIsblank,
|
|
9679
|
+
builtInIsiri: () => builtInIsiri,
|
|
9680
|
+
builtInIsliteral: () => builtInIsliteral,
|
|
9681
|
+
builtInIsnumeric: () => builtInIsnumeric,
|
|
9682
|
+
builtInIsuri: () => builtInIsuri,
|
|
9683
|
+
builtInLang: () => builtInLang,
|
|
9684
|
+
builtInLangmatches: () => builtInLangmatches,
|
|
9685
|
+
builtInLcase: () => builtInLcase,
|
|
9686
|
+
builtInMd5: () => builtInMd5,
|
|
9687
|
+
builtInMinutes: () => builtInMinutes,
|
|
9688
|
+
builtInMonth: () => builtInMonth,
|
|
9689
|
+
builtInNow: () => builtInNow,
|
|
9690
|
+
builtInRand: () => builtInRand,
|
|
9691
|
+
builtInRound: () => builtInRound,
|
|
9692
|
+
builtInSameterm: () => builtInSameterm,
|
|
9693
|
+
builtInSeconds: () => builtInSeconds,
|
|
9694
|
+
builtInSha1: () => builtInSha1,
|
|
9695
|
+
builtInSha256: () => builtInSha256,
|
|
9696
|
+
builtInSha384: () => builtInSha384,
|
|
9697
|
+
builtInSha512: () => builtInSha512,
|
|
9698
|
+
builtInStr: () => builtInStr,
|
|
9699
|
+
builtInStrafter: () => builtInStrafter,
|
|
9700
|
+
builtInStrbefore: () => builtInStrbefore,
|
|
9701
|
+
builtInStrdt: () => builtInStrdt,
|
|
9702
|
+
builtInStrends: () => builtInStrends,
|
|
9703
|
+
builtInStrlang: () => builtInStrlang,
|
|
9704
|
+
builtInStrlen: () => builtInStrlen,
|
|
9705
|
+
builtInStrstarts: () => builtInStrstarts,
|
|
9706
|
+
builtInStruuid: () => builtInStruuid,
|
|
9707
|
+
builtInTimezone: () => builtInTimezone,
|
|
9708
|
+
builtInTz: () => builtInTz,
|
|
9709
|
+
builtInUcase: () => builtInUcase,
|
|
9710
|
+
builtInUri: () => builtInUri,
|
|
9711
|
+
builtInUuid: () => builtInUuid,
|
|
9712
|
+
builtInYear: () => builtInYear,
|
|
9713
|
+
canCreateBlankNodes: () => canCreateBlankNodes,
|
|
9714
|
+
clear: () => clear2,
|
|
9715
|
+
collection: () => collection,
|
|
9716
|
+
collectionPath: () => collectionPath,
|
|
9717
|
+
conditionalAndExpression: () => conditionalAndExpression,
|
|
9718
|
+
conditionalOrExpression: () => conditionalOrExpression,
|
|
9719
|
+
constraint: () => constraint,
|
|
9720
|
+
constructQuery: () => constructQuery,
|
|
9721
|
+
constructTemplate: () => constructTemplate,
|
|
9722
|
+
constructTriples: () => constructTriples,
|
|
9723
|
+
copy: () => copy2,
|
|
9724
|
+
create: () => create2,
|
|
9725
|
+
dataBlock: () => dataBlock,
|
|
9726
|
+
dataBlockValue: () => dataBlockValue,
|
|
9727
|
+
datasetClause: () => datasetClause,
|
|
9728
|
+
datasetClauseStar: () => datasetClauseStar,
|
|
9729
|
+
datasetClauseUsing: () => datasetClauseUsing,
|
|
9730
|
+
datasetClauseUsingStar: () => datasetClauseUsingStar,
|
|
9731
|
+
defaultGraphClause: () => defaultGraphClause,
|
|
9732
|
+
deleteClause: () => deleteClause2,
|
|
9733
|
+
deleteData: () => deleteData,
|
|
9734
|
+
deleteWhere: () => deleteWhere,
|
|
9735
|
+
describeQuery: () => describeQuery,
|
|
9736
|
+
drop: () => drop3,
|
|
9737
|
+
existsFunc: () => existsFunc,
|
|
9738
|
+
expression: () => expression,
|
|
9739
|
+
expressionList: () => expressionList,
|
|
9740
|
+
filter: () => filter3,
|
|
9741
|
+
funcExpr1: () => funcExpr1,
|
|
9742
|
+
funcExpr2: () => funcExpr2,
|
|
9743
|
+
funcExpr2or3: () => funcExpr2or3,
|
|
9744
|
+
funcExpr3: () => funcExpr3,
|
|
9745
|
+
funcExpr3or4: () => funcExpr3or4,
|
|
9746
|
+
funcExprList1: () => funcExprList1,
|
|
9747
|
+
funcExprOrNil1: () => funcExprOrNil1,
|
|
9748
|
+
funcGroupGraphPattern: () => funcGroupGraphPattern,
|
|
9749
|
+
funcNil1: () => funcNil1,
|
|
9750
|
+
funcVar1: () => funcVar1,
|
|
9751
|
+
functionCall: () => functionCall,
|
|
9752
|
+
generatePattern: () => generatePattern,
|
|
9753
|
+
graphGraphPattern: () => graphGraphPattern,
|
|
9754
|
+
graphNode: () => graphNode,
|
|
9755
|
+
graphNodePath: () => graphNodePath,
|
|
9756
|
+
graphOrDefault: () => graphOrDefault,
|
|
9757
|
+
graphPatternNotTriples: () => graphPatternNotTriples,
|
|
9758
|
+
graphRef: () => graphRef,
|
|
9759
|
+
graphRefAll: () => graphRefAll,
|
|
9760
|
+
graphTerm: () => graphTerm,
|
|
9761
|
+
groupClause: () => groupClause,
|
|
9762
|
+
groupCondition: () => groupCondition,
|
|
9763
|
+
groupGraphPattern: () => groupGraphPattern,
|
|
9764
|
+
groupGraphPatternSub: () => groupGraphPatternSub,
|
|
9765
|
+
groupOrUnionGraphPattern: () => groupOrUnionGraphPattern,
|
|
9766
|
+
havingClause: () => havingClause,
|
|
9767
|
+
havingCondition: () => havingCondition,
|
|
9768
|
+
inlineData: () => inlineData,
|
|
9769
|
+
inlineDataFull: () => inlineDataFull,
|
|
9770
|
+
inlineDataOneVar: () => inlineDataOneVar,
|
|
9771
|
+
insertClause: () => insertClause2,
|
|
9772
|
+
insertData: () => insertData,
|
|
9773
|
+
iri: () => iri2,
|
|
9774
|
+
iriFull: () => iriFull,
|
|
9775
|
+
iriOrFunction: () => iriOrFunction,
|
|
9776
|
+
limitClause: () => limitClause,
|
|
9777
|
+
limitOffsetClauses: () => limitOffsetClauses,
|
|
9778
|
+
load: () => load2,
|
|
9779
|
+
minusGraphPattern: () => minusGraphPattern,
|
|
9780
|
+
modify: () => modify,
|
|
9781
|
+
move: () => move2,
|
|
9782
|
+
multiplicativeExpression: () => multiplicativeExpression,
|
|
9783
|
+
namedGraphClause: () => namedGraphClause,
|
|
9784
|
+
notExistsFunc: () => notExistsFunc,
|
|
9785
|
+
numericExpression: () => numericExpression,
|
|
9786
|
+
numericLiteral: () => numericLiteral,
|
|
9787
|
+
numericLiteralNegative: () => numericLiteralNegative,
|
|
9788
|
+
numericLiteralPositive: () => numericLiteralPositive,
|
|
9789
|
+
numericLiteralUnsigned: () => numericLiteralUnsigned,
|
|
9790
|
+
object: () => object,
|
|
9791
|
+
objectList: () => objectList,
|
|
9792
|
+
objectListPath: () => objectListPath,
|
|
9793
|
+
objectPath: () => objectPath,
|
|
9794
|
+
offsetClause: () => offsetClause,
|
|
9795
|
+
optionalGraphPattern: () => optionalGraphPattern,
|
|
9796
|
+
orderClause: () => orderClause,
|
|
9797
|
+
orderCondition: () => orderCondition,
|
|
9798
|
+
path: () => path,
|
|
9799
|
+
pathAlternative: () => pathAlternative,
|
|
9800
|
+
pathChainHelper: () => pathChainHelper,
|
|
9801
|
+
pathElt: () => pathElt,
|
|
9802
|
+
pathEltOrInverse: () => pathEltOrInverse,
|
|
9803
|
+
pathGenerator: () => pathGenerator,
|
|
9804
|
+
pathMod: () => pathMod,
|
|
9805
|
+
pathNegatedPropertySet: () => pathNegatedPropertySet,
|
|
9806
|
+
pathOneInPropertySet: () => pathOneInPropertySet,
|
|
9807
|
+
pathPrimary: () => pathPrimary,
|
|
9808
|
+
pathSequence: () => pathSequence,
|
|
9809
|
+
prefixDecl: () => prefixDecl2,
|
|
9810
|
+
prefixedName: () => prefixedName,
|
|
9811
|
+
primaryExpression: () => primaryExpression,
|
|
9812
|
+
prologue: () => prologue,
|
|
9813
|
+
propertyList: () => propertyList,
|
|
9814
|
+
propertyListNotEmpty: () => propertyListNotEmpty,
|
|
9815
|
+
propertyListPath: () => propertyListPath,
|
|
9816
|
+
propertyListPathNotEmpty: () => propertyListPathNotEmpty,
|
|
9817
|
+
quadData: () => quadData,
|
|
9818
|
+
quadPattern: () => quadPattern,
|
|
9819
|
+
quads: () => quads,
|
|
9820
|
+
quadsNotTriples: () => quadsNotTriples,
|
|
9821
|
+
query: () => query,
|
|
9822
|
+
queryOrUpdate: () => queryOrUpdate,
|
|
9823
|
+
queryUnit: () => queryUnit,
|
|
9824
|
+
rdfLiteral: () => rdfLiteral,
|
|
9825
|
+
regexExpression: () => regexExpression,
|
|
9826
|
+
relationalExpression: () => relationalExpression,
|
|
9827
|
+
selectClause: () => selectClause,
|
|
9828
|
+
selectQuery: () => selectQuery,
|
|
9829
|
+
serviceGraphPattern: () => serviceGraphPattern,
|
|
9830
|
+
solutionModifier: () => solutionModifier,
|
|
9831
|
+
sourceSelector: () => sourceSelector,
|
|
9832
|
+
strReplaceExpression: () => strReplaceExpression,
|
|
9833
|
+
string: () => string,
|
|
9834
|
+
stringEscapedLexical: () => stringEscapedLexical,
|
|
9835
|
+
subSelect: () => subSelect,
|
|
9836
|
+
substringExpression: () => substringExpression,
|
|
9837
|
+
triplesBlock: () => triplesBlock,
|
|
9838
|
+
triplesNode: () => triplesNode,
|
|
9839
|
+
triplesNodePath: () => triplesNodePath,
|
|
9840
|
+
triplesSameSubject: () => triplesSameSubject,
|
|
9841
|
+
triplesSameSubjectPath: () => triplesSameSubjectPath,
|
|
9842
|
+
triplesTemplate: () => triplesTemplate,
|
|
9843
|
+
unaryExpression: () => unaryExpression,
|
|
9844
|
+
update: () => update,
|
|
9845
|
+
update1: () => update1,
|
|
9846
|
+
updateUnit: () => updateUnit,
|
|
9847
|
+
usingClause: () => usingClause2,
|
|
9848
|
+
usingClauseStar: () => usingClauseStar,
|
|
9849
|
+
valueLogical: () => valueLogical,
|
|
9850
|
+
valuesClause: () => valuesClause,
|
|
9851
|
+
varOrIri: () => varOrIri,
|
|
9852
|
+
varOrTerm: () => varOrTerm,
|
|
9853
|
+
var_: () => var_,
|
|
9854
|
+
verb: () => verb,
|
|
9855
|
+
verbA: () => verbA,
|
|
9856
|
+
verbPath: () => verbPath,
|
|
9857
|
+
verbSimple: () => verbSimple,
|
|
9858
|
+
whereClause: () => whereClause
|
|
9859
|
+
});
|
|
9874
9860
|
|
|
9875
|
-
// ../
|
|
9876
|
-
var
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9895
|
-
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9902
|
-
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
transformNodeSpecific(curObject, nodeCallBacks, nodeSpecificCallBacks = {}) {
|
|
9934
|
-
let continueCheck;
|
|
9935
|
-
let transformation;
|
|
9936
|
-
const casted = curObject;
|
|
9937
|
-
if (casted.type && casted.subType) {
|
|
9938
|
-
const specific = nodeSpecificCallBacks[casted.type];
|
|
9939
|
-
if (specific) {
|
|
9940
|
-
continueCheck = specific[casted.subType]?.continue;
|
|
9941
|
-
transformation = specific[casted.subType]?.transform;
|
|
9942
|
-
}
|
|
9943
|
-
}
|
|
9944
|
-
let shouldContinue = true;
|
|
9945
|
-
if (continueCheck) {
|
|
9946
|
-
shouldContinue = continueCheck(curObject);
|
|
9947
|
-
}
|
|
9948
|
-
if (!shouldContinue) {
|
|
9949
|
-
return curObject;
|
|
9950
|
-
}
|
|
9951
|
-
const copy3 = { ...curObject };
|
|
9952
|
-
for (const [key, value] of Object.entries(copy3)) {
|
|
9953
|
-
copy3[key] = this.safeObjectVisit(value, (obj) => this.transformNodeSpecific(obj, nodeCallBacks, nodeSpecificCallBacks));
|
|
9954
|
-
}
|
|
9955
|
-
if (transformation) {
|
|
9956
|
-
return transformation(copy3);
|
|
9957
|
-
}
|
|
9958
|
-
return copy3;
|
|
9959
|
-
}
|
|
9960
|
-
/**
|
|
9961
|
-
* When both nodeCallBack and NodeSpecific callBack are matched, will only look at nodeSpecifCallback
|
|
9962
|
-
*/
|
|
9963
|
-
visitNodeSpecific(curObject, nodeCallBacks, nodeSpecificCallBacks = {}) {
|
|
9964
|
-
let callback;
|
|
9965
|
-
const casted = curObject;
|
|
9966
|
-
if (casted.type && casted.subType) {
|
|
9967
|
-
const specific = nodeSpecificCallBacks[casted.type];
|
|
9968
|
-
if (specific) {
|
|
9969
|
-
callback = specific[casted.subType];
|
|
9970
|
-
}
|
|
9971
|
-
}
|
|
9972
|
-
if (!callback && casted.type) {
|
|
9973
|
-
callback = nodeCallBacks[curObject.type];
|
|
9974
|
-
}
|
|
9975
|
-
let shouldIterate = true;
|
|
9976
|
-
if (callback) {
|
|
9977
|
-
shouldIterate = callback(curObject) ?? true;
|
|
9978
|
-
}
|
|
9979
|
-
if (shouldIterate) {
|
|
9980
|
-
for (const value of Object.values(curObject)) {
|
|
9981
|
-
this.safeObjectVisit(value, (obj) => this.visitNodeSpecific(obj, nodeCallBacks, nodeSpecificCallBacks));
|
|
9982
|
-
}
|
|
9983
|
-
}
|
|
9984
|
-
}
|
|
9985
|
-
};
|
|
9861
|
+
// ../rules-sparql-1-1/lib/lexer/index.js
|
|
9862
|
+
var lexer_exports = {};
|
|
9863
|
+
__export(lexer_exports, {
|
|
9864
|
+
a: () => a,
|
|
9865
|
+
add: () => add,
|
|
9866
|
+
allBaseTokens: () => allBaseTokens,
|
|
9867
|
+
as: () => as,
|
|
9868
|
+
ask: () => ask,
|
|
9869
|
+
baseDecl: () => baseDecl,
|
|
9870
|
+
bind: () => bind,
|
|
9871
|
+
builtIn: () => BuiltInCalls_exports,
|
|
9872
|
+
by: () => by,
|
|
9873
|
+
clear: () => clear,
|
|
9874
|
+
construct: () => construct,
|
|
9875
|
+
copy: () => copy,
|
|
9876
|
+
create: () => create,
|
|
9877
|
+
dataClause: () => dataClause,
|
|
9878
|
+
deleteClause: () => deleteClause,
|
|
9879
|
+
describe: () => describe,
|
|
9880
|
+
distinct: () => distinct,
|
|
9881
|
+
drop: () => drop2,
|
|
9882
|
+
false_: () => false_,
|
|
9883
|
+
filter: () => filter2,
|
|
9884
|
+
from: () => from,
|
|
9885
|
+
graph: () => graph_exports,
|
|
9886
|
+
groupByGroup: () => groupByGroup,
|
|
9887
|
+
having: () => having,
|
|
9888
|
+
in_: () => in_,
|
|
9889
|
+
insertClause: () => insertClause,
|
|
9890
|
+
limit: () => limit,
|
|
9891
|
+
load: () => load,
|
|
9892
|
+
loadInto: () => loadInto,
|
|
9893
|
+
minus: () => minus,
|
|
9894
|
+
modifyWith: () => modifyWith,
|
|
9895
|
+
move: () => move,
|
|
9896
|
+
notIn: () => notIn,
|
|
9897
|
+
offset: () => offset,
|
|
9898
|
+
optional: () => optional,
|
|
9899
|
+
order: () => order,
|
|
9900
|
+
orderAsc: () => orderAsc,
|
|
9901
|
+
orderDesc: () => orderDesc,
|
|
9902
|
+
prefixDecl: () => prefixDecl,
|
|
9903
|
+
reduced: () => reduced,
|
|
9904
|
+
select: () => select,
|
|
9905
|
+
separator: () => separator,
|
|
9906
|
+
service: () => service,
|
|
9907
|
+
silent: () => silent,
|
|
9908
|
+
sparql11LexerBuilder: () => sparql11LexerBuilder,
|
|
9909
|
+
symbols: () => symbols_exports,
|
|
9910
|
+
terminals: () => terminals_exports,
|
|
9911
|
+
to: () => to,
|
|
9912
|
+
true_: () => true_,
|
|
9913
|
+
undef: () => undef,
|
|
9914
|
+
union: () => union,
|
|
9915
|
+
usingClause: () => usingClause,
|
|
9916
|
+
values: () => values2,
|
|
9917
|
+
where: () => where
|
|
9918
|
+
});
|
|
9986
9919
|
|
|
9987
9920
|
// ../rules-sparql-1-1/lib/lexer/BuiltInCalls.js
|
|
9921
|
+
var BuiltInCalls_exports = {};
|
|
9922
|
+
__export(BuiltInCalls_exports, {
|
|
9923
|
+
BuiltInCalls: () => BuiltInCalls,
|
|
9924
|
+
abs: () => abs,
|
|
9925
|
+
allBuiltInCalls: () => allBuiltInCalls,
|
|
9926
|
+
avg: () => avg,
|
|
9927
|
+
bnode: () => bnode,
|
|
9928
|
+
bound: () => bound,
|
|
9929
|
+
ceil: () => ceil,
|
|
9930
|
+
coalesce: () => coalesce,
|
|
9931
|
+
concat: () => concat,
|
|
9932
|
+
contains: () => contains,
|
|
9933
|
+
count: () => count,
|
|
9934
|
+
datatype: () => datatype,
|
|
9935
|
+
day: () => day,
|
|
9936
|
+
encode_for_uri: () => encode_for_uri,
|
|
9937
|
+
exists: () => exists,
|
|
9938
|
+
floor: () => floor,
|
|
9939
|
+
groupConcat: () => groupConcat,
|
|
9940
|
+
hours: () => hours,
|
|
9941
|
+
if_: () => if_,
|
|
9942
|
+
iri: () => iri,
|
|
9943
|
+
isblank: () => isblank,
|
|
9944
|
+
isiri: () => isiri,
|
|
9945
|
+
isliteral: () => isliteral,
|
|
9946
|
+
isnumeric: () => isnumeric,
|
|
9947
|
+
isuri: () => isuri,
|
|
9948
|
+
lang: () => lang,
|
|
9949
|
+
langmatches: () => langmatches,
|
|
9950
|
+
lcase: () => lcase,
|
|
9951
|
+
max: () => max,
|
|
9952
|
+
md5: () => md5,
|
|
9953
|
+
min: () => min,
|
|
9954
|
+
minutes: () => minutes,
|
|
9955
|
+
month: () => month,
|
|
9956
|
+
notexists: () => notexists,
|
|
9957
|
+
now: () => now,
|
|
9958
|
+
rand: () => rand,
|
|
9959
|
+
regex: () => regex,
|
|
9960
|
+
replace: () => replace,
|
|
9961
|
+
round: () => round,
|
|
9962
|
+
sameterm: () => sameterm,
|
|
9963
|
+
sample: () => sample,
|
|
9964
|
+
seconds: () => seconds,
|
|
9965
|
+
sha1: () => sha1,
|
|
9966
|
+
sha256: () => sha256,
|
|
9967
|
+
sha384: () => sha384,
|
|
9968
|
+
sha512: () => sha512,
|
|
9969
|
+
str: () => str,
|
|
9970
|
+
strafter: () => strafter,
|
|
9971
|
+
strbefore: () => strbefore,
|
|
9972
|
+
strdt: () => strdt,
|
|
9973
|
+
strends: () => strends,
|
|
9974
|
+
strlang: () => strlang,
|
|
9975
|
+
strlen: () => strlen,
|
|
9976
|
+
strstarts: () => strstarts,
|
|
9977
|
+
struuid: () => struuid,
|
|
9978
|
+
substr: () => substr,
|
|
9979
|
+
sum: () => sum,
|
|
9980
|
+
timezone: () => timezone,
|
|
9981
|
+
tz: () => tz,
|
|
9982
|
+
ucase: () => ucase,
|
|
9983
|
+
uri: () => uri,
|
|
9984
|
+
uuid: () => uuid,
|
|
9985
|
+
year: () => year
|
|
9986
|
+
});
|
|
9988
9987
|
var BuiltInCalls;
|
|
9989
9988
|
(function(BuiltInCalls2) {
|
|
9990
9989
|
BuiltInCalls2["Str"] = "builtInStr";
|
|
@@ -11031,8 +11030,8 @@ function UpdateOperationFactoryMixin(Base) {
|
|
|
11031
11030
|
};
|
|
11032
11031
|
}
|
|
11033
11032
|
|
|
11034
|
-
// ../rules-sparql-1-1/lib/
|
|
11035
|
-
var
|
|
11033
|
+
// ../rules-sparql-1-1/lib/astFactory.js
|
|
11034
|
+
var AstFactory = class extends asArg(AstCoreFactory).call(ContextFactoryMixin).call(ExpressionFactoryMixin).call(GraphRefFactoryMixin).call(PathFactoryMixin).call(PatternFactoryMixin).call(QueryFactoryMixin).call(SolutionModifiersFactoryMixin).call(TermFactoryMixin).call(UpdateOperationFactoryMixin).returns() {
|
|
11036
11035
|
alwaysSparql11(obj) {
|
|
11037
11036
|
return true;
|
|
11038
11037
|
}
|
|
@@ -11133,7 +11132,7 @@ var TransformerSparql11 = class extends TransformerSubType {
|
|
|
11133
11132
|
};
|
|
11134
11133
|
|
|
11135
11134
|
// ../rules-sparql-1-1/lib/validation/validators.js
|
|
11136
|
-
var F = new
|
|
11135
|
+
var F = new AstFactory();
|
|
11137
11136
|
var transformer = new TransformerSparql11();
|
|
11138
11137
|
function getAggregatesOfExpression(expression2) {
|
|
11139
11138
|
if (F.isExpressionAggregate(expression2)) {
|
|
@@ -11353,22 +11352,22 @@ var rdfLiteral = {
|
|
|
11353
11352
|
return OPTION(() => OR([
|
|
11354
11353
|
{ ALT: () => {
|
|
11355
11354
|
const lang2 = CONSUME(terminals_exports.langTag);
|
|
11356
|
-
return ACTION(() => C.
|
|
11355
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, lang2), value.value, lang2.image.slice(1).toLowerCase()));
|
|
11357
11356
|
} },
|
|
11358
11357
|
{ ALT: () => {
|
|
11359
11358
|
CONSUME(symbols_exports.hathat);
|
|
11360
11359
|
const iriVal = SUBRULE1(iri2);
|
|
11361
|
-
return ACTION(() => C.
|
|
11360
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
|
|
11362
11361
|
} }
|
|
11363
11362
|
])) ?? value;
|
|
11364
11363
|
},
|
|
11365
|
-
gImpl: ({ SUBRULE, PRINT, PRINT_SPACE_LEFT }) => (ast, {
|
|
11366
|
-
|
|
11364
|
+
gImpl: ({ SUBRULE, PRINT, PRINT_SPACE_LEFT }) => (ast, { astFactory }) => {
|
|
11365
|
+
astFactory.printFilter(ast, () => PRINT_SPACE_LEFT(stringEscapedLexical(ast.value)));
|
|
11367
11366
|
if (ast.langOrIri) {
|
|
11368
11367
|
if (typeof ast.langOrIri === "string") {
|
|
11369
|
-
|
|
11368
|
+
astFactory.printFilter(ast, () => PRINT("@", ast.langOrIri));
|
|
11370
11369
|
} else {
|
|
11371
|
-
|
|
11370
|
+
astFactory.printFilter(ast, () => PRINT("^^"));
|
|
11372
11371
|
SUBRULE(iri2, ast.langOrIri);
|
|
11373
11372
|
}
|
|
11374
11373
|
}
|
|
@@ -11390,7 +11389,7 @@ var numericLiteralUnsigned = {
|
|
|
11390
11389
|
{ ALT: () => [CONSUME(terminals_exports.decimal), CommonIRIs.DECIMAL] },
|
|
11391
11390
|
{ ALT: () => [CONSUME(terminals_exports.double), CommonIRIs.DOUBLE] }
|
|
11392
11391
|
]);
|
|
11393
|
-
return ACTION(() => C.
|
|
11392
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11394
11393
|
}
|
|
11395
11394
|
};
|
|
11396
11395
|
var numericLiteralPositive = {
|
|
@@ -11401,7 +11400,7 @@ var numericLiteralPositive = {
|
|
|
11401
11400
|
{ ALT: () => [CONSUME(terminals_exports.decimalPositive), CommonIRIs.DECIMAL] },
|
|
11402
11401
|
{ ALT: () => [CONSUME(terminals_exports.doublePositive), CommonIRIs.DOUBLE] }
|
|
11403
11402
|
]);
|
|
11404
|
-
return ACTION(() => C.
|
|
11403
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11405
11404
|
}
|
|
11406
11405
|
};
|
|
11407
11406
|
var numericLiteralNegative = {
|
|
@@ -11412,7 +11411,7 @@ var numericLiteralNegative = {
|
|
|
11412
11411
|
{ ALT: () => [CONSUME(terminals_exports.decimalNegative), CommonIRIs.DECIMAL] },
|
|
11413
11412
|
{ ALT: () => [CONSUME(terminals_exports.doubleNegative), CommonIRIs.DOUBLE] }
|
|
11414
11413
|
]);
|
|
11415
|
-
return ACTION(() => C.
|
|
11414
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(parsed[0]), parsed[0].image, C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), parsed[1])));
|
|
11416
11415
|
}
|
|
11417
11416
|
};
|
|
11418
11417
|
var booleanLiteral = {
|
|
@@ -11422,7 +11421,7 @@ var booleanLiteral = {
|
|
|
11422
11421
|
{ ALT: () => CONSUME(true_) },
|
|
11423
11422
|
{ ALT: () => CONSUME(false_) }
|
|
11424
11423
|
]);
|
|
11425
|
-
return ACTION(() => C.
|
|
11424
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(token), token.image.toLowerCase(), C.astFactory.namedNode(C.astFactory.sourceLocationNoMaterialize(), CommonIRIs.BOOLEAN)));
|
|
11426
11425
|
}
|
|
11427
11426
|
};
|
|
11428
11427
|
var string = {
|
|
@@ -11447,7 +11446,7 @@ var string = {
|
|
|
11447
11446
|
} }
|
|
11448
11447
|
]);
|
|
11449
11448
|
return ACTION(() => {
|
|
11450
|
-
const F3 = C.
|
|
11449
|
+
const F3 = C.astFactory;
|
|
11451
11450
|
const value = x[1].replaceAll(/\\([tnrbf"'\\])/gu, (_, char) => {
|
|
11452
11451
|
switch (char) {
|
|
11453
11452
|
case "t":
|
|
@@ -11474,16 +11473,16 @@ var iri2 = {
|
|
|
11474
11473
|
{ ALT: () => SUBRULE(iriFull) },
|
|
11475
11474
|
{ ALT: () => SUBRULE(prefixedName) }
|
|
11476
11475
|
]),
|
|
11477
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11476
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => F3.isTermNamedPrefixed(ast) ? SUBRULE(prefixedName, ast) : SUBRULE(iriFull, ast)
|
|
11478
11477
|
};
|
|
11479
11478
|
var iriFull = {
|
|
11480
11479
|
name: "iriFull",
|
|
11481
11480
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
11482
11481
|
const iriToken = CONSUME(terminals_exports.iriRef);
|
|
11483
|
-
return ACTION(() => C.
|
|
11482
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(iriToken), iriToken.image.slice(1, -1)));
|
|
11484
11483
|
},
|
|
11485
|
-
gImpl: ({ PRINT }) => (ast, {
|
|
11486
|
-
|
|
11484
|
+
gImpl: ({ PRINT }) => (ast, { astFactory: F3 }) => {
|
|
11485
|
+
F3.printFilter(ast, () => PRINT("<", ast.value, ">"));
|
|
11487
11486
|
}
|
|
11488
11487
|
};
|
|
11489
11488
|
var prefixedName = {
|
|
@@ -11493,16 +11492,16 @@ var prefixedName = {
|
|
|
11493
11492
|
const longName = CONSUME(terminals_exports.pNameLn);
|
|
11494
11493
|
return ACTION(() => {
|
|
11495
11494
|
const [prefix, localName] = longName.image.split(":");
|
|
11496
|
-
return C.
|
|
11495
|
+
return C.astFactory.namedNode(C.astFactory.sourceLocation(longName), localName, prefix);
|
|
11497
11496
|
});
|
|
11498
11497
|
} },
|
|
11499
11498
|
{ ALT: () => {
|
|
11500
11499
|
const shortName = CONSUME(terminals_exports.pNameNs);
|
|
11501
|
-
return ACTION(() => C.
|
|
11500
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(shortName), "", shortName.image.slice(0, -1)));
|
|
11502
11501
|
} }
|
|
11503
11502
|
]),
|
|
11504
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11505
|
-
|
|
11503
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11504
|
+
F3.printFilter(ast, () => PRINT_WORD(ast.prefix, ":", ast.value));
|
|
11506
11505
|
}
|
|
11507
11506
|
};
|
|
11508
11507
|
var canCreateBlankNodes = Symbol("canCreateBlankNodes");
|
|
@@ -11512,11 +11511,11 @@ var blankNode = {
|
|
|
11512
11511
|
const result = OR([
|
|
11513
11512
|
{ ALT: () => {
|
|
11514
11513
|
const labelToken = CONSUME(terminals_exports.blankNodeLabel);
|
|
11515
|
-
return ACTION(() => C.
|
|
11514
|
+
return ACTION(() => C.astFactory.blankNode(labelToken.image.slice(2), C.astFactory.sourceLocation(labelToken)));
|
|
11516
11515
|
} },
|
|
11517
11516
|
{ ALT: () => {
|
|
11518
11517
|
const anonToken = CONSUME(terminals_exports.anon);
|
|
11519
|
-
return ACTION(() => C.
|
|
11518
|
+
return ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocation(anonToken)));
|
|
11520
11519
|
} }
|
|
11521
11520
|
]);
|
|
11522
11521
|
ACTION(() => {
|
|
@@ -11526,15 +11525,15 @@ var blankNode = {
|
|
|
11526
11525
|
});
|
|
11527
11526
|
return result;
|
|
11528
11527
|
},
|
|
11529
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11530
|
-
|
|
11528
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory }) => {
|
|
11529
|
+
astFactory.printFilter(ast, () => PRINT_WORD("_:", ast.label.replace(/^e_/u, "")));
|
|
11531
11530
|
}
|
|
11532
11531
|
};
|
|
11533
11532
|
var verbA = {
|
|
11534
11533
|
name: "VerbA",
|
|
11535
11534
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
11536
11535
|
const token = CONSUME(a);
|
|
11537
|
-
return ACTION(() => C.
|
|
11536
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.TYPE, void 0));
|
|
11538
11537
|
}
|
|
11539
11538
|
};
|
|
11540
11539
|
|
|
@@ -11551,7 +11550,7 @@ var prologue = {
|
|
|
11551
11550
|
]));
|
|
11552
11551
|
return result;
|
|
11553
11552
|
},
|
|
11554
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11553
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11555
11554
|
for (const context of ast) {
|
|
11556
11555
|
if (F3.isContextDefinitionBase(context)) {
|
|
11557
11556
|
SUBRULE(baseDecl2, context);
|
|
@@ -11566,11 +11565,12 @@ var baseDecl2 = {
|
|
|
11566
11565
|
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
11567
11566
|
const base = CONSUME(baseDecl);
|
|
11568
11567
|
const val = SUBRULE(iriFull);
|
|
11569
|
-
return ACTION(() => C.
|
|
11568
|
+
return ACTION(() => C.astFactory.contextDefinitionBase(C.astFactory.sourceLocation(base, val), val));
|
|
11570
11569
|
},
|
|
11571
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
11570
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11572
11571
|
F3.printFilter(ast, () => PRINT_WORD("BASE"));
|
|
11573
11572
|
SUBRULE(iri2, ast.value);
|
|
11573
|
+
F3.printFilter(ast, () => PRINT_WORD("\n"));
|
|
11574
11574
|
}
|
|
11575
11575
|
};
|
|
11576
11576
|
var prefixDecl2 = {
|
|
@@ -11579,13 +11579,14 @@ var prefixDecl2 = {
|
|
|
11579
11579
|
const prefix = CONSUME(prefixDecl);
|
|
11580
11580
|
const name = CONSUME(terminals_exports.pNameNs).image.slice(0, -1);
|
|
11581
11581
|
const value = SUBRULE(iriFull);
|
|
11582
|
-
return ACTION(() => C.
|
|
11582
|
+
return ACTION(() => C.astFactory.contextDefinitionPrefix(C.astFactory.sourceLocation(prefix, value), name, value));
|
|
11583
11583
|
},
|
|
11584
|
-
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, {
|
|
11584
|
+
gImpl: ({ SUBRULE, PRINT_WORDS }) => (ast, { astFactory: F3 }) => {
|
|
11585
11585
|
F3.printFilter(ast, () => {
|
|
11586
11586
|
PRINT_WORDS("PREFIX", `${ast.key}:`);
|
|
11587
11587
|
});
|
|
11588
11588
|
SUBRULE(iri2, ast.value);
|
|
11589
|
+
F3.printFilter(ast, () => PRINT_WORDS("\n"));
|
|
11589
11590
|
}
|
|
11590
11591
|
};
|
|
11591
11592
|
var verb = {
|
|
@@ -11601,7 +11602,7 @@ var varOrTerm = {
|
|
|
11601
11602
|
{ GATE: () => C.parseMode.has("canParseVars"), ALT: () => SUBRULE(var_) },
|
|
11602
11603
|
{ ALT: () => SUBRULE(graphTerm) }
|
|
11603
11604
|
]),
|
|
11604
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11605
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11605
11606
|
if (F3.isTermVariable(ast)) {
|
|
11606
11607
|
return SUBRULE(var_, ast);
|
|
11607
11608
|
}
|
|
@@ -11622,9 +11623,9 @@ var var_ = {
|
|
|
11622
11623
|
{ ALT: () => CONSUME(terminals_exports.var1) },
|
|
11623
11624
|
{ ALT: () => CONSUME(terminals_exports.var2) }
|
|
11624
11625
|
]);
|
|
11625
|
-
return ACTION(() => C.
|
|
11626
|
+
return ACTION(() => C.astFactory.variable(varToken.image.slice(1), C.astFactory.sourceLocation(varToken)));
|
|
11626
11627
|
},
|
|
11627
|
-
gImpl: ({ PRINT_WORD }) => (ast, {
|
|
11628
|
+
gImpl: ({ PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11628
11629
|
F3.printFilter(ast, () => PRINT_WORD(`?${ast.value}`));
|
|
11629
11630
|
}
|
|
11630
11631
|
};
|
|
@@ -11638,10 +11639,10 @@ var graphTerm = {
|
|
|
11638
11639
|
{ GATE: () => C.parseMode.has("canCreateBlankNodes"), ALT: () => SUBRULE(blankNode) },
|
|
11639
11640
|
{ ALT: () => {
|
|
11640
11641
|
const tokenNil = CONSUME(terminals_exports.nil);
|
|
11641
|
-
return ACTION(() => C.
|
|
11642
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(tokenNil), CommonIRIs.NIL));
|
|
11642
11643
|
} }
|
|
11643
11644
|
]),
|
|
11644
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
11645
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
11645
11646
|
if (F3.isTermNamed(ast)) {
|
|
11646
11647
|
SUBRULE(iri2, ast);
|
|
11647
11648
|
} else if (F3.isTermLiteral(ast)) {
|
|
@@ -11661,14 +11662,14 @@ function datasetClauseUsing(name, token) {
|
|
|
11661
11662
|
return OR([
|
|
11662
11663
|
{ ALT: () => {
|
|
11663
11664
|
const iri3 = SUBRULE(defaultGraphClause);
|
|
11664
|
-
return ACTION(() => C.
|
|
11665
|
+
return ACTION(() => C.astFactory.wrap({ clauseType: "default", value: iri3 }, C.astFactory.sourceLocation(start, iri3)));
|
|
11665
11666
|
} },
|
|
11666
11667
|
{ ALT: () => {
|
|
11667
11668
|
const namedClause = SUBRULE(namedGraphClause);
|
|
11668
|
-
return ACTION(() => C.
|
|
11669
|
+
return ACTION(() => C.astFactory.wrap({
|
|
11669
11670
|
clauseType: "named",
|
|
11670
11671
|
value: namedClause.val
|
|
11671
|
-
}, C.
|
|
11672
|
+
}, C.astFactory.sourceLocation(start, namedClause)));
|
|
11672
11673
|
} }
|
|
11673
11674
|
]);
|
|
11674
11675
|
}
|
|
@@ -11689,9 +11690,9 @@ function datasetClauseUsingStar(name, subRule, fromUsing) {
|
|
|
11689
11690
|
const clause = SUBRULE(subRule);
|
|
11690
11691
|
clauses.push(clause);
|
|
11691
11692
|
});
|
|
11692
|
-
return ACTION(() => C.
|
|
11693
|
+
return ACTION(() => C.astFactory.datasetClauses(clauses.map((clause) => clause.val), C.astFactory.sourceLocation(...clauses)));
|
|
11693
11694
|
},
|
|
11694
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
11695
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
11695
11696
|
for (const clause of ast.clauses) {
|
|
11696
11697
|
F3.printFilter(ast, () => PRINT_WORD(fromUsing));
|
|
11697
11698
|
if (clause.clauseType === "named") {
|
|
@@ -11709,7 +11710,7 @@ var namedGraphClause = {
|
|
|
11709
11710
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
11710
11711
|
const named2 = CONSUME(graph_exports.named);
|
|
11711
11712
|
const iri3 = SUBRULE(sourceSelector);
|
|
11712
|
-
return ACTION(() => C.
|
|
11713
|
+
return ACTION(() => C.astFactory.wrap(iri3, C.astFactory.sourceLocation(named2, iri3)));
|
|
11713
11714
|
}
|
|
11714
11715
|
};
|
|
11715
11716
|
var sourceSelector = {
|
|
@@ -11726,7 +11727,7 @@ function funcExpr1(func) {
|
|
|
11726
11727
|
CONSUME(symbols_exports.LParen);
|
|
11727
11728
|
const arg = SUBRULE(expression);
|
|
11728
11729
|
const close = CONSUME(symbols_exports.RParen);
|
|
11729
|
-
return ACTION(() => C.
|
|
11730
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
11730
11731
|
}
|
|
11731
11732
|
};
|
|
11732
11733
|
}
|
|
@@ -11740,7 +11741,7 @@ function funcExpr2(func) {
|
|
|
11740
11741
|
CONSUME(symbols_exports.comma);
|
|
11741
11742
|
const arg2 = SUBRULE2(expression);
|
|
11742
11743
|
const close = CONSUME(symbols_exports.RParen);
|
|
11743
|
-
return ACTION(() => C.
|
|
11744
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg1, arg2], C.astFactory.sourceLocation(operator, close)));
|
|
11744
11745
|
}
|
|
11745
11746
|
};
|
|
11746
11747
|
}
|
|
@@ -11756,7 +11757,7 @@ function funcExpr3(func) {
|
|
|
11756
11757
|
CONSUME2(symbols_exports.comma);
|
|
11757
11758
|
const arg3 = SUBRULE3(expression);
|
|
11758
11759
|
const close = CONSUME(symbols_exports.RParen);
|
|
11759
|
-
return ACTION(() => C.
|
|
11760
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg1, arg2, arg3], C.astFactory.sourceLocation(operator, close)));
|
|
11760
11761
|
}
|
|
11761
11762
|
};
|
|
11762
11763
|
}
|
|
@@ -11768,7 +11769,7 @@ function funcVar1(func) {
|
|
|
11768
11769
|
CONSUME(symbols_exports.LParen);
|
|
11769
11770
|
const arg = SUBRULE(var_);
|
|
11770
11771
|
const close = CONSUME(symbols_exports.RParen);
|
|
11771
|
-
return ACTION(() => C.
|
|
11772
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
11772
11773
|
}
|
|
11773
11774
|
};
|
|
11774
11775
|
}
|
|
@@ -11782,11 +11783,11 @@ function funcExprOrNil1(func) {
|
|
|
11782
11783
|
CONSUME(symbols_exports.LParen);
|
|
11783
11784
|
const arg = SUBRULE(expression);
|
|
11784
11785
|
const close = CONSUME(symbols_exports.RParen);
|
|
11785
|
-
return ACTION(() => C.
|
|
11786
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [arg], C.astFactory.sourceLocation(operator, close)));
|
|
11786
11787
|
} },
|
|
11787
11788
|
{ ALT: () => {
|
|
11788
11789
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
11789
|
-
return ACTION(() => C.
|
|
11790
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [], C.astFactory.sourceLocation(operator, nil2)));
|
|
11790
11791
|
} }
|
|
11791
11792
|
]);
|
|
11792
11793
|
}
|
|
@@ -11798,7 +11799,7 @@ function funcNil1(func) {
|
|
|
11798
11799
|
impl: ({ ACTION, CONSUME }) => (C) => {
|
|
11799
11800
|
const operator = CONSUME(func);
|
|
11800
11801
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
11801
|
-
return ACTION(() => C.
|
|
11802
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [], C.astFactory.sourceLocation(operator, nil2)));
|
|
11802
11803
|
}
|
|
11803
11804
|
};
|
|
11804
11805
|
}
|
|
@@ -11808,7 +11809,7 @@ function funcExprList1(func) {
|
|
|
11808
11809
|
impl: ({ ACTION, CONSUME, SUBRULE }) => (C) => {
|
|
11809
11810
|
const operator = CONSUME(func);
|
|
11810
11811
|
const args = SUBRULE(expressionList);
|
|
11811
|
-
return ACTION(() => C.
|
|
11812
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, args.val, C.astFactory.sourceLocation(operator, args)));
|
|
11812
11813
|
}
|
|
11813
11814
|
};
|
|
11814
11815
|
}
|
|
@@ -11826,7 +11827,7 @@ function funcExpr2or3(func) {
|
|
|
11826
11827
|
return SUBRULE3(expression);
|
|
11827
11828
|
});
|
|
11828
11829
|
const close = CONSUME(symbols_exports.RParen);
|
|
11829
|
-
return ACTION(() => C.
|
|
11830
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, arg3 ? [arg1, arg2, arg3] : [arg1, arg2], C.astFactory.sourceLocation(operator, close)));
|
|
11830
11831
|
}
|
|
11831
11832
|
};
|
|
11832
11833
|
}
|
|
@@ -11846,7 +11847,7 @@ function funcExpr3or4(func) {
|
|
|
11846
11847
|
return SUBRULE4(expression);
|
|
11847
11848
|
});
|
|
11848
11849
|
const close = CONSUME(symbols_exports.RParen);
|
|
11849
|
-
return ACTION(() => C.
|
|
11850
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, arg4 ? [arg1, arg2, arg3, arg4] : [arg1, arg2, arg3], C.astFactory.sourceLocation(operator, close)));
|
|
11850
11851
|
}
|
|
11851
11852
|
};
|
|
11852
11853
|
}
|
|
@@ -11856,7 +11857,7 @@ function funcGroupGraphPattern(func) {
|
|
|
11856
11857
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
11857
11858
|
const operator = CONSUME(func);
|
|
11858
11859
|
const group = SUBRULE(groupGraphPattern);
|
|
11859
|
-
return ACTION(() => C.
|
|
11860
|
+
return ACTION(() => C.astFactory.expressionPatternOperation(operator.image, group, C.astFactory.sourceLocation(operator, group)));
|
|
11860
11861
|
}
|
|
11861
11862
|
};
|
|
11862
11863
|
}
|
|
@@ -11869,7 +11870,7 @@ function baseAggregateFunc(func) {
|
|
|
11869
11870
|
const distinct2 = OPTION(() => CONSUME(distinct));
|
|
11870
11871
|
const expr1 = SUBRULE(expression);
|
|
11871
11872
|
const close = CONSUME(symbols_exports.RParen);
|
|
11872
|
-
return ACTION(() => C.
|
|
11873
|
+
return ACTION(() => C.astFactory.aggregate(operator.image, distinct2 !== void 0, expr1, void 0, C.astFactory.sourceLocation(operator, close)));
|
|
11873
11874
|
}
|
|
11874
11875
|
};
|
|
11875
11876
|
}
|
|
@@ -12009,17 +12010,17 @@ var aggregateCount = {
|
|
|
12009
12010
|
const expressionVal = OR([
|
|
12010
12011
|
{ ALT: () => {
|
|
12011
12012
|
const starToken = CONSUME(symbols_exports.star);
|
|
12012
|
-
return ACTION(() => C.
|
|
12013
|
+
return ACTION(() => C.astFactory.wildcard(C.astFactory.sourceLocation(starToken)));
|
|
12013
12014
|
} },
|
|
12014
12015
|
{ ALT: () => SUBRULE(expression) }
|
|
12015
12016
|
]);
|
|
12016
12017
|
const closeToken = CONSUME(symbols_exports.RParen);
|
|
12017
12018
|
return ACTION(() => {
|
|
12018
|
-
const F3 = C.
|
|
12019
|
-
if (C.
|
|
12020
|
-
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.
|
|
12019
|
+
const F3 = C.astFactory;
|
|
12020
|
+
if (C.astFactory.isWildcard(expressionVal)) {
|
|
12021
|
+
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
|
|
12021
12022
|
}
|
|
12022
|
-
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.
|
|
12023
|
+
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expressionVal, void 0, C.astFactory.sourceLocation(operatorToken, closeToken));
|
|
12023
12024
|
});
|
|
12024
12025
|
}
|
|
12025
12026
|
};
|
|
@@ -12043,7 +12044,7 @@ var aggregateGroup_concat = {
|
|
|
12043
12044
|
});
|
|
12044
12045
|
const closeToken = CONSUME(symbols_exports.RParen);
|
|
12045
12046
|
return ACTION(() => {
|
|
12046
|
-
const F3 = C.
|
|
12047
|
+
const F3 = C.astFactory;
|
|
12047
12048
|
return F3.aggregate(operatorToken.image, Boolean(distinctToken), expr, sep?.value ?? " ", F3.sourceLocation(operatorToken, closeToken));
|
|
12048
12049
|
});
|
|
12049
12050
|
}
|
|
@@ -12073,7 +12074,7 @@ var aggregate = {
|
|
|
12073
12074
|
});
|
|
12074
12075
|
return result;
|
|
12075
12076
|
},
|
|
12076
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12077
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12077
12078
|
F3.printFilter(ast, () => {
|
|
12078
12079
|
PRINT_WORD(ast.aggregation.toUpperCase(), "(");
|
|
12079
12080
|
if (ast.distinct) {
|
|
@@ -12100,7 +12101,7 @@ var path = {
|
|
|
12100
12101
|
};
|
|
12101
12102
|
var pathGenerator = {
|
|
12102
12103
|
name: "path",
|
|
12103
|
-
gImpl: ({ PRINT, SUBRULE }) => (ast, {
|
|
12104
|
+
gImpl: ({ PRINT, SUBRULE }) => (ast, { astFactory: F3 }, braces = true) => {
|
|
12104
12105
|
if (F3.isTerm(ast) && F3.isTermNamed(ast)) {
|
|
12105
12106
|
SUBRULE(iri2, ast);
|
|
12106
12107
|
} else {
|
|
@@ -12149,7 +12150,7 @@ function pathChainHelper(name, SEP, subType, subRule) {
|
|
|
12149
12150
|
tailEnd = SUBRULE2(subRule);
|
|
12150
12151
|
tail.push(tailEnd);
|
|
12151
12152
|
});
|
|
12152
|
-
return ACTION(() => tail.length === 0 ? head2 : C.
|
|
12153
|
+
return ACTION(() => tail.length === 0 ? head2 : C.astFactory.path(subType, [head2, ...tail], C.astFactory.sourceLocation(head2, tailEnd)));
|
|
12153
12154
|
}
|
|
12154
12155
|
};
|
|
12155
12156
|
}
|
|
@@ -12160,7 +12161,7 @@ var pathEltOrInverse = {
|
|
|
12160
12161
|
{ ALT: () => {
|
|
12161
12162
|
const hat2 = CONSUME(symbols_exports.hat);
|
|
12162
12163
|
const item = SUBRULE2(pathElt);
|
|
12163
|
-
return ACTION(() => C.
|
|
12164
|
+
return ACTION(() => C.astFactory.path("^", [item], C.astFactory.sourceLocation(hat2, item)));
|
|
12164
12165
|
} }
|
|
12165
12166
|
])
|
|
12166
12167
|
};
|
|
@@ -12171,7 +12172,7 @@ var pathElt = {
|
|
|
12171
12172
|
impl: ({ ACTION, SUBRULE, OPTION }) => (C) => {
|
|
12172
12173
|
const item = SUBRULE(pathPrimary);
|
|
12173
12174
|
const modification = OPTION(() => SUBRULE(pathMod));
|
|
12174
|
-
return ACTION(() => modification === void 0 ? item : C.
|
|
12175
|
+
return ACTION(() => modification === void 0 ? item : C.astFactory.path(modification.image, [item], C.astFactory.sourceLocation(item, modification)));
|
|
12175
12176
|
}
|
|
12176
12177
|
};
|
|
12177
12178
|
var pathMod = {
|
|
@@ -12203,7 +12204,7 @@ var pathNegatedPropertySet = {
|
|
|
12203
12204
|
return OR([
|
|
12204
12205
|
{ ALT: () => {
|
|
12205
12206
|
const noAlternative = SUBRULE1(pathOneInPropertySet);
|
|
12206
|
-
return ACTION(() => C.
|
|
12207
|
+
return ACTION(() => C.astFactory.path("!", [noAlternative], C.astFactory.sourceLocation(exclamation2, noAlternative)));
|
|
12207
12208
|
} },
|
|
12208
12209
|
{ ALT: () => {
|
|
12209
12210
|
const open = CONSUME(symbols_exports.LParen);
|
|
@@ -12216,7 +12217,7 @@ var pathNegatedPropertySet = {
|
|
|
12216
12217
|
});
|
|
12217
12218
|
const close = CONSUME(symbols_exports.RParen);
|
|
12218
12219
|
return ACTION(() => {
|
|
12219
|
-
const F3 = C.
|
|
12220
|
+
const F3 = C.astFactory;
|
|
12220
12221
|
if (tail.length === 0) {
|
|
12221
12222
|
return F3.path("!", [head2], F3.sourceLocation(exclamation2, close));
|
|
12222
12223
|
}
|
|
@@ -12237,7 +12238,7 @@ var pathOneInPropertySet = {
|
|
|
12237
12238
|
{ ALT: () => SUBRULE2(iri2) },
|
|
12238
12239
|
{ ALT: () => SUBRULE2(verbA) }
|
|
12239
12240
|
]);
|
|
12240
|
-
return ACTION(() => C.
|
|
12241
|
+
return ACTION(() => C.astFactory.path("^", [item], C.astFactory.sourceLocation(hat2, item)));
|
|
12241
12242
|
} }
|
|
12242
12243
|
])
|
|
12243
12244
|
};
|
|
@@ -12262,33 +12263,35 @@ function triplesDotSeperated(triplesSameSubjectSubrule) {
|
|
|
12262
12263
|
});
|
|
12263
12264
|
}
|
|
12264
12265
|
});
|
|
12265
|
-
return ACTION(() => C.
|
|
12266
|
+
return ACTION(() => C.astFactory.patternBgp(triples, C.astFactory.sourceLocation(...triples, dotToken)));
|
|
12266
12267
|
};
|
|
12267
12268
|
}
|
|
12268
12269
|
var triplesBlock = {
|
|
12269
12270
|
name: "triplesBlock",
|
|
12270
12271
|
impl: (implArgs) => (C) => triplesDotSeperated(triplesSameSubjectPath)(implArgs)(C),
|
|
12271
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, {
|
|
12272
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, { astFactory: F3 }) => {
|
|
12272
12273
|
for (const [index, triple] of ast.triples.entries()) {
|
|
12273
12274
|
HANDLE_LOC(triple, () => {
|
|
12274
12275
|
const nextTriple = ast.triples.at(index);
|
|
12275
12276
|
if (F3.isTripleCollection(triple)) {
|
|
12276
12277
|
SUBRULE(graphNodePath, triple);
|
|
12277
|
-
F3.printFilter(triple, () => PRINT_WORD("
|
|
12278
|
+
F3.printFilter(triple, () => PRINT_WORD(".\n"));
|
|
12278
12279
|
} else {
|
|
12279
12280
|
SUBRULE(graphNodePath, triple.subject);
|
|
12281
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12280
12282
|
if (F3.isTerm(triple.predicate) && F3.isTermVariable(triple.predicate)) {
|
|
12281
12283
|
SUBRULE(varOrTerm, triple.predicate);
|
|
12282
12284
|
} else {
|
|
12283
12285
|
SUBRULE(pathGenerator, triple.predicate, void 0);
|
|
12284
12286
|
}
|
|
12287
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12285
12288
|
SUBRULE(graphNodePath, triple.object);
|
|
12286
12289
|
if (nextTriple === void 0 || F3.isTripleCollection(nextTriple) || !F3.isSourceLocationNoMaterialize(nextTriple.subject.loc)) {
|
|
12287
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12290
|
+
F3.printFilter(ast, () => PRINT_WORD(".\n"));
|
|
12288
12291
|
} else if (F3.isSourceLocationNoMaterialize(nextTriple.predicate.loc)) {
|
|
12289
12292
|
F3.printFilter(ast, () => PRINT_WORD(","));
|
|
12290
12293
|
} else {
|
|
12291
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12294
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
12292
12295
|
}
|
|
12293
12296
|
}
|
|
12294
12297
|
});
|
|
@@ -12301,24 +12304,24 @@ function triplesSameSubjectImpl(name, allowPaths) {
|
|
|
12301
12304
|
impl: ({ ACTION, SUBRULE, OR }) => (C) => OR([
|
|
12302
12305
|
{ ALT: () => {
|
|
12303
12306
|
const subject = SUBRULE(varOrTerm);
|
|
12304
|
-
const res = SUBRULE(allowPaths ? propertyListPathNotEmpty : propertyListNotEmpty, ACTION(() => C.
|
|
12307
|
+
const res = SUBRULE(allowPaths ? propertyListPathNotEmpty : propertyListNotEmpty, ACTION(() => C.astFactory.dematerialized(subject)));
|
|
12305
12308
|
return ACTION(() => {
|
|
12306
12309
|
if (res.length > 0) {
|
|
12307
12310
|
res[0].subject = subject;
|
|
12308
|
-
res[0].loc = C.
|
|
12311
|
+
res[0].loc = C.astFactory.sourceLocation(subject, res[0]);
|
|
12309
12312
|
}
|
|
12310
12313
|
return res;
|
|
12311
12314
|
});
|
|
12312
12315
|
} },
|
|
12313
12316
|
{ ALT: () => {
|
|
12314
12317
|
const subjectNode = SUBRULE(allowPaths ? triplesNodePath : triplesNode);
|
|
12315
|
-
const restNode = SUBRULE(allowPaths ? propertyListPath : propertyList, ACTION(() => C.
|
|
12318
|
+
const restNode = SUBRULE(allowPaths ? propertyListPath : propertyList, ACTION(() => C.astFactory.graphNodeIdentifier(subjectNode)));
|
|
12316
12319
|
return ACTION(() => {
|
|
12317
12320
|
if (restNode.length === 0) {
|
|
12318
12321
|
return [subjectNode];
|
|
12319
12322
|
}
|
|
12320
12323
|
restNode[0].subject = subjectNode;
|
|
12321
|
-
restNode[0].loc = C.
|
|
12324
|
+
restNode[0].loc = C.astFactory.sourceLocation(subjectNode, restNode[0]);
|
|
12322
12325
|
return restNode;
|
|
12323
12326
|
});
|
|
12324
12327
|
} }
|
|
@@ -12402,7 +12405,7 @@ function objectImpl(name, allowPaths) {
|
|
|
12402
12405
|
name,
|
|
12403
12406
|
impl: ({ ACTION, SUBRULE }) => (C, subject, predicate) => {
|
|
12404
12407
|
const node = SUBRULE(allowPaths ? graphNodePath : graphNode);
|
|
12405
|
-
return ACTION(() => C.
|
|
12408
|
+
return ACTION(() => C.astFactory.triple(subject, predicate, node));
|
|
12406
12409
|
}
|
|
12407
12410
|
};
|
|
12408
12411
|
}
|
|
@@ -12419,7 +12422,7 @@ function collectionImpl(name, allowPaths) {
|
|
|
12419
12422
|
});
|
|
12420
12423
|
const endToken = CONSUME(symbols_exports.RParen);
|
|
12421
12424
|
return ACTION(() => {
|
|
12422
|
-
const F3 = C.
|
|
12425
|
+
const F3 = C.astFactory;
|
|
12423
12426
|
const triples = [];
|
|
12424
12427
|
const predFirst = F3.namedNode(F3.sourceLocationNoMaterialize(), CommonIRIs.FIRST, void 0);
|
|
12425
12428
|
const predRest = F3.namedNode(F3.sourceLocationNoMaterialize(), CommonIRIs.REST, void 0);
|
|
@@ -12443,7 +12446,7 @@ function collectionImpl(name, allowPaths) {
|
|
|
12443
12446
|
return F3.tripleCollectionList(listHead, triples, F3.sourceLocation(startToken, endToken));
|
|
12444
12447
|
});
|
|
12445
12448
|
},
|
|
12446
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12449
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12447
12450
|
F3.printFilter(ast, () => PRINT_WORD("("));
|
|
12448
12451
|
for (const [idx, triple] of ast.triples.entries()) {
|
|
12449
12452
|
if (idx % 2 === 0) {
|
|
@@ -12474,13 +12477,17 @@ function blankNodePropertyListImpl(name, allowPaths) {
|
|
|
12474
12477
|
name,
|
|
12475
12478
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12476
12479
|
const startToken = CONSUME(symbols_exports.LSquare);
|
|
12477
|
-
const blankNode2 = ACTION(() => C.
|
|
12480
|
+
const blankNode2 = ACTION(() => C.astFactory.blankNode(void 0, C.astFactory.sourceLocationNoMaterialize()));
|
|
12478
12481
|
const propList = SUBRULE(propertyPathNotEmptyImpl, blankNode2);
|
|
12479
12482
|
const endToken = CONSUME(symbols_exports.RSquare);
|
|
12480
|
-
return ACTION(() => C.
|
|
12483
|
+
return ACTION(() => C.astFactory.tripleCollectionBlankNodeProperties(blankNode2, propList, C.astFactory.sourceLocation(startToken, endToken)));
|
|
12481
12484
|
},
|
|
12482
|
-
gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC }) => (ast,
|
|
12483
|
-
F3
|
|
12485
|
+
gImpl: ({ SUBRULE, PRINT, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY }) => (ast, c) => {
|
|
12486
|
+
const { astFactory: F3, indentInc } = c;
|
|
12487
|
+
F3.printFilter(ast, () => {
|
|
12488
|
+
c[traqulaIndentation] += indentInc;
|
|
12489
|
+
PRINT("[\n");
|
|
12490
|
+
});
|
|
12484
12491
|
for (const triple of ast.triples) {
|
|
12485
12492
|
HANDLE_LOC(triple, () => {
|
|
12486
12493
|
if (F3.isTerm(triple.predicate) && F3.isTermVariable(triple.predicate)) {
|
|
@@ -12488,11 +12495,15 @@ function blankNodePropertyListImpl(name, allowPaths) {
|
|
|
12488
12495
|
} else {
|
|
12489
12496
|
SUBRULE(pathGenerator, triple.predicate, void 0);
|
|
12490
12497
|
}
|
|
12498
|
+
F3.printFilter(triple, () => PRINT_WORD(""));
|
|
12491
12499
|
SUBRULE(graphNodePath, triple.object);
|
|
12492
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
12500
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
12493
12501
|
});
|
|
12494
12502
|
}
|
|
12495
|
-
F3.printFilter(ast, () =>
|
|
12503
|
+
F3.printFilter(ast, () => {
|
|
12504
|
+
c[traqulaIndentation] -= indentInc;
|
|
12505
|
+
PRINT_ON_EMPTY("]");
|
|
12506
|
+
});
|
|
12496
12507
|
}
|
|
12497
12508
|
};
|
|
12498
12509
|
}
|
|
@@ -12509,7 +12520,7 @@ function graphNodeImpl(name, allowPaths) {
|
|
|
12509
12520
|
ALT: () => SUBRULE(triplesNodeRule)
|
|
12510
12521
|
}
|
|
12511
12522
|
]),
|
|
12512
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
12523
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
12513
12524
|
if (F3.isTerm(ast)) {
|
|
12514
12525
|
SUBRULE(varOrTerm, ast);
|
|
12515
12526
|
} else {
|
|
@@ -12527,9 +12538,9 @@ var whereClause = {
|
|
|
12527
12538
|
impl: ({ ACTION, SUBRULE, CONSUME, OPTION }) => (C) => {
|
|
12528
12539
|
const where2 = OPTION(() => CONSUME(where));
|
|
12529
12540
|
const group = SUBRULE(groupGraphPattern);
|
|
12530
|
-
return ACTION(() => C.
|
|
12541
|
+
return ACTION(() => C.astFactory.wrap(group, C.astFactory.sourceLocation(where2, group)));
|
|
12531
12542
|
},
|
|
12532
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12543
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12533
12544
|
F3.printFilter(ast, () => PRINT_WORD("WHERE"));
|
|
12534
12545
|
SUBRULE(groupGraphPattern, ast.val);
|
|
12535
12546
|
}
|
|
@@ -12543,19 +12554,26 @@ var groupGraphPattern = {
|
|
|
12543
12554
|
{ ALT: () => SUBRULE(groupGraphPatternSub) }
|
|
12544
12555
|
]);
|
|
12545
12556
|
const close = CONSUME(symbols_exports.RCurly);
|
|
12546
|
-
return ACTION(() => C.
|
|
12557
|
+
return ACTION(() => C.astFactory.patternGroup(patterns, C.astFactory.sourceLocation(open, close)));
|
|
12547
12558
|
},
|
|
12548
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
12549
|
-
F3
|
|
12559
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
12560
|
+
const { astFactory: F3, indentInc } = C;
|
|
12561
|
+
F3.printFilter(ast, () => {
|
|
12562
|
+
C[traqulaIndentation] += indentInc;
|
|
12563
|
+
PRINT_WORD("{\n");
|
|
12564
|
+
});
|
|
12550
12565
|
for (const pattern of ast.patterns) {
|
|
12551
12566
|
SUBRULE(generatePattern, pattern);
|
|
12552
12567
|
}
|
|
12553
|
-
F3.printFilter(ast, () =>
|
|
12568
|
+
F3.printFilter(ast, () => {
|
|
12569
|
+
C[traqulaIndentation] -= indentInc;
|
|
12570
|
+
PRINT_ON_EMPTY("}\n");
|
|
12571
|
+
});
|
|
12554
12572
|
}
|
|
12555
12573
|
};
|
|
12556
12574
|
var generatePattern = {
|
|
12557
12575
|
name: "generatePattern",
|
|
12558
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
12576
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
12559
12577
|
if (ast.type === "query") {
|
|
12560
12578
|
SUBRULE(query, F3.querySelect({
|
|
12561
12579
|
context: [],
|
|
@@ -12644,9 +12662,9 @@ var optionalGraphPattern = {
|
|
|
12644
12662
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12645
12663
|
const optional2 = CONSUME(optional);
|
|
12646
12664
|
const group = SUBRULE(groupGraphPattern);
|
|
12647
|
-
return ACTION(() => C.
|
|
12665
|
+
return ACTION(() => C.astFactory.patternOptional(group.patterns, C.astFactory.sourceLocation(optional2, group)));
|
|
12648
12666
|
},
|
|
12649
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12667
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12650
12668
|
F3.printFilter(ast, () => PRINT_WORD("OPTIONAL"));
|
|
12651
12669
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
12652
12670
|
}
|
|
@@ -12657,9 +12675,9 @@ var graphGraphPattern = {
|
|
|
12657
12675
|
const graph2 = CONSUME(graph_exports.graph);
|
|
12658
12676
|
const name = SUBRULE(varOrIri);
|
|
12659
12677
|
const group = SUBRULE(groupGraphPattern);
|
|
12660
|
-
return ACTION(() => C.
|
|
12678
|
+
return ACTION(() => C.astFactory.patternGraph(name, group.patterns, C.astFactory.sourceLocation(graph2, group)));
|
|
12661
12679
|
},
|
|
12662
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12680
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12663
12681
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
12664
12682
|
SUBRULE(varOrTerm, ast.name);
|
|
12665
12683
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
@@ -12675,9 +12693,9 @@ var serviceGraphPattern = {
|
|
|
12675
12693
|
}) ?? false;
|
|
12676
12694
|
const name = SUBRULE1(varOrIri);
|
|
12677
12695
|
const group = SUBRULE1(groupGraphPattern);
|
|
12678
|
-
return ACTION(() => C.
|
|
12696
|
+
return ACTION(() => C.astFactory.patternService(name, group.patterns, silent2, C.astFactory.sourceLocation(service2, group)));
|
|
12679
12697
|
},
|
|
12680
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12698
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12681
12699
|
F3.printFilter(ast, () => {
|
|
12682
12700
|
PRINT_WORD("SERVICE");
|
|
12683
12701
|
if (ast.silent) {
|
|
@@ -12697,14 +12715,14 @@ var bind2 = {
|
|
|
12697
12715
|
CONSUME(as);
|
|
12698
12716
|
const variable = SUBRULE(var_);
|
|
12699
12717
|
const close = CONSUME(symbols_exports.RParen);
|
|
12700
|
-
return ACTION(() => C.
|
|
12718
|
+
return ACTION(() => C.astFactory.patternBind(expressionVal, variable, C.astFactory.sourceLocation(bind3, close)));
|
|
12701
12719
|
},
|
|
12702
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12720
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12703
12721
|
F3.printFilter(ast, () => PRINT_WORD("BIND", "("));
|
|
12704
12722
|
SUBRULE(expression, ast.expression);
|
|
12705
12723
|
F3.printFilter(ast, () => PRINT_WORD("AS"));
|
|
12706
12724
|
SUBRULE(var_, ast.variable);
|
|
12707
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
12725
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
12708
12726
|
}
|
|
12709
12727
|
};
|
|
12710
12728
|
var inlineData = {
|
|
@@ -12712,16 +12730,19 @@ var inlineData = {
|
|
|
12712
12730
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12713
12731
|
const values3 = CONSUME(values2);
|
|
12714
12732
|
const datablock = SUBRULE(dataBlock);
|
|
12715
|
-
return ACTION(() => C.
|
|
12733
|
+
return ACTION(() => C.astFactory.patternValues(datablock.val, C.astFactory.sourceLocation(values3, datablock)));
|
|
12716
12734
|
},
|
|
12717
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
12735
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
12736
|
+
const { astFactory: F3, indentInc } = C;
|
|
12718
12737
|
const variables = Object.keys(ast.values.at(0) ?? {});
|
|
12719
12738
|
F3.printFilter(ast, () => {
|
|
12739
|
+
PRINT_ON_EMPTY("");
|
|
12720
12740
|
PRINT_WORD("VALUES", "(");
|
|
12721
12741
|
for (const variable of variables) {
|
|
12722
12742
|
PRINT_WORD(`?${variable}`);
|
|
12723
12743
|
}
|
|
12724
|
-
|
|
12744
|
+
C[traqulaIndentation] += indentInc;
|
|
12745
|
+
PRINT_WORD(")", "{\n");
|
|
12725
12746
|
});
|
|
12726
12747
|
for (const mapping of ast.values) {
|
|
12727
12748
|
F3.printFilter(ast, () => PRINT_WORD("("));
|
|
@@ -12732,9 +12753,12 @@ var inlineData = {
|
|
|
12732
12753
|
SUBRULE(graphNodePath, mapping[variable]);
|
|
12733
12754
|
}
|
|
12734
12755
|
}
|
|
12735
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
12756
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
12736
12757
|
}
|
|
12737
|
-
F3.printFilter(ast, () =>
|
|
12758
|
+
F3.printFilter(ast, () => {
|
|
12759
|
+
C[traqulaIndentation] -= indentInc;
|
|
12760
|
+
PRINT_ON_EMPTY("}\n");
|
|
12761
|
+
});
|
|
12738
12762
|
}
|
|
12739
12763
|
};
|
|
12740
12764
|
var dataBlock = {
|
|
@@ -12757,7 +12781,7 @@ var inlineDataOneVar = {
|
|
|
12757
12781
|
});
|
|
12758
12782
|
});
|
|
12759
12783
|
const close = CONSUME(symbols_exports.RCurly);
|
|
12760
|
-
return ACTION(() => C.
|
|
12784
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(varVal, close)));
|
|
12761
12785
|
}
|
|
12762
12786
|
};
|
|
12763
12787
|
var inlineDataFull = {
|
|
@@ -12774,7 +12798,7 @@ var inlineDataFull = {
|
|
|
12774
12798
|
res.push({});
|
|
12775
12799
|
});
|
|
12776
12800
|
const close = CONSUME1(symbols_exports.RCurly);
|
|
12777
|
-
return ACTION(() => C.
|
|
12801
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(nil2, close)));
|
|
12778
12802
|
} },
|
|
12779
12803
|
{ ALT: () => {
|
|
12780
12804
|
const open = CONSUME1(symbols_exports.LParen);
|
|
@@ -12806,7 +12830,7 @@ var inlineDataFull = {
|
|
|
12806
12830
|
});
|
|
12807
12831
|
});
|
|
12808
12832
|
const close = CONSUME2(symbols_exports.RCurly);
|
|
12809
|
-
return ACTION(() => C.
|
|
12833
|
+
return ACTION(() => C.astFactory.wrap(res, C.astFactory.sourceLocation(open, close)));
|
|
12810
12834
|
} }
|
|
12811
12835
|
]);
|
|
12812
12836
|
}
|
|
@@ -12829,9 +12853,9 @@ var minusGraphPattern = {
|
|
|
12829
12853
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12830
12854
|
const minus2 = CONSUME(minus);
|
|
12831
12855
|
const group = SUBRULE(groupGraphPattern);
|
|
12832
|
-
return ACTION(() => C.
|
|
12856
|
+
return ACTION(() => C.astFactory.patternMinus(group.patterns, C.astFactory.sourceLocation(minus2, group)));
|
|
12833
12857
|
},
|
|
12834
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12858
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12835
12859
|
F3.printFilter(ast, () => PRINT_WORD("MINUS"));
|
|
12836
12860
|
SUBRULE(groupGraphPattern, F3.patternGroup(ast.patterns, ast.loc));
|
|
12837
12861
|
}
|
|
@@ -12847,9 +12871,9 @@ var groupOrUnionGraphPattern = {
|
|
|
12847
12871
|
const group2 = SUBRULE2(groupGraphPattern);
|
|
12848
12872
|
groups.push(group2);
|
|
12849
12873
|
});
|
|
12850
|
-
return ACTION(() => groups.length === 1 ? groups[0] : C.
|
|
12874
|
+
return ACTION(() => groups.length === 1 ? groups[0] : C.astFactory.patternUnion(groups, C.astFactory.sourceLocation(group, groups.at(-1))));
|
|
12851
12875
|
},
|
|
12852
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12876
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12853
12877
|
if (F3.isPatternUnion(ast)) {
|
|
12854
12878
|
const [head2, ...tail] = ast.patterns;
|
|
12855
12879
|
SUBRULE(groupGraphPattern, head2);
|
|
@@ -12867,12 +12891,12 @@ var filter3 = {
|
|
|
12867
12891
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
12868
12892
|
const filterToken = CONSUME(filter2);
|
|
12869
12893
|
const expression2 = SUBRULE(constraint);
|
|
12870
|
-
return ACTION(() => C.
|
|
12894
|
+
return ACTION(() => C.astFactory.patternFilter(expression2, C.astFactory.sourceLocation(filterToken, expression2)));
|
|
12871
12895
|
},
|
|
12872
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12896
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12873
12897
|
F3.printFilter(ast, () => PRINT_WORD("FILTER ("));
|
|
12874
12898
|
SUBRULE(expression, ast.expression);
|
|
12875
|
-
F3.printFilter(ast, () => PRINT_WORD(")"));
|
|
12899
|
+
F3.printFilter(ast, () => PRINT_WORD(")\n"));
|
|
12876
12900
|
}
|
|
12877
12901
|
};
|
|
12878
12902
|
var constraint = {
|
|
@@ -12888,7 +12912,7 @@ var functionCall = {
|
|
|
12888
12912
|
impl: ({ ACTION, SUBRULE }) => (C) => {
|
|
12889
12913
|
const func = SUBRULE(iri2);
|
|
12890
12914
|
const args = SUBRULE(argList);
|
|
12891
|
-
return ACTION(() => C.
|
|
12915
|
+
return ACTION(() => C.astFactory.expressionFunctionCall(func, args.val.args, args.val.distinct, C.astFactory.sourceLocation(func, args)));
|
|
12892
12916
|
}
|
|
12893
12917
|
};
|
|
12894
12918
|
|
|
@@ -12898,7 +12922,7 @@ var argList = {
|
|
|
12898
12922
|
impl: ({ ACTION, CONSUME, SUBRULE1, OPTION, OR, AT_LEAST_ONE_SEP }) => (C) => OR([
|
|
12899
12923
|
{ ALT: () => {
|
|
12900
12924
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
12901
|
-
return ACTION(() => C.
|
|
12925
|
+
return ACTION(() => C.astFactory.wrap({ args: [], distinct: false }, C.astFactory.sourceLocation(nil2)));
|
|
12902
12926
|
} },
|
|
12903
12927
|
{ ALT: () => {
|
|
12904
12928
|
const args = [];
|
|
@@ -12915,10 +12939,10 @@ var argList = {
|
|
|
12915
12939
|
}
|
|
12916
12940
|
});
|
|
12917
12941
|
const close = CONSUME(symbols_exports.RParen);
|
|
12918
|
-
return ACTION(() => C.
|
|
12942
|
+
return ACTION(() => C.astFactory.wrap({ args, distinct: distinct2 }, C.astFactory.sourceLocation(open, close)));
|
|
12919
12943
|
} }
|
|
12920
12944
|
]),
|
|
12921
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12945
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12922
12946
|
F3.printFilter(ast, () => {
|
|
12923
12947
|
PRINT_WORD("(");
|
|
12924
12948
|
if (ast.val.distinct) {
|
|
@@ -12941,7 +12965,7 @@ var expressionList = {
|
|
|
12941
12965
|
impl: ({ ACTION, CONSUME, MANY, OR, SUBRULE1, SUBRULE2 }) => (C) => OR([
|
|
12942
12966
|
{ ALT: () => {
|
|
12943
12967
|
const nil2 = CONSUME(terminals_exports.nil);
|
|
12944
|
-
return ACTION(() => C.
|
|
12968
|
+
return ACTION(() => C.astFactory.wrap([], C.astFactory.sourceLocation(nil2)));
|
|
12945
12969
|
} },
|
|
12946
12970
|
{ ALT: () => {
|
|
12947
12971
|
const open = CONSUME(symbols_exports.LParen);
|
|
@@ -12953,7 +12977,7 @@ var expressionList = {
|
|
|
12953
12977
|
args.push(expr);
|
|
12954
12978
|
});
|
|
12955
12979
|
const close = CONSUME(symbols_exports.RParen);
|
|
12956
|
-
return ACTION(() => C.
|
|
12980
|
+
return ACTION(() => C.astFactory.wrap(args, C.astFactory.sourceLocation(open, close)));
|
|
12957
12981
|
} }
|
|
12958
12982
|
])
|
|
12959
12983
|
};
|
|
@@ -12962,7 +12986,7 @@ var prefixOperator = /* @__PURE__ */ new Set(["!", "UPLUS", "UMINUS"]);
|
|
|
12962
12986
|
var expression = {
|
|
12963
12987
|
name: "expression",
|
|
12964
12988
|
impl: ({ SUBRULE }) => () => SUBRULE(conditionalOrExpression),
|
|
12965
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
12989
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
12966
12990
|
if (F3.isTerm(ast)) {
|
|
12967
12991
|
SUBRULE(varOrTerm, ast);
|
|
12968
12992
|
} else if (F3.isExpressionOperator(ast)) {
|
|
@@ -13027,7 +13051,7 @@ var conditionalOrExpression = {
|
|
|
13027
13051
|
impl: ({ ACTION, MANY, CONSUME, SUBRULE1, SUBRULE2 }) => (C) => constructLeftDeep(() => SUBRULE1(conditionalAndExpression), () => {
|
|
13028
13052
|
CONSUME(symbols_exports.logicOr);
|
|
13029
13053
|
const args = SUBRULE2(conditionalAndExpression);
|
|
13030
|
-
return (left) => ACTION(() => C.
|
|
13054
|
+
return (left) => ACTION(() => C.astFactory.expressionOperation("||", [left, args], C.astFactory.sourceLocation(left, args)));
|
|
13031
13055
|
}, ACTION, MANY)
|
|
13032
13056
|
};
|
|
13033
13057
|
var conditionalAndExpression = {
|
|
@@ -13035,7 +13059,7 @@ var conditionalAndExpression = {
|
|
|
13035
13059
|
impl: ({ ACTION, MANY, SUBRULE1, SUBRULE2, CONSUME }) => (C) => constructLeftDeep(() => SUBRULE1(valueLogical), () => {
|
|
13036
13060
|
CONSUME(symbols_exports.logicAnd);
|
|
13037
13061
|
const arg = SUBRULE2(valueLogical);
|
|
13038
|
-
return (left) => ACTION(() => C.
|
|
13062
|
+
return (left) => ACTION(() => C.astFactory.expressionOperation("&&", [left, arg], C.astFactory.sourceLocation(left, arg)));
|
|
13039
13063
|
}, ACTION, MANY)
|
|
13040
13064
|
};
|
|
13041
13065
|
var valueLogical = {
|
|
@@ -13057,7 +13081,7 @@ var relationalExpression = {
|
|
|
13057
13081
|
{ ALT: () => CONSUME(symbols_exports.greaterThanEqual) }
|
|
13058
13082
|
]);
|
|
13059
13083
|
const expr = SUBRULE2(numericExpression);
|
|
13060
|
-
return ACTION(() => C.
|
|
13084
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [args1, expr], C.astFactory.sourceLocation(args1, expr)));
|
|
13061
13085
|
} },
|
|
13062
13086
|
{ ALT: () => {
|
|
13063
13087
|
const operator = OR3([
|
|
@@ -13065,7 +13089,7 @@ var relationalExpression = {
|
|
|
13065
13089
|
{ ALT: () => CONSUME(notIn) }
|
|
13066
13090
|
]);
|
|
13067
13091
|
const args = SUBRULE1(expressionList);
|
|
13068
|
-
return ACTION(() => C.
|
|
13092
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image, [args1, ...args.val], C.astFactory.sourceLocation(args1, args)));
|
|
13069
13093
|
} }
|
|
13070
13094
|
]));
|
|
13071
13095
|
return expression2 ?? args1;
|
|
@@ -13084,7 +13108,7 @@ var additiveExpression = {
|
|
|
13084
13108
|
{ ALT: () => CONSUME(symbols_exports.opMinus) }
|
|
13085
13109
|
]);
|
|
13086
13110
|
const arg = SUBRULE2(multiplicativeExpression);
|
|
13087
|
-
return ACTION(() => (left) => C.
|
|
13111
|
+
return ACTION(() => (left) => C.astFactory.expressionOperation(operator.image, [left, arg], C.astFactory.sourceLocation(left, arg)));
|
|
13088
13112
|
} },
|
|
13089
13113
|
{ ALT: () => {
|
|
13090
13114
|
const { operator, startInt } = OR3([
|
|
@@ -13115,9 +13139,9 @@ var additiveExpression = {
|
|
|
13115
13139
|
{ ALT: () => CONSUME(symbols_exports.slash) }
|
|
13116
13140
|
]);
|
|
13117
13141
|
const innerExpr = SUBRULE1(unaryExpression);
|
|
13118
|
-
return ACTION(() => (leftInner) => C.
|
|
13142
|
+
return ACTION(() => (leftInner) => C.astFactory.expressionOperation(innerOperator.image, [leftInner, innerExpr], C.astFactory.sourceLocation(leftInner, innerExpr)));
|
|
13119
13143
|
}, ACTION, MANY2);
|
|
13120
|
-
return (left) => C.
|
|
13144
|
+
return (left) => C.astFactory.expressionOperation(operator, [left, multiplicativeExpr], C.astFactory.sourceLocation(left, multiplicativeExpr));
|
|
13121
13145
|
} }
|
|
13122
13146
|
]), ACTION, MANY1)
|
|
13123
13147
|
};
|
|
@@ -13134,7 +13158,7 @@ var multiplicativeExpression = {
|
|
|
13134
13158
|
subType: "operation",
|
|
13135
13159
|
operator: operator.image,
|
|
13136
13160
|
args: [left, expr],
|
|
13137
|
-
loc: C.
|
|
13161
|
+
loc: C.astFactory.sourceLocation(left, expr)
|
|
13138
13162
|
});
|
|
13139
13163
|
}, ACTION, MANY)
|
|
13140
13164
|
};
|
|
@@ -13149,7 +13173,7 @@ var unaryExpression = {
|
|
|
13149
13173
|
{ ALT: () => CONSUME(symbols_exports.opMinus) }
|
|
13150
13174
|
]);
|
|
13151
13175
|
const expr = SUBRULE2(primaryExpression);
|
|
13152
|
-
return ACTION(() => C.
|
|
13176
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image === "!" ? "!" : operator.image === "+" ? "UPLUS" : "UMINUS", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
13153
13177
|
} }
|
|
13154
13178
|
])
|
|
13155
13179
|
};
|
|
@@ -13172,7 +13196,7 @@ var brackettedExpression = {
|
|
|
13172
13196
|
const expr = SUBRULE(expression);
|
|
13173
13197
|
const close = CONSUME(symbols_exports.RParen);
|
|
13174
13198
|
return ACTION(() => {
|
|
13175
|
-
expr.loc = C.
|
|
13199
|
+
expr.loc = C.astFactory.sourceLocation(open, close);
|
|
13176
13200
|
return expr;
|
|
13177
13201
|
});
|
|
13178
13202
|
}
|
|
@@ -13194,13 +13218,13 @@ var iriOrFunction = {
|
|
|
13194
13218
|
function: iriVal,
|
|
13195
13219
|
args: args.val.args,
|
|
13196
13220
|
distinct: distinct2,
|
|
13197
|
-
loc: C.
|
|
13221
|
+
loc: C.astFactory.sourceLocation(iriVal, args)
|
|
13198
13222
|
};
|
|
13199
13223
|
});
|
|
13200
13224
|
});
|
|
13201
13225
|
return functionCall2 ?? iriVal;
|
|
13202
13226
|
},
|
|
13203
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13227
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13204
13228
|
if (F3.isTermNamed(ast)) {
|
|
13205
13229
|
SUBRULE(iri2, ast);
|
|
13206
13230
|
} else {
|
|
@@ -13253,11 +13277,14 @@ var groupClause = {
|
|
|
13253
13277
|
type: "solutionModifier",
|
|
13254
13278
|
subType: "group",
|
|
13255
13279
|
groupings,
|
|
13256
|
-
loc: C.
|
|
13280
|
+
loc: C.astFactory.sourceLocation(start, groupings.at(-1))
|
|
13257
13281
|
}));
|
|
13258
13282
|
},
|
|
13259
|
-
gImpl: ({ PRINT_WORDS, SUBRULE }) => (ast, {
|
|
13260
|
-
F3.printFilter(ast, () =>
|
|
13283
|
+
gImpl: ({ PRINT_WORDS, SUBRULE, PRINT_ON_EMPTY }) => (ast, { astFactory: F3 }) => {
|
|
13284
|
+
F3.printFilter(ast, () => {
|
|
13285
|
+
PRINT_ON_EMPTY("");
|
|
13286
|
+
PRINT_WORDS("GROUP", "BY");
|
|
13287
|
+
});
|
|
13261
13288
|
for (const grouping of ast.groupings) {
|
|
13262
13289
|
if (F3.isExpression(grouping)) {
|
|
13263
13290
|
SUBRULE(expression, grouping);
|
|
@@ -13291,7 +13318,7 @@ var groupCondition = {
|
|
|
13291
13318
|
return {
|
|
13292
13319
|
variable,
|
|
13293
13320
|
value: expressionValue,
|
|
13294
|
-
loc: C.
|
|
13321
|
+
loc: C.astFactory.sourceLocation(open, close)
|
|
13295
13322
|
};
|
|
13296
13323
|
}
|
|
13297
13324
|
return expressionValue;
|
|
@@ -13310,10 +13337,13 @@ var havingClause = {
|
|
|
13310
13337
|
expressions.push(SUBRULE(havingCondition));
|
|
13311
13338
|
});
|
|
13312
13339
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13313
|
-
return ACTION(() => C.
|
|
13340
|
+
return ACTION(() => C.astFactory.solutionModifierHaving(expressions, C.astFactory.sourceLocation(having2, expressions.at(-1))));
|
|
13314
13341
|
},
|
|
13315
|
-
gImpl: ({ PRINT_WORD, SUBRULE }) => (ast, {
|
|
13316
|
-
F3.printFilter(ast, () =>
|
|
13342
|
+
gImpl: ({ PRINT_WORD, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13343
|
+
F3.printFilter(ast, () => {
|
|
13344
|
+
PRINT_ON_EMPTY("");
|
|
13345
|
+
PRINT_WORD("HAVING");
|
|
13346
|
+
});
|
|
13317
13347
|
for (const having2 of ast.having) {
|
|
13318
13348
|
SUBRULE(expression, having2);
|
|
13319
13349
|
}
|
|
@@ -13334,10 +13364,13 @@ var orderClause = {
|
|
|
13334
13364
|
orderings.push(SUBRULE1(orderCondition));
|
|
13335
13365
|
});
|
|
13336
13366
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13337
|
-
return ACTION(() => C.
|
|
13367
|
+
return ACTION(() => C.astFactory.solutionModifierOrder(orderings, C.astFactory.sourceLocation(order2, orderings.at(-1))));
|
|
13338
13368
|
},
|
|
13339
|
-
gImpl: ({ PRINT_WORDS, SUBRULE }) => (ast, {
|
|
13340
|
-
F3.printFilter(ast, () =>
|
|
13369
|
+
gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY, SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13370
|
+
F3.printFilter(ast, () => {
|
|
13371
|
+
PRINT_ON_EMPTY("");
|
|
13372
|
+
PRINT_WORDS("ORDER", "BY");
|
|
13373
|
+
});
|
|
13341
13374
|
for (const ordering of ast.orderDefs) {
|
|
13342
13375
|
if (ordering.descending) {
|
|
13343
13376
|
F3.printFilter(ast, () => PRINT_WORDS("DESC"));
|
|
@@ -13368,7 +13401,7 @@ var orderCondition = {
|
|
|
13368
13401
|
return ACTION(() => ({
|
|
13369
13402
|
expression: expr,
|
|
13370
13403
|
descending: descending[0],
|
|
13371
|
-
loc: C.
|
|
13404
|
+
loc: C.astFactory.sourceLocation(descending[1], expr)
|
|
13372
13405
|
}));
|
|
13373
13406
|
} },
|
|
13374
13407
|
{ ALT: () => {
|
|
@@ -13387,16 +13420,17 @@ var limitOffsetClauses = {
|
|
|
13387
13420
|
{ ALT: () => {
|
|
13388
13421
|
const limit2 = SUBRULE1(limitClause);
|
|
13389
13422
|
const offset2 = OPTION1(() => SUBRULE1(offsetClause));
|
|
13390
|
-
return ACTION(() => C.
|
|
13423
|
+
return ACTION(() => C.astFactory.solutionModifierLimitOffset(limit2.val, offset2?.val, C.astFactory.sourceLocation(limit2, ...offset2 ? [offset2] : [])));
|
|
13391
13424
|
} },
|
|
13392
13425
|
{ ALT: () => {
|
|
13393
13426
|
const offset2 = SUBRULE2(offsetClause);
|
|
13394
13427
|
const limit2 = OPTION2(() => SUBRULE2(limitClause));
|
|
13395
|
-
return ACTION(() => C.
|
|
13428
|
+
return ACTION(() => C.astFactory.solutionModifierLimitOffset(limit2?.val, offset2.val, C.astFactory.sourceLocation(offset2, limit2)));
|
|
13396
13429
|
} }
|
|
13397
13430
|
]),
|
|
13398
|
-
gImpl: ({ PRINT_WORDS }) => (ast, {
|
|
13431
|
+
gImpl: ({ PRINT_WORDS, PRINT_ON_EMPTY }) => (ast, { astFactory: F3 }) => {
|
|
13399
13432
|
F3.printFilter(ast, () => {
|
|
13433
|
+
PRINT_ON_EMPTY("");
|
|
13400
13434
|
if (ast.limit) {
|
|
13401
13435
|
PRINT_WORDS("LIMIT", String(ast.limit));
|
|
13402
13436
|
}
|
|
@@ -13412,7 +13446,7 @@ var limitClause = {
|
|
|
13412
13446
|
const offset2 = CONSUME(limit);
|
|
13413
13447
|
const value = CONSUME(terminals_exports.integer);
|
|
13414
13448
|
const val = Number.parseInt(value.image, 10);
|
|
13415
|
-
return ACTION(() => C.
|
|
13449
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(offset2, value)));
|
|
13416
13450
|
}
|
|
13417
13451
|
};
|
|
13418
13452
|
var offsetClause = {
|
|
@@ -13421,7 +13455,7 @@ var offsetClause = {
|
|
|
13421
13455
|
const offset2 = CONSUME(offset);
|
|
13422
13456
|
const value = CONSUME(terminals_exports.integer);
|
|
13423
13457
|
const val = Number.parseInt(value.image, 10);
|
|
13424
|
-
return ACTION(() => C.
|
|
13458
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(offset2, value)));
|
|
13425
13459
|
}
|
|
13426
13460
|
};
|
|
13427
13461
|
|
|
@@ -13446,10 +13480,10 @@ var query = {
|
|
|
13446
13480
|
...subType,
|
|
13447
13481
|
type: "query",
|
|
13448
13482
|
...values3 && { values: values3 },
|
|
13449
|
-
loc: C.
|
|
13483
|
+
loc: C.astFactory.sourceLocation(prologueValues.at(0), subType, values3)
|
|
13450
13484
|
}));
|
|
13451
13485
|
},
|
|
13452
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13486
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13453
13487
|
SUBRULE(prologue, ast.context);
|
|
13454
13488
|
if (F3.isQuerySelect(ast)) {
|
|
13455
13489
|
SUBRULE(selectQuery, ast);
|
|
@@ -13479,13 +13513,13 @@ var selectQuery = {
|
|
|
13479
13513
|
solutionModifiers: modifiers,
|
|
13480
13514
|
datasets: from2,
|
|
13481
13515
|
...selectVal.val,
|
|
13482
|
-
loc: C.
|
|
13516
|
+
loc: C.astFactory.sourceLocation(selectVal, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13483
13517
|
};
|
|
13484
13518
|
queryIsGood(ret);
|
|
13485
13519
|
return ret;
|
|
13486
13520
|
});
|
|
13487
13521
|
},
|
|
13488
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
13522
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
13489
13523
|
SUBRULE(selectClause, F3.wrap({
|
|
13490
13524
|
variables: ast.variables,
|
|
13491
13525
|
distinct: ast.distinct,
|
|
@@ -13503,14 +13537,14 @@ var subSelect = {
|
|
|
13503
13537
|
const where2 = SUBRULE(whereClause);
|
|
13504
13538
|
const modifiers = SUBRULE(solutionModifier);
|
|
13505
13539
|
const values3 = SUBRULE(valuesClause);
|
|
13506
|
-
return ACTION(() => C.
|
|
13540
|
+
return ACTION(() => C.astFactory.querySelect({
|
|
13507
13541
|
where: where2.val,
|
|
13508
|
-
datasets: C.
|
|
13542
|
+
datasets: C.astFactory.datasetClauses([], C.astFactory.sourceLocation()),
|
|
13509
13543
|
context: [],
|
|
13510
13544
|
solutionModifiers: modifiers,
|
|
13511
13545
|
...selectVal.val,
|
|
13512
13546
|
...values3 && { values: values3 }
|
|
13513
|
-
}, C.
|
|
13547
|
+
}, C.astFactory.sourceLocation(selectVal, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset, values3)));
|
|
13514
13548
|
}
|
|
13515
13549
|
};
|
|
13516
13550
|
var selectClause = {
|
|
@@ -13541,7 +13575,7 @@ var selectClause = {
|
|
|
13541
13575
|
const star2 = CONSUME(symbols_exports.star);
|
|
13542
13576
|
return ACTION(() => {
|
|
13543
13577
|
last2 = star2;
|
|
13544
|
-
return { variables: [C.
|
|
13578
|
+
return { variables: [C.astFactory.wildcard(C.astFactory.sourceLocation(star2))], ...distRed };
|
|
13545
13579
|
});
|
|
13546
13580
|
} },
|
|
13547
13581
|
{ ALT: () => {
|
|
@@ -13571,7 +13605,7 @@ var selectClause = {
|
|
|
13571
13605
|
throw new Error(`Variable ${variable.value} used more than once in SELECT clause`);
|
|
13572
13606
|
}
|
|
13573
13607
|
usedVars.push(variable);
|
|
13574
|
-
variables.push(C.
|
|
13608
|
+
variables.push(C.astFactory.patternBind(expr, variable, C.astFactory.sourceLocation(open, last2)));
|
|
13575
13609
|
});
|
|
13576
13610
|
} }
|
|
13577
13611
|
]));
|
|
@@ -13579,9 +13613,9 @@ var selectClause = {
|
|
|
13579
13613
|
} }
|
|
13580
13614
|
]);
|
|
13581
13615
|
ACTION(() => !couldParseAgg && C.parseMode.delete("canParseAggregate"));
|
|
13582
|
-
return ACTION(() => C.
|
|
13616
|
+
return ACTION(() => C.astFactory.wrap(val, C.astFactory.sourceLocation(select2, last2)));
|
|
13583
13617
|
},
|
|
13584
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13618
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13585
13619
|
F3.printFilter(ast, () => {
|
|
13586
13620
|
PRINT_WORD("SELECT");
|
|
13587
13621
|
if (ast.val.distinct) {
|
|
@@ -13621,7 +13655,7 @@ var constructQuery = {
|
|
|
13621
13655
|
datasets: from2,
|
|
13622
13656
|
where: where2.val,
|
|
13623
13657
|
solutionModifiers: modifiers,
|
|
13624
|
-
loc: C.
|
|
13658
|
+
loc: C.astFactory.sourceLocation(construct2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13625
13659
|
}));
|
|
13626
13660
|
} },
|
|
13627
13661
|
{ ALT: () => {
|
|
@@ -13633,19 +13667,26 @@ var constructQuery = {
|
|
|
13633
13667
|
subType: "construct",
|
|
13634
13668
|
template: template.val,
|
|
13635
13669
|
datasets: from2,
|
|
13636
|
-
where: C.
|
|
13670
|
+
where: C.astFactory.patternGroup([template.val], C.astFactory.sourceLocation()),
|
|
13637
13671
|
solutionModifiers: modifiers,
|
|
13638
|
-
loc: C.
|
|
13672
|
+
loc: C.astFactory.sourceLocation(construct2, template, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13639
13673
|
}));
|
|
13640
13674
|
} }
|
|
13641
13675
|
]);
|
|
13642
13676
|
},
|
|
13643
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
13677
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
13678
|
+
const { astFactory: F3, indentInc } = C;
|
|
13644
13679
|
F3.printFilter(ast, () => PRINT_WORD("CONSTRUCT"));
|
|
13645
13680
|
if (!F3.isSourceLocationNoMaterialize(ast.where.loc)) {
|
|
13646
|
-
F3.printFilter(ast, () =>
|
|
13681
|
+
F3.printFilter(ast, () => {
|
|
13682
|
+
C[traqulaIndentation] += indentInc;
|
|
13683
|
+
PRINT_WORD("{\n");
|
|
13684
|
+
});
|
|
13647
13685
|
SUBRULE(triplesBlock, ast.template);
|
|
13648
|
-
F3.printFilter(ast, () =>
|
|
13686
|
+
F3.printFilter(ast, () => {
|
|
13687
|
+
C[traqulaIndentation] -= indentInc;
|
|
13688
|
+
PRINT_ON_EMPTY("}\n");
|
|
13689
|
+
});
|
|
13649
13690
|
}
|
|
13650
13691
|
SUBRULE(datasetClauseStar, ast.datasets);
|
|
13651
13692
|
if (F3.isSourceLocationNoMaterialize(ast.where.loc)) {
|
|
@@ -13670,7 +13711,7 @@ var describeQuery = {
|
|
|
13670
13711
|
} },
|
|
13671
13712
|
{ ALT: () => {
|
|
13672
13713
|
const star2 = CONSUME(symbols_exports.star);
|
|
13673
|
-
return [ACTION(() => C.
|
|
13714
|
+
return [ACTION(() => C.astFactory.wildcard(C.astFactory.sourceLocation(star2)))];
|
|
13674
13715
|
} }
|
|
13675
13716
|
]);
|
|
13676
13717
|
const from2 = SUBRULE1(datasetClauseStar);
|
|
@@ -13682,10 +13723,10 @@ var describeQuery = {
|
|
|
13682
13723
|
datasets: from2,
|
|
13683
13724
|
...where2 && { where: where2.val },
|
|
13684
13725
|
solutionModifiers: modifiers,
|
|
13685
|
-
loc: C.
|
|
13726
|
+
loc: C.astFactory.sourceLocation(describe2, ...variables, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13686
13727
|
}));
|
|
13687
13728
|
},
|
|
13688
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13729
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13689
13730
|
F3.printFilter(ast, () => PRINT_WORD("DESCRIBE"));
|
|
13690
13731
|
if (F3.isWildcard(ast.variables[0])) {
|
|
13691
13732
|
F3.printFilter(ast, () => PRINT_WORD("*"));
|
|
@@ -13713,10 +13754,10 @@ var askQuery = {
|
|
|
13713
13754
|
datasets: from2,
|
|
13714
13755
|
where: where2.val,
|
|
13715
13756
|
solutionModifiers: modifiers,
|
|
13716
|
-
loc: C.
|
|
13757
|
+
loc: C.astFactory.sourceLocation(ask2, from2, where2, modifiers.group, modifiers.having, modifiers.order, modifiers.limitOffset)
|
|
13717
13758
|
}));
|
|
13718
13759
|
},
|
|
13719
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13760
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13720
13761
|
F3.printFilter(ast, () => PRINT_WORD("ASK"));
|
|
13721
13762
|
SUBRULE(datasetClauseStar, ast.datasets);
|
|
13722
13763
|
SUBRULE(whereClause, F3.wrap(ast.where, ast.loc));
|
|
@@ -13733,7 +13774,7 @@ var constructTemplate = {
|
|
|
13733
13774
|
const open = CONSUME(symbols_exports.LCurly);
|
|
13734
13775
|
const triples = OPTION(() => SUBRULE1(constructTriples));
|
|
13735
13776
|
const close = CONSUME(symbols_exports.RCurly);
|
|
13736
|
-
return ACTION(() => C.
|
|
13777
|
+
return ACTION(() => C.astFactory.wrap(triples ?? C.astFactory.patternBgp([], C.astFactory.sourceLocation()), C.astFactory.sourceLocation(open, close)));
|
|
13737
13778
|
}
|
|
13738
13779
|
};
|
|
13739
13780
|
var constructTriples = {
|
|
@@ -13770,13 +13811,13 @@ var update = {
|
|
|
13770
13811
|
const update2 = {
|
|
13771
13812
|
type: "update",
|
|
13772
13813
|
updates,
|
|
13773
|
-
loc: C.
|
|
13814
|
+
loc: C.astFactory.sourceLocation(...updates[0].context, updates[0].operation, ...updates.at(-1).context, updates.at(-1)?.operation)
|
|
13774
13815
|
};
|
|
13775
13816
|
updateNoReuseBlankNodeLabels(update2);
|
|
13776
13817
|
return update2;
|
|
13777
13818
|
});
|
|
13778
13819
|
},
|
|
13779
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13820
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13780
13821
|
const [head2, ...tail] = ast.updates;
|
|
13781
13822
|
if (head2) {
|
|
13782
13823
|
SUBRULE(prologue, head2.context);
|
|
@@ -13856,9 +13897,9 @@ var load2 = {
|
|
|
13856
13897
|
CONSUME(loadInto);
|
|
13857
13898
|
return SUBRULE1(graphRef);
|
|
13858
13899
|
});
|
|
13859
|
-
return ACTION(() => C.
|
|
13900
|
+
return ACTION(() => C.astFactory.updateOperationLoad(C.astFactory.sourceLocation(loadToken, source, destination), source, Boolean(silent2), destination));
|
|
13860
13901
|
},
|
|
13861
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13902
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13862
13903
|
F3.printFilter(ast, () => {
|
|
13863
13904
|
PRINT_WORD("LOAD");
|
|
13864
13905
|
if (ast.silent) {
|
|
@@ -13879,9 +13920,9 @@ function clearOrDrop(operation) {
|
|
|
13879
13920
|
const opToken = CONSUME(operation);
|
|
13880
13921
|
const silent2 = OPTION(() => CONSUME(silent));
|
|
13881
13922
|
const destination = SUBRULE1(graphRefAll);
|
|
13882
|
-
return ACTION(() => C.
|
|
13923
|
+
return ACTION(() => C.astFactory.updateOperationClearDrop(unCapitalize(operation.name), Boolean(silent2), destination, C.astFactory.sourceLocation(opToken, destination)));
|
|
13883
13924
|
},
|
|
13884
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13925
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13885
13926
|
F3.printFilter(ast, () => {
|
|
13886
13927
|
PRINT_WORD(operation.name.toUpperCase());
|
|
13887
13928
|
if (ast.silent) {
|
|
@@ -13900,9 +13941,9 @@ var create2 = {
|
|
|
13900
13941
|
const createToken3 = CONSUME(create);
|
|
13901
13942
|
const silent2 = OPTION(() => CONSUME(silent));
|
|
13902
13943
|
const destination = SUBRULE1(graphRef);
|
|
13903
|
-
return ACTION(() => C.
|
|
13944
|
+
return ACTION(() => C.astFactory.updateOperationCreate(destination, Boolean(silent2), C.astFactory.sourceLocation(createToken3, destination)));
|
|
13904
13945
|
},
|
|
13905
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13946
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13906
13947
|
F3.printFilter(ast, () => {
|
|
13907
13948
|
PRINT_WORD("CREATE");
|
|
13908
13949
|
if (ast.silent) {
|
|
@@ -13921,9 +13962,9 @@ function copyMoveAddOperation(operation) {
|
|
|
13921
13962
|
const source = SUBRULE1(graphOrDefault);
|
|
13922
13963
|
CONSUME(to);
|
|
13923
13964
|
const destination = SUBRULE2(graphOrDefault);
|
|
13924
|
-
return ACTION(() => C.
|
|
13965
|
+
return ACTION(() => C.astFactory.updateOperationAddMoveCopy(unCapitalize(operation.name), source, destination, Boolean(silent2), C.astFactory.sourceLocation(op, destination)));
|
|
13925
13966
|
},
|
|
13926
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
13967
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
13927
13968
|
F3.printFilter(ast, () => {
|
|
13928
13969
|
PRINT_WORD(operation.name.toUpperCase());
|
|
13929
13970
|
if (ast.silent) {
|
|
@@ -13945,7 +13986,7 @@ var quadPattern = {
|
|
|
13945
13986
|
const open = CONSUME(symbols_exports.LCurly);
|
|
13946
13987
|
const val = SUBRULE1(quads);
|
|
13947
13988
|
const close = CONSUME(symbols_exports.RCurly);
|
|
13948
|
-
return ACTION(() => C.
|
|
13989
|
+
return ACTION(() => C.astFactory.wrap(val.val, C.astFactory.sourceLocation(open, close)));
|
|
13949
13990
|
}
|
|
13950
13991
|
};
|
|
13951
13992
|
var quadData = {
|
|
@@ -13956,7 +13997,7 @@ var quadData = {
|
|
|
13956
13997
|
const val = SUBRULE1(quads);
|
|
13957
13998
|
ACTION(() => couldParseVars && C.parseMode.add("canParseVars"));
|
|
13958
13999
|
const close = CONSUME(symbols_exports.RCurly);
|
|
13959
|
-
return ACTION(() => C.
|
|
14000
|
+
return ACTION(() => C.astFactory.wrap(val.val, C.astFactory.sourceLocation(open, close)));
|
|
13960
14001
|
}
|
|
13961
14002
|
};
|
|
13962
14003
|
function insertDeleteDelWhere(name, subType, cons1, cons2, dataRule) {
|
|
@@ -13973,12 +14014,26 @@ function insertDeleteDelWhere(name, subType, cons1, cons2, dataRule) {
|
|
|
13973
14014
|
if (name !== "insertData") {
|
|
13974
14015
|
ACTION(() => couldCreateBlankNodes && C.parseMode.add("canCreateBlankNodes"));
|
|
13975
14016
|
}
|
|
13976
|
-
return ACTION(() => C.
|
|
14017
|
+
return ACTION(() => C.astFactory.updateOperationInsDelDataWhere(subType, data.val, C.astFactory.sourceLocation(insDelToken, data)));
|
|
13977
14018
|
},
|
|
13978
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
13979
|
-
|
|
14019
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14020
|
+
const { astFactory: F3, indentInc } = C;
|
|
14021
|
+
F3.printFilter(ast, () => {
|
|
14022
|
+
C[traqulaIndentation] += indentInc;
|
|
14023
|
+
if (subType === "insertdata") {
|
|
14024
|
+
PRINT_WORD("INSERT DATA");
|
|
14025
|
+
} else if (subType === "deletedata") {
|
|
14026
|
+
PRINT_WORD("DELETE DATA");
|
|
14027
|
+
} else if (subType === "deletewhere") {
|
|
14028
|
+
PRINT_WORD("DELETE WHERE");
|
|
14029
|
+
}
|
|
14030
|
+
PRINT_WORD("{\n");
|
|
14031
|
+
});
|
|
13980
14032
|
SUBRULE(quads, F3.wrap(ast.data, ast.loc));
|
|
13981
|
-
F3.printFilter(ast, () =>
|
|
14033
|
+
F3.printFilter(ast, () => {
|
|
14034
|
+
C[traqulaIndentation] -= indentInc;
|
|
14035
|
+
PRINT_ON_EMPTY("}\n");
|
|
14036
|
+
});
|
|
13982
14037
|
}
|
|
13983
14038
|
};
|
|
13984
14039
|
}
|
|
@@ -14007,22 +14062,35 @@ var modify = {
|
|
|
14007
14062
|
const using = SUBRULE1(usingClauseStar);
|
|
14008
14063
|
CONSUME(where);
|
|
14009
14064
|
const where2 = SUBRULE1(groupGraphPattern);
|
|
14010
|
-
return ACTION(() => C.
|
|
14065
|
+
return ACTION(() => C.astFactory.updateOperationModify(C.astFactory.sourceLocation(graph2?.withToken, del, insert, where2), insert?.val ?? [], del?.val ?? [], where2, using, graph2?.graph));
|
|
14011
14066
|
},
|
|
14012
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
14067
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14068
|
+
const { astFactory: F3, indentInc } = C;
|
|
14013
14069
|
if (ast.graph) {
|
|
14014
14070
|
F3.printFilter(ast, () => PRINT_WORD("WITH"));
|
|
14015
14071
|
SUBRULE(iri2, ast.graph);
|
|
14016
14072
|
}
|
|
14017
14073
|
if (ast.delete.length > 0) {
|
|
14018
|
-
F3.printFilter(ast, () =>
|
|
14074
|
+
F3.printFilter(ast, () => {
|
|
14075
|
+
C[traqulaIndentation] += indentInc;
|
|
14076
|
+
PRINT_WORD("DELETE", "{\n");
|
|
14077
|
+
});
|
|
14019
14078
|
SUBRULE(quads, F3.wrap(ast.delete, ast.loc));
|
|
14020
|
-
F3.printFilter(ast, () =>
|
|
14079
|
+
F3.printFilter(ast, () => {
|
|
14080
|
+
C[traqulaIndentation] -= indentInc;
|
|
14081
|
+
PRINT_ON_EMPTY("}\n");
|
|
14082
|
+
});
|
|
14021
14083
|
}
|
|
14022
14084
|
if (ast.insert.length > 0) {
|
|
14023
|
-
F3.printFilter(ast, () =>
|
|
14085
|
+
F3.printFilter(ast, () => {
|
|
14086
|
+
C[traqulaIndentation] += indentInc;
|
|
14087
|
+
PRINT_WORD("INSERT", "{\n");
|
|
14088
|
+
});
|
|
14024
14089
|
SUBRULE(quads, F3.wrap(ast.insert, ast.loc));
|
|
14025
|
-
F3.printFilter(ast, () =>
|
|
14090
|
+
F3.printFilter(ast, () => {
|
|
14091
|
+
C[traqulaIndentation] -= indentInc;
|
|
14092
|
+
PRINT_ON_EMPTY("}\n");
|
|
14093
|
+
});
|
|
14026
14094
|
}
|
|
14027
14095
|
SUBRULE(usingClauseStar, ast.from);
|
|
14028
14096
|
F3.printFilter(ast, () => PRINT_WORD("WHERE"));
|
|
@@ -14036,7 +14104,7 @@ var deleteClause2 = {
|
|
|
14036
14104
|
const couldCreateBlankNodes = ACTION(() => C.parseMode.delete("canCreateBlankNodes"));
|
|
14037
14105
|
const del = SUBRULE(quadPattern);
|
|
14038
14106
|
ACTION(() => couldCreateBlankNodes && C.parseMode.add("canCreateBlankNodes"));
|
|
14039
|
-
return ACTION(() => C.
|
|
14107
|
+
return ACTION(() => C.astFactory.wrap(del.val, C.astFactory.sourceLocation(delToken, del)));
|
|
14040
14108
|
}
|
|
14041
14109
|
};
|
|
14042
14110
|
var insertClause2 = {
|
|
@@ -14044,7 +14112,7 @@ var insertClause2 = {
|
|
|
14044
14112
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14045
14113
|
const insertToken = CONSUME(insertClause);
|
|
14046
14114
|
const insert = SUBRULE(quadPattern);
|
|
14047
|
-
return ACTION(() => C.
|
|
14115
|
+
return ACTION(() => C.astFactory.wrap(insert.val, C.astFactory.sourceLocation(insertToken, insert)));
|
|
14048
14116
|
}
|
|
14049
14117
|
};
|
|
14050
14118
|
var graphOrDefault = {
|
|
@@ -14052,12 +14120,12 @@ var graphOrDefault = {
|
|
|
14052
14120
|
impl: ({ ACTION, SUBRULE1, CONSUME, OPTION, OR }) => (C) => OR([
|
|
14053
14121
|
{ ALT: () => {
|
|
14054
14122
|
const def = CONSUME(graph_exports.default_);
|
|
14055
|
-
return ACTION(() => C.
|
|
14123
|
+
return ACTION(() => C.astFactory.graphRefDefault(C.astFactory.sourceLocation(def)));
|
|
14056
14124
|
} },
|
|
14057
14125
|
{ ALT: () => {
|
|
14058
14126
|
const graph2 = OPTION(() => CONSUME(graph_exports.graph));
|
|
14059
14127
|
const name = SUBRULE1(iri2);
|
|
14060
|
-
return ACTION(() => C.
|
|
14128
|
+
return ACTION(() => C.astFactory.graphRefSpecific(name, C.astFactory.sourceLocation(graph2, name)));
|
|
14061
14129
|
} }
|
|
14062
14130
|
])
|
|
14063
14131
|
};
|
|
@@ -14066,9 +14134,9 @@ var graphRef = {
|
|
|
14066
14134
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14067
14135
|
const graph2 = CONSUME(graph_exports.graph);
|
|
14068
14136
|
const val = SUBRULE(iri2);
|
|
14069
|
-
return ACTION(() => C.
|
|
14137
|
+
return ACTION(() => C.astFactory.graphRefSpecific(val, C.astFactory.sourceLocation(graph2, val)));
|
|
14070
14138
|
},
|
|
14071
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14139
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14072
14140
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
14073
14141
|
SUBRULE(iri2, ast.graph);
|
|
14074
14142
|
}
|
|
@@ -14079,18 +14147,18 @@ var graphRefAll = {
|
|
|
14079
14147
|
{ ALT: () => SUBRULE(graphRef) },
|
|
14080
14148
|
{ ALT: () => {
|
|
14081
14149
|
const def = CONSUME(graph_exports.default_);
|
|
14082
|
-
return ACTION(() => C.
|
|
14150
|
+
return ACTION(() => C.astFactory.graphRefDefault(C.astFactory.sourceLocation(def)));
|
|
14083
14151
|
} },
|
|
14084
14152
|
{ ALT: () => {
|
|
14085
14153
|
const named2 = CONSUME(graph_exports.named);
|
|
14086
|
-
return ACTION(() => C.
|
|
14154
|
+
return ACTION(() => C.astFactory.graphRefNamed(C.astFactory.sourceLocation(named2)));
|
|
14087
14155
|
} },
|
|
14088
14156
|
{ ALT: () => {
|
|
14089
14157
|
const graphAll2 = CONSUME(graph_exports.graphAll);
|
|
14090
|
-
return ACTION(() => C.
|
|
14158
|
+
return ACTION(() => C.astFactory.graphRefAll(C.astFactory.sourceLocation(graphAll2)));
|
|
14091
14159
|
} }
|
|
14092
14160
|
]),
|
|
14093
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14161
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14094
14162
|
if (F3.isGraphRefSpecific(ast)) {
|
|
14095
14163
|
SUBRULE(graphRef, ast);
|
|
14096
14164
|
} else if (F3.isGraphRefDefault(ast)) {
|
|
@@ -14127,9 +14195,9 @@ var quads = {
|
|
|
14127
14195
|
ACTION(() => quads2.push(triples));
|
|
14128
14196
|
});
|
|
14129
14197
|
});
|
|
14130
|
-
return ACTION(() => C.
|
|
14198
|
+
return ACTION(() => C.astFactory.wrap(quads2, C.astFactory.sourceLocation(quads2.at(0), last2)));
|
|
14131
14199
|
},
|
|
14132
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
14200
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14133
14201
|
for (const quad of ast.val) {
|
|
14134
14202
|
if (F3.isPattern(quad)) {
|
|
14135
14203
|
SUBRULE(triplesBlock, quad);
|
|
@@ -14147,14 +14215,21 @@ var quadsNotTriples = {
|
|
|
14147
14215
|
CONSUME(symbols_exports.LCurly);
|
|
14148
14216
|
const triples = OPTION(() => SUBRULE1(triplesTemplate));
|
|
14149
14217
|
const close = CONSUME(symbols_exports.RCurly);
|
|
14150
|
-
return ACTION(() => C.
|
|
14218
|
+
return ACTION(() => C.astFactory.graphQuads(name, triples ?? C.astFactory.patternBgp([], C.astFactory.sourceLocationNoMaterialize()), C.astFactory.sourceLocation(graph2, close)));
|
|
14151
14219
|
},
|
|
14152
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast,
|
|
14220
|
+
gImpl: ({ SUBRULE, PRINT_WORD, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14221
|
+
const { astFactory: F3, indentInc } = C;
|
|
14153
14222
|
F3.printFilter(ast, () => PRINT_WORD("GRAPH"));
|
|
14154
14223
|
SUBRULE(varOrTerm, ast.graph);
|
|
14155
|
-
F3.printFilter(ast, () =>
|
|
14224
|
+
F3.printFilter(ast, () => {
|
|
14225
|
+
C[traqulaIndentation] += indentInc;
|
|
14226
|
+
PRINT_WORD("{\n");
|
|
14227
|
+
});
|
|
14156
14228
|
SUBRULE(triplesBlock, ast.triples);
|
|
14157
|
-
F3.printFilter(ast, () =>
|
|
14229
|
+
F3.printFilter(ast, () => {
|
|
14230
|
+
C[traqulaIndentation] -= indentInc;
|
|
14231
|
+
PRINT_ON_EMPTY("}\n");
|
|
14232
|
+
});
|
|
14158
14233
|
}
|
|
14159
14234
|
};
|
|
14160
14235
|
|
|
@@ -14177,7 +14252,7 @@ var queryOrUpdate = {
|
|
|
14177
14252
|
...subType,
|
|
14178
14253
|
type: "query",
|
|
14179
14254
|
...values3 && { values: values3 },
|
|
14180
|
-
loc: C.
|
|
14255
|
+
loc: C.astFactory.sourceLocation(prologueValues.at(0), subType, values3)
|
|
14181
14256
|
}));
|
|
14182
14257
|
} },
|
|
14183
14258
|
{ ALT: () => {
|
|
@@ -14201,7 +14276,7 @@ var queryOrUpdate = {
|
|
|
14201
14276
|
const update2 = {
|
|
14202
14277
|
type: "update",
|
|
14203
14278
|
updates,
|
|
14204
|
-
loc: C.
|
|
14279
|
+
loc: C.astFactory.sourceLocation(...updates[0].context, updates[0].operation, ...updates.at(-1).context, updates.at(-1)?.operation)
|
|
14205
14280
|
};
|
|
14206
14281
|
updateNoReuseBlankNodeLabels(update2);
|
|
14207
14282
|
return update2;
|
|
@@ -14209,7 +14284,7 @@ var queryOrUpdate = {
|
|
|
14209
14284
|
} }
|
|
14210
14285
|
]);
|
|
14211
14286
|
},
|
|
14212
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
14287
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14213
14288
|
if (F3.isQuery(ast)) {
|
|
14214
14289
|
SUBRULE(query, ast);
|
|
14215
14290
|
} else {
|
|
@@ -14273,8 +14348,78 @@ var LANG_DIR = createToken2({
|
|
|
14273
14348
|
});
|
|
14274
14349
|
var sparql12LexerBuilder = LexerBuilder.create(lexer_exports.sparql11LexerBuilder).addBefore(lexer_exports.symbols.logicAnd, tilde, annotationOpen, annotationClose, tripleTermOpen, tripleTermClose, reificationOpen, reificationClose, version).addBefore(lexer_exports.builtIn.langmatches, buildInLangDir, buildInStrLangDir, buildInHasLangDir, buildInHasLang, buildInIsTRIPLE, buildInTRIPLE, buildInSUBJECT, buildInPREDICATE, buildInOBJECT).addBefore(lexer_exports.terminals.langTag, LANG_DIR).delete(lexer_exports.terminals.langTag);
|
|
14275
14350
|
|
|
14351
|
+
// lib/AstFactory.js
|
|
14352
|
+
var AstFactory2 = class extends AstFactory {
|
|
14353
|
+
termTriple(subject, predicate, object3, loc) {
|
|
14354
|
+
return {
|
|
14355
|
+
type: "term",
|
|
14356
|
+
subType: "triple",
|
|
14357
|
+
subject,
|
|
14358
|
+
predicate,
|
|
14359
|
+
object: object3,
|
|
14360
|
+
loc
|
|
14361
|
+
};
|
|
14362
|
+
}
|
|
14363
|
+
isTermTriple(obj) {
|
|
14364
|
+
return this.isOfSubType(obj, "term", "triple");
|
|
14365
|
+
}
|
|
14366
|
+
tripleCollectionReifiedTriple(loc, subject, predicate, object3, reifier2) {
|
|
14367
|
+
return {
|
|
14368
|
+
type: "tripleCollection",
|
|
14369
|
+
subType: "reifiedTriple",
|
|
14370
|
+
triples: [this.triple(subject, predicate, object3)],
|
|
14371
|
+
identifier: reifier2 ?? this.blankNode(void 0, this.sourceLocationNoMaterialize()),
|
|
14372
|
+
loc
|
|
14373
|
+
};
|
|
14374
|
+
}
|
|
14375
|
+
isTripleCollectionReifiedTriple(obj) {
|
|
14376
|
+
return this.isOfSubType(obj, "tripleCollection", "reifiedTriple");
|
|
14377
|
+
}
|
|
14378
|
+
tripleCollectionBlankNodeProperties(identifier, triples, loc) {
|
|
14379
|
+
return {
|
|
14380
|
+
type: "tripleCollection",
|
|
14381
|
+
subType: "blankNodeProperties",
|
|
14382
|
+
triples,
|
|
14383
|
+
identifier,
|
|
14384
|
+
loc
|
|
14385
|
+
};
|
|
14386
|
+
}
|
|
14387
|
+
/**
|
|
14388
|
+
* Overwritten triple constructor to always contain an empty annotations list
|
|
14389
|
+
*/
|
|
14390
|
+
triple = (subject, predicate, object3, loc) => ({
|
|
14391
|
+
type: "triple",
|
|
14392
|
+
subject,
|
|
14393
|
+
predicate,
|
|
14394
|
+
object: object3,
|
|
14395
|
+
annotations: [],
|
|
14396
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
14397
|
+
});
|
|
14398
|
+
annotatedTriple(subject, predicate, object3, annotations, loc) {
|
|
14399
|
+
return {
|
|
14400
|
+
type: "triple",
|
|
14401
|
+
subject,
|
|
14402
|
+
predicate,
|
|
14403
|
+
object: object3,
|
|
14404
|
+
annotations: annotations ?? [],
|
|
14405
|
+
loc: loc ?? this.sourceLocation(subject, predicate, object3, ...annotations ?? [])
|
|
14406
|
+
};
|
|
14407
|
+
}
|
|
14408
|
+
contextDefinitionVersion(version2, loc) {
|
|
14409
|
+
return {
|
|
14410
|
+
type: "contextDef",
|
|
14411
|
+
subType: "version",
|
|
14412
|
+
version: version2,
|
|
14413
|
+
loc
|
|
14414
|
+
};
|
|
14415
|
+
}
|
|
14416
|
+
isContextDefinitionVersion(obj) {
|
|
14417
|
+
return this.isOfSubType(obj, "contextDef", "version");
|
|
14418
|
+
}
|
|
14419
|
+
};
|
|
14420
|
+
|
|
14276
14421
|
// lib/validators.js
|
|
14277
|
-
var F2 = new
|
|
14422
|
+
var F2 = new AstFactory2();
|
|
14278
14423
|
function isLangDir(dir) {
|
|
14279
14424
|
return dir === "ltr" || dir === "rtl";
|
|
14280
14425
|
}
|
|
@@ -14318,6 +14463,11 @@ function findPatternBoundedVars2(iter, boundedVars) {
|
|
|
14318
14463
|
if (F2.isTermVariable(iter)) {
|
|
14319
14464
|
boundedVars.add(iter.value);
|
|
14320
14465
|
}
|
|
14466
|
+
if (F2.isTermTriple(iter)) {
|
|
14467
|
+
findPatternBoundedVars2(iter.subject, boundedVars);
|
|
14468
|
+
findPatternBoundedVars2(iter.predicate, boundedVars);
|
|
14469
|
+
findPatternBoundedVars2(iter.object, boundedVars);
|
|
14470
|
+
}
|
|
14321
14471
|
} else if (F2.isTriple(iter)) {
|
|
14322
14472
|
findPatternBoundedVars2(iter.subject, boundedVars);
|
|
14323
14473
|
findPatternBoundedVars2(iter.predicate, boundedVars);
|
|
@@ -14362,11 +14512,11 @@ var versionDecl = {
|
|
|
14362
14512
|
impl: ({ ACTION, SUBRULE, CONSUME }) => (C) => {
|
|
14363
14513
|
const versionToken = CONSUME(version);
|
|
14364
14514
|
const identifier = SUBRULE(versionSpecifier);
|
|
14365
|
-
return ACTION(() => C.
|
|
14515
|
+
return ACTION(() => C.astFactory.contextDefinitionVersion(identifier.val, C.astFactory.sourceLocation(versionToken, identifier)));
|
|
14366
14516
|
},
|
|
14367
|
-
gImpl: ({ PRINT_WORDS }) => (ast, {
|
|
14517
|
+
gImpl: ({ PRINT_WORDS }) => (ast, { astFactory: F3 }) => {
|
|
14368
14518
|
F3.printFilter(ast, () => {
|
|
14369
|
-
PRINT_WORDS("VERSION", `${grammar_exports.stringEscapedLexical(ast.version)}
|
|
14519
|
+
PRINT_WORDS("VERSION", `${grammar_exports.stringEscapedLexical(ast.version)}`, "\n");
|
|
14370
14520
|
});
|
|
14371
14521
|
}
|
|
14372
14522
|
};
|
|
@@ -14377,7 +14527,7 @@ var versionSpecifier = {
|
|
|
14377
14527
|
{ ALT: () => CONSUME(lexer_exports.terminals.stringLiteral1) },
|
|
14378
14528
|
{ ALT: () => CONSUME(lexer_exports.terminals.stringLiteral2) }
|
|
14379
14529
|
]);
|
|
14380
|
-
return ACTION(() => C.
|
|
14530
|
+
return ACTION(() => C.astFactory.wrap(token.image.slice(1, -1), C.astFactory.sourceLocation(token)));
|
|
14381
14531
|
}
|
|
14382
14532
|
};
|
|
14383
14533
|
var prologue2 = {
|
|
@@ -14393,7 +14543,7 @@ var prologue2 = {
|
|
|
14393
14543
|
]));
|
|
14394
14544
|
return result;
|
|
14395
14545
|
},
|
|
14396
|
-
gImpl: ({ SUBRULE }) => (ast, {
|
|
14546
|
+
gImpl: ({ SUBRULE }) => (ast, { astFactory: F3 }) => {
|
|
14397
14547
|
for (const context of ast) {
|
|
14398
14548
|
if (F3.isContextDefinitionBase(context)) {
|
|
14399
14549
|
SUBRULE(grammar_exports.baseDecl, context);
|
|
@@ -14410,7 +14560,7 @@ function reifiedTripleBlockImpl(name, allowPath) {
|
|
|
14410
14560
|
name,
|
|
14411
14561
|
impl: ({ ACTION, SUBRULE }) => (C) => {
|
|
14412
14562
|
const triple = SUBRULE(reifiedTriple);
|
|
14413
|
-
const properties = SUBRULE(allowPath ? grammar_exports.propertyListPath : grammar_exports.propertyList, ACTION(() => C.
|
|
14563
|
+
const properties = SUBRULE(allowPath ? grammar_exports.propertyListPath : grammar_exports.propertyList, ACTION(() => C.astFactory.dematerialized(triple.identifier)));
|
|
14414
14564
|
return ACTION(() => [triple, ...properties]);
|
|
14415
14565
|
}
|
|
14416
14566
|
};
|
|
@@ -14433,7 +14583,7 @@ var reifier = {
|
|
|
14433
14583
|
if (reifier2 === void 0 && !C.parseMode.has("canCreateBlankNodes")) {
|
|
14434
14584
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
14435
14585
|
}
|
|
14436
|
-
return C.
|
|
14586
|
+
return C.astFactory.wrap(reifier2 ?? C.astFactory.blankNode(void 0, C.astFactory.sourceLocation()), C.astFactory.sourceLocation(tildeToken, reifier2));
|
|
14437
14587
|
});
|
|
14438
14588
|
}
|
|
14439
14589
|
};
|
|
@@ -14463,7 +14613,7 @@ function objectImpl2(name, allowPaths) {
|
|
|
14463
14613
|
const objectVal = SUBRULE(allowPaths ? graphNodePath2 : graphNode2);
|
|
14464
14614
|
const annotationVal = SUBRULE(allowPaths ? annotationPath : annotation);
|
|
14465
14615
|
return ACTION(() => {
|
|
14466
|
-
const F3 = C.
|
|
14616
|
+
const F3 = C.astFactory;
|
|
14467
14617
|
if (F3.isPathPure(predicate) && annotationVal.length > 0) {
|
|
14468
14618
|
throw new Error("Note 17 violation");
|
|
14469
14619
|
}
|
|
@@ -14492,7 +14642,7 @@ function annotationImpl(name, allowPaths) {
|
|
|
14492
14642
|
if (!currentReifier && !C.parseMode.has("canCreateBlankNodes")) {
|
|
14493
14643
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
14494
14644
|
}
|
|
14495
|
-
currentReifier = currentReifier ?? C.
|
|
14645
|
+
currentReifier = currentReifier ?? C.astFactory.blankNode(void 0, C.astFactory.sourceLocation());
|
|
14496
14646
|
});
|
|
14497
14647
|
const block = SUBRULE(allowPaths ? annotationBlockPath : annotationBlock, currentReifier);
|
|
14498
14648
|
ACTION(() => {
|
|
@@ -14504,7 +14654,7 @@ function annotationImpl(name, allowPaths) {
|
|
|
14504
14654
|
});
|
|
14505
14655
|
return annotations;
|
|
14506
14656
|
},
|
|
14507
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14657
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14508
14658
|
for (const annotation2 of ast) {
|
|
14509
14659
|
if (F3.isTripleCollectionBlankNodeProperties(annotation2)) {
|
|
14510
14660
|
SUBRULE(annotationBlockPath, annotation2);
|
|
@@ -14525,11 +14675,18 @@ function annotationBlockImpl(name, allowPaths) {
|
|
|
14525
14675
|
const open = CONSUME(annotationOpen);
|
|
14526
14676
|
const res = SUBRULE(allowPaths ? grammar_exports.propertyListPathNotEmpty : grammar_exports.propertyListNotEmpty, arg);
|
|
14527
14677
|
const close = CONSUME(annotationClose);
|
|
14528
|
-
return ACTION(() => C.
|
|
14678
|
+
return ACTION(() => C.astFactory.tripleCollectionBlankNodeProperties(arg, res, C.astFactory.sourceLocation(open, close)));
|
|
14529
14679
|
},
|
|
14530
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast,
|
|
14531
|
-
F3
|
|
14532
|
-
|
|
14680
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC, PRINT_ON_EMPTY }) => (ast, C) => {
|
|
14681
|
+
const { astFactory: F3, indentInc } = C;
|
|
14682
|
+
F3.printFilter(ast, () => {
|
|
14683
|
+
PRINT_WORD("{|");
|
|
14684
|
+
if (ast.triples.length > 1) {
|
|
14685
|
+
C[traqulaIndentation] += indentInc;
|
|
14686
|
+
PRINT_WORD("\n");
|
|
14687
|
+
}
|
|
14688
|
+
});
|
|
14689
|
+
function printTriple(triple) {
|
|
14533
14690
|
HANDLE_LOC(triple, () => {
|
|
14534
14691
|
if (F3.isTerm(triple.predicate)) {
|
|
14535
14692
|
SUBRULE(graphNodePath2, triple.predicate);
|
|
@@ -14537,10 +14694,21 @@ function annotationBlockImpl(name, allowPaths) {
|
|
|
14537
14694
|
SUBRULE(grammar_exports.pathGenerator, triple.predicate, void 0);
|
|
14538
14695
|
}
|
|
14539
14696
|
SUBRULE(graphNodePath2, triple.object);
|
|
14540
|
-
F3.printFilter(ast, () => PRINT_WORD(";"));
|
|
14541
14697
|
});
|
|
14542
14698
|
}
|
|
14543
|
-
|
|
14699
|
+
const [head2, ...tail] = ast.triples;
|
|
14700
|
+
printTriple(head2);
|
|
14701
|
+
for (const triple of tail) {
|
|
14702
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
14703
|
+
printTriple(triple);
|
|
14704
|
+
}
|
|
14705
|
+
F3.printFilter(ast, () => {
|
|
14706
|
+
if (ast.triples.length > 1) {
|
|
14707
|
+
PRINT_ON_EMPTY("|}\n");
|
|
14708
|
+
} else {
|
|
14709
|
+
PRINT_WORD("|}");
|
|
14710
|
+
}
|
|
14711
|
+
});
|
|
14544
14712
|
}
|
|
14545
14713
|
};
|
|
14546
14714
|
}
|
|
@@ -14560,7 +14728,7 @@ var graphNodePath2 = {
|
|
|
14560
14728
|
{ ALT: () => $.SUBRULE(reifiedTriple) }
|
|
14561
14729
|
]),
|
|
14562
14730
|
gImpl: ($) => (ast, C) => {
|
|
14563
|
-
if (C.
|
|
14731
|
+
if (C.astFactory.isTripleCollectionReifiedTriple(ast)) {
|
|
14564
14732
|
$.SUBRULE(reifiedTriple, ast);
|
|
14565
14733
|
} else {
|
|
14566
14734
|
grammar_exports.graphNodePath.gImpl($)(ast, C);
|
|
@@ -14578,7 +14746,7 @@ var varOrTerm2 = {
|
|
|
14578
14746
|
{ ALT: () => SUBRULE(grammar_exports.blankNode) },
|
|
14579
14747
|
{ ALT: () => {
|
|
14580
14748
|
const token = CONSUME(lexer_exports.terminals.nil);
|
|
14581
|
-
return ACTION(() => C.
|
|
14749
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.NIL));
|
|
14582
14750
|
} },
|
|
14583
14751
|
{ ALT: () => SUBRULE(tripleTerm) }
|
|
14584
14752
|
])
|
|
@@ -14597,10 +14765,10 @@ var reifiedTriple = {
|
|
|
14597
14765
|
if (reifierVal === void 0 && !C.parseMode.has("canCreateBlankNodes")) {
|
|
14598
14766
|
throw new Error("Cannot create blanknodes in current parse mode");
|
|
14599
14767
|
}
|
|
14600
|
-
return C.
|
|
14768
|
+
return C.astFactory.tripleCollectionReifiedTriple(C.astFactory.sourceLocation(open, close), subject, predicate, object3, reifierVal?.val);
|
|
14601
14769
|
});
|
|
14602
14770
|
},
|
|
14603
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14771
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14604
14772
|
F3.printFilter(ast, () => PRINT_WORD("<<"));
|
|
14605
14773
|
const triple = ast.triples[0];
|
|
14606
14774
|
SUBRULE(graphNodePath2, triple.subject);
|
|
@@ -14639,9 +14807,9 @@ var tripleTerm = {
|
|
|
14639
14807
|
const predicate = SUBRULE(grammar_exports.verb);
|
|
14640
14808
|
const object3 = SUBRULE(tripleTermObject);
|
|
14641
14809
|
const close = CONSUME(tripleTermClose);
|
|
14642
|
-
return ACTION(() => C.
|
|
14810
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
14643
14811
|
},
|
|
14644
|
-
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, {
|
|
14812
|
+
gImpl: ({ SUBRULE, PRINT_WORD }) => (ast, { astFactory: F3 }) => {
|
|
14645
14813
|
F3.printFilter(ast, () => PRINT_WORD("<<("));
|
|
14646
14814
|
SUBRULE(graphNodePath2, ast.subject);
|
|
14647
14815
|
SUBRULE(graphNodePath2, ast.predicate);
|
|
@@ -14674,12 +14842,12 @@ var tripleTermData = {
|
|
|
14674
14842
|
{ ALT: () => SUBRULE(grammar_exports.iri) },
|
|
14675
14843
|
{ ALT: () => {
|
|
14676
14844
|
const token = CONSUME(lexer_exports.a);
|
|
14677
|
-
return ACTION(() => C.
|
|
14845
|
+
return ACTION(() => C.astFactory.namedNode(C.astFactory.sourceLocation(token), CommonIRIs.TYPE));
|
|
14678
14846
|
} }
|
|
14679
14847
|
]);
|
|
14680
14848
|
const object3 = SUBRULE(tripleTermDataObject);
|
|
14681
14849
|
const close = CONSUME(tripleTermClose);
|
|
14682
|
-
return ACTION(() => C.
|
|
14850
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
14683
14851
|
}
|
|
14684
14852
|
};
|
|
14685
14853
|
var tripleTermDataSubject = {
|
|
@@ -14711,7 +14879,7 @@ var exprTripleTerm = {
|
|
|
14711
14879
|
const predicate = SUBRULE(grammar_exports.verb);
|
|
14712
14880
|
const object3 = SUBRULE(exprTripleTermObject);
|
|
14713
14881
|
const close = CONSUME(tripleTermClose);
|
|
14714
|
-
return ACTION(() => C.
|
|
14882
|
+
return ACTION(() => C.astFactory.termTriple(subject, predicate, object3, C.astFactory.sourceLocation(open, close)));
|
|
14715
14883
|
}
|
|
14716
14884
|
};
|
|
14717
14885
|
var exprTripleTermSubject = {
|
|
@@ -14761,7 +14929,7 @@ var rdfLiteral2 = {
|
|
|
14761
14929
|
{ ALT: () => {
|
|
14762
14930
|
const langTag2 = CONSUME(LANG_DIR);
|
|
14763
14931
|
return ACTION(() => {
|
|
14764
|
-
const literal = C.
|
|
14932
|
+
const literal = C.astFactory.literalTerm(C.astFactory.sourceLocation(value, langTag2), value.value, langTag2.image.slice(1).toLowerCase());
|
|
14765
14933
|
langTagHasCorrectRange(literal);
|
|
14766
14934
|
return literal;
|
|
14767
14935
|
});
|
|
@@ -14769,7 +14937,7 @@ var rdfLiteral2 = {
|
|
|
14769
14937
|
{ ALT: () => {
|
|
14770
14938
|
CONSUME(lexer_exports.symbols.hathat);
|
|
14771
14939
|
const iriVal = SUBRULE(grammar_exports.iri);
|
|
14772
|
-
return ACTION(() => C.
|
|
14940
|
+
return ACTION(() => C.astFactory.literalTerm(C.astFactory.sourceLocation(value, iriVal), value.value, iriVal));
|
|
14773
14941
|
} }
|
|
14774
14942
|
])) ?? value;
|
|
14775
14943
|
}
|
|
@@ -14781,7 +14949,7 @@ var unaryExpression2 = {
|
|
|
14781
14949
|
{ ALT: () => {
|
|
14782
14950
|
const operator = CONSUME(lexer_exports.symbols.exclamation);
|
|
14783
14951
|
const expr = SUBRULE1(unaryExpression2);
|
|
14784
|
-
return ACTION(() => C.
|
|
14952
|
+
return ACTION(() => C.astFactory.expressionOperation("!", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
14785
14953
|
} },
|
|
14786
14954
|
{ ALT: () => {
|
|
14787
14955
|
const operator = OR2([
|
|
@@ -14789,34 +14957,36 @@ var unaryExpression2 = {
|
|
|
14789
14957
|
{ ALT: () => CONSUME(lexer_exports.symbols.opMinus) }
|
|
14790
14958
|
]);
|
|
14791
14959
|
const expr = SUBRULE2(primaryExpression2);
|
|
14792
|
-
return ACTION(() => C.
|
|
14960
|
+
return ACTION(() => C.astFactory.expressionOperation(operator.image === "!" ? "!" : operator.image === "+" ? "UPLUS" : "UMINUS", [expr], C.astFactory.sourceLocation(operator, expr)));
|
|
14793
14961
|
} }
|
|
14794
14962
|
])
|
|
14795
14963
|
};
|
|
14796
14964
|
var generateTriplesBlock = {
|
|
14797
14965
|
name: "triplesBlock",
|
|
14798
|
-
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, {
|
|
14966
|
+
gImpl: ({ SUBRULE, PRINT_WORD, HANDLE_LOC }) => (ast, { astFactory: F3 }) => {
|
|
14799
14967
|
for (const [index, triple] of ast.triples.entries()) {
|
|
14800
14968
|
HANDLE_LOC(triple, () => {
|
|
14801
14969
|
const nextTriple = ast.triples.at(index);
|
|
14802
14970
|
if (F3.isTripleCollection(triple)) {
|
|
14803
14971
|
SUBRULE(graphNodePath2, triple);
|
|
14804
|
-
F3.printFilter(triple, () => PRINT_WORD("
|
|
14972
|
+
F3.printFilter(triple, () => PRINT_WORD(".\n"));
|
|
14805
14973
|
} else {
|
|
14806
14974
|
SUBRULE(graphNodePath2, triple.subject);
|
|
14975
|
+
F3.printFilter(ast, () => PRINT_WORD(""));
|
|
14807
14976
|
if (F3.isPathPure(triple.predicate)) {
|
|
14808
14977
|
SUBRULE(grammar_exports.pathGenerator, triple.predicate, void 0);
|
|
14809
14978
|
} else {
|
|
14810
14979
|
SUBRULE(graphNodePath2, triple.predicate);
|
|
14811
14980
|
}
|
|
14981
|
+
F3.printFilter(ast, () => PRINT_WORD(""));
|
|
14812
14982
|
SUBRULE(graphNodePath2, triple.object);
|
|
14813
14983
|
SUBRULE(annotationPath, triple.annotations ?? []);
|
|
14814
14984
|
if (nextTriple === void 0 || F3.isTripleCollection(nextTriple) || !F3.isSourceLocationNoMaterialize(nextTriple.subject.loc)) {
|
|
14815
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
14985
|
+
F3.printFilter(ast, () => PRINT_WORD(".\n"));
|
|
14816
14986
|
} else if (F3.isSourceLocationNoMaterialize(nextTriple.predicate.loc)) {
|
|
14817
14987
|
F3.printFilter(ast, () => PRINT_WORD(","));
|
|
14818
14988
|
} else {
|
|
14819
|
-
F3.printFilter(ast, () => PRINT_WORD("
|
|
14989
|
+
F3.printFilter(ast, () => PRINT_WORD(";\n"));
|
|
14820
14990
|
}
|
|
14821
14991
|
}
|
|
14822
14992
|
});
|
|
@@ -14826,7 +14996,7 @@ var generateTriplesBlock = {
|
|
|
14826
14996
|
var generateGraphTerm = {
|
|
14827
14997
|
name: "graphTerm",
|
|
14828
14998
|
gImpl: ($) => (ast, C) => {
|
|
14829
|
-
if (C.
|
|
14999
|
+
if (C.astFactory.isTermTriple(ast)) {
|
|
14830
15000
|
$.SUBRULE(tripleTerm, ast);
|
|
14831
15001
|
} else {
|
|
14832
15002
|
grammar_exports.graphTerm.gImpl($)(ast, C);
|
|
@@ -14834,86 +15004,18 @@ var generateGraphTerm = {
|
|
|
14834
15004
|
}
|
|
14835
15005
|
};
|
|
14836
15006
|
|
|
14837
|
-
// lib/Factory.js
|
|
14838
|
-
var Factory2 = class extends Factory {
|
|
14839
|
-
termTriple(subject, predicate, object3, loc) {
|
|
14840
|
-
return {
|
|
14841
|
-
type: "term",
|
|
14842
|
-
subType: "triple",
|
|
14843
|
-
subject,
|
|
14844
|
-
predicate,
|
|
14845
|
-
object: object3,
|
|
14846
|
-
loc
|
|
14847
|
-
};
|
|
14848
|
-
}
|
|
14849
|
-
isTermTriple(obj) {
|
|
14850
|
-
return this.isOfSubType(obj, "term", "triple");
|
|
14851
|
-
}
|
|
14852
|
-
tripleCollectionReifiedTriple(loc, subject, predicate, object3, reifier2) {
|
|
14853
|
-
return {
|
|
14854
|
-
type: "tripleCollection",
|
|
14855
|
-
subType: "reifiedTriple",
|
|
14856
|
-
triples: [this.triple(subject, predicate, object3)],
|
|
14857
|
-
identifier: reifier2 ?? this.blankNode(void 0, this.sourceLocationNoMaterialize()),
|
|
14858
|
-
loc
|
|
14859
|
-
};
|
|
14860
|
-
}
|
|
14861
|
-
isTripleCollectionReifiedTriple(obj) {
|
|
14862
|
-
return this.isOfSubType(obj, "tripleCollection", "reifiedTriple");
|
|
14863
|
-
}
|
|
14864
|
-
tripleCollectionBlankNodeProperties(identifier, triples, loc) {
|
|
14865
|
-
return {
|
|
14866
|
-
type: "tripleCollection",
|
|
14867
|
-
subType: "blankNodeProperties",
|
|
14868
|
-
triples,
|
|
14869
|
-
identifier,
|
|
14870
|
-
loc
|
|
14871
|
-
};
|
|
14872
|
-
}
|
|
14873
|
-
/**
|
|
14874
|
-
* Overwritten triple constructor to always contain an empty annotations list
|
|
14875
|
-
*/
|
|
14876
|
-
triple = (subject, predicate, object3, loc) => ({
|
|
14877
|
-
type: "triple",
|
|
14878
|
-
subject,
|
|
14879
|
-
predicate,
|
|
14880
|
-
object: object3,
|
|
14881
|
-
annotations: [],
|
|
14882
|
-
loc: loc ?? this.sourceLocation(subject, predicate, object3)
|
|
14883
|
-
});
|
|
14884
|
-
annotatedTriple(subject, predicate, object3, annotations, loc) {
|
|
14885
|
-
return {
|
|
14886
|
-
type: "triple",
|
|
14887
|
-
subject,
|
|
14888
|
-
predicate,
|
|
14889
|
-
object: object3,
|
|
14890
|
-
annotations: annotations ?? [],
|
|
14891
|
-
loc: loc ?? this.sourceLocation(subject, predicate, object3, ...annotations ?? [])
|
|
14892
|
-
};
|
|
14893
|
-
}
|
|
14894
|
-
contextDefinitionVersion(version2, loc) {
|
|
14895
|
-
return {
|
|
14896
|
-
type: "contextDef",
|
|
14897
|
-
subType: "version",
|
|
14898
|
-
version: version2,
|
|
14899
|
-
loc
|
|
14900
|
-
};
|
|
14901
|
-
}
|
|
14902
|
-
isContextDefinitionVersion(obj) {
|
|
14903
|
-
return this.isOfSubType(obj, "contextDef", "version");
|
|
14904
|
-
}
|
|
14905
|
-
};
|
|
14906
|
-
|
|
14907
15007
|
// lib/parserUtils.js
|
|
14908
15008
|
function completeParseContext(context) {
|
|
14909
15009
|
return {
|
|
14910
|
-
|
|
15010
|
+
astFactory: context.astFactory ?? new AstFactory2(),
|
|
14911
15011
|
baseIRI: context.baseIRI,
|
|
14912
15012
|
prefixes: { ...context.prefixes },
|
|
14913
15013
|
origSource: context.origSource ?? "",
|
|
14914
15014
|
offset: context.offset,
|
|
14915
15015
|
parseMode: context.parseMode ? new Set(context.parseMode) : /* @__PURE__ */ new Set(["canParseVars", "canCreateBlankNodes"]),
|
|
14916
|
-
skipValidation: context.skipValidation ?? false
|
|
15016
|
+
skipValidation: context.skipValidation ?? false,
|
|
15017
|
+
indentInc: context.indentInc ?? 2,
|
|
15018
|
+
[traqulaIndentation]: context[traqulaIndentation] ?? 0
|
|
14917
15019
|
};
|
|
14918
15020
|
}
|
|
14919
15021
|
/*! Bundled license information:
|