@ldo/traverser-shexj 0.0.1-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +879 -0
- package/dist/ShexJTraverser.d.ts +316 -0
- package/dist/ShexJTraverser.js +7 -0
- package/dist/ShexJTraverser.js.map +1 -0
- package/dist/ShexJTraverserDefinition.d.ts +3 -0
- package/dist/ShexJTraverserDefinition.js +291 -0
- package/dist/ShexJTraverserDefinition.js.map +1 -0
- package/dist/ShexJTraverserTypes.d.ts +317 -0
- package/dist/ShexJTraverserTypes.js +3 -0
- package/dist/ShexJTraverserTypes.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/package.json +39 -0
- package/src/ShexJTraverser.ts +7 -0
- package/src/ShexJTraverserDefinition.ts +303 -0
- package/src/ShexJTraverserTypes.ts +375 -0
- package/src/index.ts +5 -0
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Annotation,
|
|
3
|
+
BNODE,
|
|
4
|
+
BOOL,
|
|
5
|
+
DECIMAL,
|
|
6
|
+
DOUBLE,
|
|
7
|
+
EachOf,
|
|
8
|
+
INTEGER,
|
|
9
|
+
IRI,
|
|
10
|
+
IRIREF,
|
|
11
|
+
IriStem,
|
|
12
|
+
IriStemRange,
|
|
13
|
+
LANGTAG,
|
|
14
|
+
Language,
|
|
15
|
+
LanguageStem,
|
|
16
|
+
LanguageStemRange,
|
|
17
|
+
LiteralStem,
|
|
18
|
+
LiteralStemRange,
|
|
19
|
+
NodeConstraint,
|
|
20
|
+
numericLiteral,
|
|
21
|
+
ObjectLiteral,
|
|
22
|
+
objectValue,
|
|
23
|
+
OneOf,
|
|
24
|
+
Schema,
|
|
25
|
+
SemAct,
|
|
26
|
+
Shape,
|
|
27
|
+
ShapeAnd,
|
|
28
|
+
ShapeDecl,
|
|
29
|
+
shapeDeclLabel,
|
|
30
|
+
shapeDeclRef,
|
|
31
|
+
shapeExpr,
|
|
32
|
+
shapeExprOrRef,
|
|
33
|
+
ShapeExternal,
|
|
34
|
+
ShapeNot,
|
|
35
|
+
ShapeOr,
|
|
36
|
+
STRING,
|
|
37
|
+
TripleConstraint,
|
|
38
|
+
tripleExpr,
|
|
39
|
+
tripleExprLabel,
|
|
40
|
+
tripleExprOrRef,
|
|
41
|
+
tripleExprRef,
|
|
42
|
+
valueSetValue,
|
|
43
|
+
Wildcard,
|
|
44
|
+
} from "shexj";
|
|
45
|
+
import type { ValidateTraverserTypes } from "@ldo/type-traverser";
|
|
46
|
+
|
|
47
|
+
export type ShexJTraverserTypes = ValidateTraverserTypes<{
|
|
48
|
+
Schema: {
|
|
49
|
+
kind: "interface";
|
|
50
|
+
type: Schema;
|
|
51
|
+
properties: {
|
|
52
|
+
startActs: "SemAct";
|
|
53
|
+
start: "shapeExprOrRef";
|
|
54
|
+
imports: "IRIREF";
|
|
55
|
+
shapes: "ShapeDecl";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
ShapeDecl: {
|
|
59
|
+
kind: "interface";
|
|
60
|
+
type: ShapeDecl;
|
|
61
|
+
properties: {
|
|
62
|
+
id: "shapeDeclLabel";
|
|
63
|
+
abstract: "BOOL";
|
|
64
|
+
restricts: "shapeExprOrRef";
|
|
65
|
+
shapeExpr: "shapeExpr";
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
shapeExpr: {
|
|
69
|
+
kind: "union";
|
|
70
|
+
type: shapeExpr;
|
|
71
|
+
typeNames:
|
|
72
|
+
| "ShapeOr"
|
|
73
|
+
| "ShapeAnd"
|
|
74
|
+
| "ShapeNot"
|
|
75
|
+
| "NodeConstraint"
|
|
76
|
+
| "Shape"
|
|
77
|
+
| "ShapeExternal";
|
|
78
|
+
};
|
|
79
|
+
shapeExprOrRef: {
|
|
80
|
+
kind: "union";
|
|
81
|
+
type: shapeExprOrRef;
|
|
82
|
+
typeNames: "shapeExpr" | "shapeDeclRef";
|
|
83
|
+
};
|
|
84
|
+
ShapeOr: {
|
|
85
|
+
kind: "interface";
|
|
86
|
+
type: ShapeOr;
|
|
87
|
+
properties: {
|
|
88
|
+
shapeExprs: "shapeExprOrRef";
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
ShapeAnd: {
|
|
92
|
+
kind: "interface";
|
|
93
|
+
type: ShapeAnd;
|
|
94
|
+
properties: {
|
|
95
|
+
shapeExprs: "shapeExprOrRef";
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
ShapeNot: {
|
|
99
|
+
kind: "interface";
|
|
100
|
+
type: ShapeNot;
|
|
101
|
+
properties: {
|
|
102
|
+
shapeExpr: "shapeExprOrRef";
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
ShapeExternal: {
|
|
106
|
+
kind: "interface";
|
|
107
|
+
type: ShapeExternal;
|
|
108
|
+
properties: Record<string, never>;
|
|
109
|
+
};
|
|
110
|
+
shapeDeclRef: {
|
|
111
|
+
kind: "union";
|
|
112
|
+
type: shapeDeclRef;
|
|
113
|
+
typeNames: "shapeDeclLabel";
|
|
114
|
+
};
|
|
115
|
+
shapeDeclLabel: {
|
|
116
|
+
kind: "union";
|
|
117
|
+
type: shapeDeclLabel;
|
|
118
|
+
typeNames: "IRIREF" | "BNODE";
|
|
119
|
+
};
|
|
120
|
+
NodeConstraint: {
|
|
121
|
+
kind: "interface";
|
|
122
|
+
type: NodeConstraint;
|
|
123
|
+
properties: {
|
|
124
|
+
datatype: "IRIREF";
|
|
125
|
+
values: "valueSetValue";
|
|
126
|
+
length: "INTEGER";
|
|
127
|
+
minlength: "INTEGER";
|
|
128
|
+
maxlength: "INTEGER";
|
|
129
|
+
pattern: "STRING";
|
|
130
|
+
flags: "STRING";
|
|
131
|
+
mininclusive: "numericLiteral";
|
|
132
|
+
minexclusive: "numericLiteral";
|
|
133
|
+
totaldigits: "INTEGER";
|
|
134
|
+
fractiondigits: "INTEGER";
|
|
135
|
+
semActs: "SemAct";
|
|
136
|
+
annotations: "Annotation";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
numericLiteral: {
|
|
140
|
+
kind: "union";
|
|
141
|
+
type: numericLiteral;
|
|
142
|
+
typeNames: "INTEGER" | "DECIMAL" | "DOUBLE";
|
|
143
|
+
};
|
|
144
|
+
valueSetValue: {
|
|
145
|
+
kind: "union";
|
|
146
|
+
type: valueSetValue;
|
|
147
|
+
typeNames:
|
|
148
|
+
| "objectValue"
|
|
149
|
+
| "IriStem"
|
|
150
|
+
| "IriStemRange"
|
|
151
|
+
| "LiteralStem"
|
|
152
|
+
| "LiteralStemRange"
|
|
153
|
+
| "Language"
|
|
154
|
+
| "LanguageStem"
|
|
155
|
+
| "LanguageStemRange";
|
|
156
|
+
};
|
|
157
|
+
objectValue: {
|
|
158
|
+
kind: "union";
|
|
159
|
+
type: objectValue;
|
|
160
|
+
typeNames: "IRIREF" | "ObjectLiteral";
|
|
161
|
+
};
|
|
162
|
+
ObjectLiteral: {
|
|
163
|
+
kind: "interface";
|
|
164
|
+
type: ObjectLiteral;
|
|
165
|
+
properties: {
|
|
166
|
+
value: "STRING";
|
|
167
|
+
language: "STRING";
|
|
168
|
+
type: "STRING";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
IriStem: {
|
|
172
|
+
kind: "interface";
|
|
173
|
+
type: IriStem;
|
|
174
|
+
properties: {
|
|
175
|
+
stem: "IRIREF";
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
IriStemRange: {
|
|
179
|
+
kind: "interface";
|
|
180
|
+
type: IriStemRange;
|
|
181
|
+
properties: {
|
|
182
|
+
stem: "IRIREF";
|
|
183
|
+
exclusions: "IriStemRangeExclusions";
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
IriStemRangeExclusions: {
|
|
187
|
+
kind: "union";
|
|
188
|
+
type: IRIREF | IriStem;
|
|
189
|
+
typeNames: "IRIREF" | "IriStem";
|
|
190
|
+
};
|
|
191
|
+
LiteralStem: {
|
|
192
|
+
kind: "interface";
|
|
193
|
+
type: LiteralStem;
|
|
194
|
+
properties: {
|
|
195
|
+
stem: "STRING";
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
LiteralStemRange: {
|
|
199
|
+
kind: "interface";
|
|
200
|
+
type: LiteralStemRange;
|
|
201
|
+
properties: {
|
|
202
|
+
stem: "LiteralStemRangeStem";
|
|
203
|
+
exclusions: "LiteralStemRangeExclusions";
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
LiteralStemRangeStem: {
|
|
207
|
+
kind: "union";
|
|
208
|
+
type: STRING | Wildcard;
|
|
209
|
+
typeNames: "STRING" | "Wildcard";
|
|
210
|
+
};
|
|
211
|
+
LiteralStemRangeExclusions: {
|
|
212
|
+
kind: "union";
|
|
213
|
+
type: STRING | LiteralStem;
|
|
214
|
+
typeNames: "STRING" | "LiteralStem";
|
|
215
|
+
};
|
|
216
|
+
Language: {
|
|
217
|
+
kind: "interface";
|
|
218
|
+
type: Language;
|
|
219
|
+
properties: {
|
|
220
|
+
languageTag: "LANGTAG";
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
LanguageStem: {
|
|
224
|
+
kind: "interface";
|
|
225
|
+
type: LanguageStem;
|
|
226
|
+
properties: {
|
|
227
|
+
stem: "LANGTAG";
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
LanguageStemRange: {
|
|
231
|
+
kind: "interface";
|
|
232
|
+
type: LanguageStemRange;
|
|
233
|
+
properties: {
|
|
234
|
+
stem: "LanguageStemRangeStem";
|
|
235
|
+
exclusions: "LanguageStemRangeExclusions";
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
LanguageStemRangeStem: {
|
|
239
|
+
kind: "union";
|
|
240
|
+
type: LANGTAG | Wildcard;
|
|
241
|
+
typeNames: "LANGTAG" | "Wildcard";
|
|
242
|
+
};
|
|
243
|
+
LanguageStemRangeExclusions: {
|
|
244
|
+
kind: "union";
|
|
245
|
+
type: LANGTAG | LanguageStem;
|
|
246
|
+
typeNames: "LANGTAG" | "LanguageStem";
|
|
247
|
+
};
|
|
248
|
+
Wildcard: {
|
|
249
|
+
kind: "interface";
|
|
250
|
+
type: Wildcard;
|
|
251
|
+
properties: Record<string, never>;
|
|
252
|
+
};
|
|
253
|
+
Shape: {
|
|
254
|
+
kind: "interface";
|
|
255
|
+
type: Shape;
|
|
256
|
+
properties: {
|
|
257
|
+
closed: "BOOL";
|
|
258
|
+
extra: "IRIREF";
|
|
259
|
+
extends: "shapeExprOrRef";
|
|
260
|
+
expression: "tripleExprOrRef";
|
|
261
|
+
semActs: "SemAct";
|
|
262
|
+
annotations: "Annotation";
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
tripleExpr: {
|
|
266
|
+
kind: "union";
|
|
267
|
+
type: tripleExpr;
|
|
268
|
+
typeNames: "EachOf" | "OneOf" | "TripleConstraint";
|
|
269
|
+
};
|
|
270
|
+
tripleExprOrRef: {
|
|
271
|
+
kind: "union";
|
|
272
|
+
type: tripleExprOrRef;
|
|
273
|
+
typeNames: "tripleExpr" | "tripleExprRef";
|
|
274
|
+
};
|
|
275
|
+
EachOf: {
|
|
276
|
+
kind: "interface";
|
|
277
|
+
type: EachOf;
|
|
278
|
+
properties: {
|
|
279
|
+
id: "tripleExprLabel";
|
|
280
|
+
min: "INTEGER";
|
|
281
|
+
max: "INTEGER";
|
|
282
|
+
expressions: "tripleExprOrRef";
|
|
283
|
+
semActs: "SemAct";
|
|
284
|
+
annotations: "Annotation";
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
OneOf: {
|
|
288
|
+
kind: "interface";
|
|
289
|
+
type: OneOf;
|
|
290
|
+
properties: {
|
|
291
|
+
id: "tripleExprLabel";
|
|
292
|
+
min: "INTEGER";
|
|
293
|
+
max: "INTEGER";
|
|
294
|
+
expressions: "tripleExprOrRef";
|
|
295
|
+
semActs: "SemAct";
|
|
296
|
+
annotations: "Annotation";
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
TripleConstraint: {
|
|
300
|
+
kind: "interface";
|
|
301
|
+
type: TripleConstraint;
|
|
302
|
+
properties: {
|
|
303
|
+
id: "tripleExprLabel";
|
|
304
|
+
min: "INTEGER";
|
|
305
|
+
max: "INTEGER";
|
|
306
|
+
inverse: "BOOL";
|
|
307
|
+
predicate: "IRIREF";
|
|
308
|
+
valueExpr: "shapeExprOrRef";
|
|
309
|
+
semActs: "SemAct";
|
|
310
|
+
annotations: "Annotation";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
tripleExprRef: {
|
|
314
|
+
kind: "union";
|
|
315
|
+
type: tripleExprRef;
|
|
316
|
+
typeNames: "tripleExprLabel";
|
|
317
|
+
};
|
|
318
|
+
tripleExprLabel: {
|
|
319
|
+
kind: "union";
|
|
320
|
+
type: tripleExprLabel;
|
|
321
|
+
typeNames: "IRIREF" | "BNODE";
|
|
322
|
+
};
|
|
323
|
+
SemAct: {
|
|
324
|
+
kind: "interface";
|
|
325
|
+
type: SemAct;
|
|
326
|
+
properties: {
|
|
327
|
+
name: "IRIREF";
|
|
328
|
+
code: "STRING";
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
Annotation: {
|
|
332
|
+
kind: "interface";
|
|
333
|
+
type: Annotation;
|
|
334
|
+
properties: {
|
|
335
|
+
predicate: "IRI";
|
|
336
|
+
object: "objectValue";
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
IRIREF: {
|
|
340
|
+
kind: "primitive";
|
|
341
|
+
type: IRIREF;
|
|
342
|
+
};
|
|
343
|
+
BNODE: {
|
|
344
|
+
kind: "primitive";
|
|
345
|
+
type: BNODE;
|
|
346
|
+
};
|
|
347
|
+
INTEGER: {
|
|
348
|
+
kind: "primitive";
|
|
349
|
+
type: INTEGER;
|
|
350
|
+
};
|
|
351
|
+
STRING: {
|
|
352
|
+
kind: "primitive";
|
|
353
|
+
type: STRING;
|
|
354
|
+
};
|
|
355
|
+
DECIMAL: {
|
|
356
|
+
kind: "primitive";
|
|
357
|
+
type: DECIMAL;
|
|
358
|
+
};
|
|
359
|
+
DOUBLE: {
|
|
360
|
+
kind: "primitive";
|
|
361
|
+
type: DOUBLE;
|
|
362
|
+
};
|
|
363
|
+
LANGTAG: {
|
|
364
|
+
kind: "primitive";
|
|
365
|
+
type: LANGTAG;
|
|
366
|
+
};
|
|
367
|
+
BOOL: {
|
|
368
|
+
kind: "primitive";
|
|
369
|
+
type: BOOL;
|
|
370
|
+
};
|
|
371
|
+
IRI: {
|
|
372
|
+
kind: "primitive";
|
|
373
|
+
type: IRI;
|
|
374
|
+
};
|
|
375
|
+
}>;
|