@ldo/traverser-shexj 0.0.1-alpha.24 → 0.0.1-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ShexJTraverser.d.ts +35 -35
- package/dist/ShexJTraverserDefinition.d.ts +2 -2
- package/dist/ShexJTraverserDefinition.js +4 -2
- package/dist/ShexJTraverserDefinition.js.map +1 -1
- package/dist/ShexJTraverserTypes.d.ts +2 -2
- package/dist/ShexJTypes.d.ts +160 -0
- package/dist/ShexJTypes.js +3 -0
- package/dist/ShexJTypes.js.map +1 -0
- package/package.json +3 -4
- package/src/ShexJTraverserDefinition.ts +8 -5
- package/src/ShexJTraverserTypes.ts +2 -2
- package/src/ShexJTypes.ts +602 -0
package/dist/ShexJTraverser.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Traverser } from "@ldo/type-traverser";
|
|
|
2
2
|
export declare const ShexJTraverser: Traverser<{
|
|
3
3
|
Schema: {
|
|
4
4
|
kind: "interface";
|
|
5
|
-
type: import("
|
|
5
|
+
type: import("./ShexJTypes").Schema;
|
|
6
6
|
properties: {
|
|
7
7
|
startActs: "SemAct";
|
|
8
8
|
start: "shapeExprOrRef";
|
|
@@ -12,7 +12,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
12
12
|
};
|
|
13
13
|
ShapeDecl: {
|
|
14
14
|
kind: "interface";
|
|
15
|
-
type: import("
|
|
15
|
+
type: import("./ShexJTypes").ShapeDecl;
|
|
16
16
|
properties: {
|
|
17
17
|
id: "shapeDeclLabel";
|
|
18
18
|
abstract: "BOOL";
|
|
@@ -22,44 +22,44 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
22
22
|
};
|
|
23
23
|
shapeExpr: {
|
|
24
24
|
kind: "union";
|
|
25
|
-
type: import("
|
|
25
|
+
type: import("./ShexJTypes").shapeExpr;
|
|
26
26
|
typeNames: "ShapeOr" | "ShapeAnd" | "ShapeNot" | "ShapeExternal" | "NodeConstraint" | "Shape";
|
|
27
27
|
};
|
|
28
28
|
shapeExprOrRef: {
|
|
29
29
|
kind: "union";
|
|
30
|
-
type: import("
|
|
30
|
+
type: import("./ShexJTypes").shapeExprOrRef;
|
|
31
31
|
typeNames: "shapeExpr" | "shapeDeclRef";
|
|
32
32
|
};
|
|
33
33
|
ShapeOr: {
|
|
34
34
|
kind: "interface";
|
|
35
|
-
type: import("
|
|
35
|
+
type: import("./ShexJTypes").ShapeOr;
|
|
36
36
|
properties: {
|
|
37
37
|
shapeExprs: "shapeExprOrRef";
|
|
38
38
|
};
|
|
39
39
|
};
|
|
40
40
|
ShapeAnd: {
|
|
41
41
|
kind: "interface";
|
|
42
|
-
type: import("
|
|
42
|
+
type: import("./ShexJTypes").ShapeAnd;
|
|
43
43
|
properties: {
|
|
44
44
|
shapeExprs: "shapeExprOrRef";
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
ShapeNot: {
|
|
48
48
|
kind: "interface";
|
|
49
|
-
type: import("
|
|
49
|
+
type: import("./ShexJTypes").ShapeNot;
|
|
50
50
|
properties: {
|
|
51
51
|
shapeExpr: "shapeExprOrRef";
|
|
52
52
|
};
|
|
53
53
|
};
|
|
54
54
|
ShapeExternal: {
|
|
55
55
|
kind: "interface";
|
|
56
|
-
type: import("
|
|
56
|
+
type: import("./ShexJTypes").ShapeExternal;
|
|
57
57
|
properties: Record<string, never>;
|
|
58
58
|
};
|
|
59
59
|
shapeDeclRef: {
|
|
60
60
|
kind: "union";
|
|
61
|
-
type:
|
|
62
|
-
typeNames: "shapeDeclLabel";
|
|
61
|
+
type: import("./ShexJTypes").shapeDeclRef;
|
|
62
|
+
typeNames: "ShapeDecl" | "shapeDeclLabel";
|
|
63
63
|
};
|
|
64
64
|
shapeDeclLabel: {
|
|
65
65
|
kind: "union";
|
|
@@ -68,7 +68,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
68
68
|
};
|
|
69
69
|
NodeConstraint: {
|
|
70
70
|
kind: "interface";
|
|
71
|
-
type: import("
|
|
71
|
+
type: import("./ShexJTypes").NodeConstraint;
|
|
72
72
|
properties: {
|
|
73
73
|
datatype: "IRIREF";
|
|
74
74
|
values: "valueSetValue";
|
|
@@ -92,17 +92,17 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
92
92
|
};
|
|
93
93
|
valueSetValue: {
|
|
94
94
|
kind: "union";
|
|
95
|
-
type: import("
|
|
95
|
+
type: import("./ShexJTypes").valueSetValue;
|
|
96
96
|
typeNames: "IriStem" | "IriStemRange" | "LiteralStem" | "LiteralStemRange" | "Language" | "LanguageStem" | "LanguageStemRange" | "objectValue";
|
|
97
97
|
};
|
|
98
98
|
objectValue: {
|
|
99
99
|
kind: "union";
|
|
100
|
-
type: import("
|
|
100
|
+
type: import("./ShexJTypes").objectValue;
|
|
101
101
|
typeNames: "IRIREF" | "ObjectLiteral";
|
|
102
102
|
};
|
|
103
103
|
ObjectLiteral: {
|
|
104
104
|
kind: "interface";
|
|
105
|
-
type: import("
|
|
105
|
+
type: import("./ShexJTypes").ObjectLiteral;
|
|
106
106
|
properties: {
|
|
107
107
|
value: "STRING";
|
|
108
108
|
language: "STRING";
|
|
@@ -111,14 +111,14 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
111
111
|
};
|
|
112
112
|
IriStem: {
|
|
113
113
|
kind: "interface";
|
|
114
|
-
type: import("
|
|
114
|
+
type: import("./ShexJTypes").IriStem;
|
|
115
115
|
properties: {
|
|
116
116
|
stem: "IRIREF";
|
|
117
117
|
};
|
|
118
118
|
};
|
|
119
119
|
IriStemRange: {
|
|
120
120
|
kind: "interface";
|
|
121
|
-
type: import("
|
|
121
|
+
type: import("./ShexJTypes").IriStemRange;
|
|
122
122
|
properties: {
|
|
123
123
|
stem: "IRIREF";
|
|
124
124
|
exclusions: "IriStemRangeExclusions";
|
|
@@ -126,19 +126,19 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
126
126
|
};
|
|
127
127
|
IriStemRangeExclusions: {
|
|
128
128
|
kind: "union";
|
|
129
|
-
type: string | import("
|
|
129
|
+
type: string | import("./ShexJTypes").IriStem;
|
|
130
130
|
typeNames: "IriStem" | "IRIREF";
|
|
131
131
|
};
|
|
132
132
|
LiteralStem: {
|
|
133
133
|
kind: "interface";
|
|
134
|
-
type: import("
|
|
134
|
+
type: import("./ShexJTypes").LiteralStem;
|
|
135
135
|
properties: {
|
|
136
136
|
stem: "STRING";
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
139
|
LiteralStemRange: {
|
|
140
140
|
kind: "interface";
|
|
141
|
-
type: import("
|
|
141
|
+
type: import("./ShexJTypes").LiteralStemRange;
|
|
142
142
|
properties: {
|
|
143
143
|
stem: "LiteralStemRangeStem";
|
|
144
144
|
exclusions: "LiteralStemRangeExclusions";
|
|
@@ -146,31 +146,31 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
146
146
|
};
|
|
147
147
|
LiteralStemRangeStem: {
|
|
148
148
|
kind: "union";
|
|
149
|
-
type: string | import("
|
|
149
|
+
type: string | import("./ShexJTypes").Wildcard;
|
|
150
150
|
typeNames: "Wildcard" | "STRING";
|
|
151
151
|
};
|
|
152
152
|
LiteralStemRangeExclusions: {
|
|
153
153
|
kind: "union";
|
|
154
|
-
type: string | import("
|
|
154
|
+
type: string | import("./ShexJTypes").LiteralStem;
|
|
155
155
|
typeNames: "LiteralStem" | "STRING";
|
|
156
156
|
};
|
|
157
157
|
Language: {
|
|
158
158
|
kind: "interface";
|
|
159
|
-
type: import("
|
|
159
|
+
type: import("./ShexJTypes").Language;
|
|
160
160
|
properties: {
|
|
161
161
|
languageTag: "LANGTAG";
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
164
|
LanguageStem: {
|
|
165
165
|
kind: "interface";
|
|
166
|
-
type: import("
|
|
166
|
+
type: import("./ShexJTypes").LanguageStem;
|
|
167
167
|
properties: {
|
|
168
168
|
stem: "LANGTAG";
|
|
169
169
|
};
|
|
170
170
|
};
|
|
171
171
|
LanguageStemRange: {
|
|
172
172
|
kind: "interface";
|
|
173
|
-
type: import("
|
|
173
|
+
type: import("./ShexJTypes").LanguageStemRange;
|
|
174
174
|
properties: {
|
|
175
175
|
stem: "LanguageStemRangeStem";
|
|
176
176
|
exclusions: "LanguageStemRangeExclusions";
|
|
@@ -178,22 +178,22 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
178
178
|
};
|
|
179
179
|
LanguageStemRangeStem: {
|
|
180
180
|
kind: "union";
|
|
181
|
-
type: string | import("
|
|
181
|
+
type: string | import("./ShexJTypes").Wildcard;
|
|
182
182
|
typeNames: "Wildcard" | "LANGTAG";
|
|
183
183
|
};
|
|
184
184
|
LanguageStemRangeExclusions: {
|
|
185
185
|
kind: "union";
|
|
186
|
-
type: string | import("
|
|
186
|
+
type: string | import("./ShexJTypes").LanguageStem;
|
|
187
187
|
typeNames: "LanguageStem" | "LANGTAG";
|
|
188
188
|
};
|
|
189
189
|
Wildcard: {
|
|
190
190
|
kind: "interface";
|
|
191
|
-
type: import("
|
|
191
|
+
type: import("./ShexJTypes").Wildcard;
|
|
192
192
|
properties: Record<string, never>;
|
|
193
193
|
};
|
|
194
194
|
Shape: {
|
|
195
195
|
kind: "interface";
|
|
196
|
-
type: import("
|
|
196
|
+
type: import("./ShexJTypes").Shape;
|
|
197
197
|
properties: {
|
|
198
198
|
closed: "BOOL";
|
|
199
199
|
extra: "IRIREF";
|
|
@@ -205,17 +205,17 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
205
205
|
};
|
|
206
206
|
tripleExpr: {
|
|
207
207
|
kind: "union";
|
|
208
|
-
type: import("
|
|
208
|
+
type: import("./ShexJTypes").tripleExpr;
|
|
209
209
|
typeNames: "EachOf" | "OneOf" | "TripleConstraint";
|
|
210
210
|
};
|
|
211
211
|
tripleExprOrRef: {
|
|
212
212
|
kind: "union";
|
|
213
|
-
type: import("
|
|
213
|
+
type: import("./ShexJTypes").tripleExprOrRef;
|
|
214
214
|
typeNames: "tripleExpr" | "tripleExprRef";
|
|
215
215
|
};
|
|
216
216
|
EachOf: {
|
|
217
217
|
kind: "interface";
|
|
218
|
-
type: import("
|
|
218
|
+
type: import("./ShexJTypes").EachOf;
|
|
219
219
|
properties: {
|
|
220
220
|
id: "tripleExprLabel";
|
|
221
221
|
min: "INTEGER";
|
|
@@ -227,7 +227,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
227
227
|
};
|
|
228
228
|
OneOf: {
|
|
229
229
|
kind: "interface";
|
|
230
|
-
type: import("
|
|
230
|
+
type: import("./ShexJTypes").OneOf;
|
|
231
231
|
properties: {
|
|
232
232
|
id: "tripleExprLabel";
|
|
233
233
|
min: "INTEGER";
|
|
@@ -239,7 +239,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
239
239
|
};
|
|
240
240
|
TripleConstraint: {
|
|
241
241
|
kind: "interface";
|
|
242
|
-
type: import("
|
|
242
|
+
type: import("./ShexJTypes").TripleConstraint;
|
|
243
243
|
properties: {
|
|
244
244
|
id: "tripleExprLabel";
|
|
245
245
|
min: "INTEGER";
|
|
@@ -263,7 +263,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
263
263
|
};
|
|
264
264
|
SemAct: {
|
|
265
265
|
kind: "interface";
|
|
266
|
-
type: import("
|
|
266
|
+
type: import("./ShexJTypes").SemAct;
|
|
267
267
|
properties: {
|
|
268
268
|
name: "IRIREF";
|
|
269
269
|
code: "STRING";
|
|
@@ -271,7 +271,7 @@ export declare const ShexJTraverser: Traverser<{
|
|
|
271
271
|
};
|
|
272
272
|
Annotation: {
|
|
273
273
|
kind: "interface";
|
|
274
|
-
type: import("
|
|
274
|
+
type: import("./ShexJTypes").Annotation;
|
|
275
275
|
properties: {
|
|
276
276
|
predicate: "IRI";
|
|
277
277
|
object: "objectValue";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ShexJTraverserTypes } from ".";
|
|
2
|
-
import type {
|
|
3
|
-
export declare const ShexJTraverserDefinition:
|
|
2
|
+
import type { TraverserDefinitions } from "@ldo/type-traverser";
|
|
3
|
+
export declare const ShexJTraverserDefinition: TraverserDefinitions<ShexJTraverserTypes>;
|
|
@@ -26,7 +26,9 @@ exports.ShexJTraverserDefinition = {
|
|
|
26
26
|
},
|
|
27
27
|
shapeExprOrRef: {
|
|
28
28
|
kind: "union",
|
|
29
|
-
selector: (item) => typeof item === "string"
|
|
29
|
+
selector: (item) => typeof item === "string" || item.type === "ShapeDecl"
|
|
30
|
+
? "shapeDeclRef"
|
|
31
|
+
: "shapeExpr",
|
|
30
32
|
},
|
|
31
33
|
ShapeOr: {
|
|
32
34
|
kind: "interface",
|
|
@@ -52,7 +54,7 @@ exports.ShexJTraverserDefinition = {
|
|
|
52
54
|
},
|
|
53
55
|
shapeDeclRef: {
|
|
54
56
|
kind: "union",
|
|
55
|
-
selector: () => "shapeDeclLabel",
|
|
57
|
+
selector: (value) => typeof value === "string" ? "shapeDeclLabel" : "ShapeDecl",
|
|
56
58
|
},
|
|
57
59
|
shapeDeclLabel: {
|
|
58
60
|
kind: "union",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShexJTraverserDefinition.js","sourceRoot":"","sources":["../src/ShexJTraverserDefinition.ts"],"names":[],"mappings":";;;AAIa,QAAA,wBAAwB,GACnC;IACE,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,WAAW;SACpB;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,EAAE,EAAE,gBAAgB;YACpB,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,gBAAgB;YAC3B,SAAS,EAAE,WAAW;SACvB;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,CAAC,IAAe,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;KACzC;IACD,cAAc,EAAE;QACd,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CACjB,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"ShexJTraverserDefinition.js","sourceRoot":"","sources":["../src/ShexJTraverserDefinition.ts"],"names":[],"mappings":";;;AAIa,QAAA,wBAAwB,GACnC;IACE,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,gBAAgB;YACvB,OAAO,EAAE,QAAQ;YACjB,MAAM,EAAE,WAAW;SACpB;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,EAAE,EAAE,gBAAgB;YACpB,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,gBAAgB;YAC3B,SAAS,EAAE,WAAW;SACvB;KACF;IACD,SAAS,EAAE;QACT,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,CAAC,IAAe,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI;KACzC;IACD,cAAc,EAAE;QACd,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CACjB,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;YACnD,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,WAAW;KAClB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,UAAU,EAAE,gBAAgB;SAC7B;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,UAAU,EAAE,gBAAgB;SAC7B;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,WAAW;QACjB,UAAU,EAAE;YACV,SAAS,EAAE,gBAAgB;SAC5B;KACF;IACD,aAAa,EAAE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KAAK,EAAE;QACL,IAAI,EAAE,WAAW;KAClB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;KAClB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;KAClB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;KAClB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,WAAW;KAClB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,WAAW;KAClB;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;KAClB;IACD,GAAG,EAAE;QACH,IAAI,EAAE,WAAW;KAClB;CACF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Annotation, BNODE, BOOL, DECIMAL, DOUBLE, EachOf, INTEGER, IRI, IRIREF, IriStem, IriStemRange, LANGTAG, Language, LanguageStem, LanguageStemRange, LiteralStem, LiteralStemRange, NodeConstraint, numericLiteral, ObjectLiteral, objectValue, OneOf, Schema, SemAct, Shape, ShapeAnd, ShapeDecl, shapeDeclLabel, shapeDeclRef, shapeExpr, shapeExprOrRef, ShapeExternal, ShapeNot, ShapeOr, STRING, TripleConstraint, tripleExpr, tripleExprLabel, tripleExprOrRef, tripleExprRef, valueSetValue, Wildcard } from "
|
|
1
|
+
import type { Annotation, BNODE, BOOL, DECIMAL, DOUBLE, EachOf, INTEGER, IRI, IRIREF, IriStem, IriStemRange, LANGTAG, Language, LanguageStem, LanguageStemRange, LiteralStem, LiteralStemRange, NodeConstraint, numericLiteral, ObjectLiteral, objectValue, OneOf, Schema, SemAct, Shape, ShapeAnd, ShapeDecl, shapeDeclLabel, shapeDeclRef, shapeExpr, shapeExprOrRef, ShapeExternal, ShapeNot, ShapeOr, STRING, TripleConstraint, tripleExpr, tripleExprLabel, tripleExprOrRef, tripleExprRef, valueSetValue, Wildcard } from "./ShexJTypes";
|
|
2
2
|
import type { ValidateTraverserTypes } from "@ldo/type-traverser";
|
|
3
3
|
export type ShexJTraverserTypes = ValidateTraverserTypes<{
|
|
4
4
|
Schema: {
|
|
@@ -60,7 +60,7 @@ export type ShexJTraverserTypes = ValidateTraverserTypes<{
|
|
|
60
60
|
shapeDeclRef: {
|
|
61
61
|
kind: "union";
|
|
62
62
|
type: shapeDeclRef;
|
|
63
|
-
typeNames: "shapeDeclLabel";
|
|
63
|
+
typeNames: "shapeDeclLabel" | "ShapeDecl";
|
|
64
64
|
};
|
|
65
65
|
shapeDeclLabel: {
|
|
66
66
|
kind: "union";
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
export interface Schema {
|
|
3
|
+
type: "Schema";
|
|
4
|
+
"@context"?: "http://www.w3.org/ns/shex.jsonld" | undefined;
|
|
5
|
+
startActs?: SemAct[] | undefined;
|
|
6
|
+
start?: shapeExprOrRef | undefined;
|
|
7
|
+
imports?: IRIREF[] | undefined;
|
|
8
|
+
shapes?: ShapeDecl[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
export interface semactsAndAnnotations {
|
|
11
|
+
semActs?: SemAct[] | undefined;
|
|
12
|
+
annotations?: Annotation[] | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface ShapeDecl {
|
|
15
|
+
type: "ShapeDecl";
|
|
16
|
+
id: shapeDeclLabel;
|
|
17
|
+
abstract?: BOOL | undefined;
|
|
18
|
+
restricts?: shapeExprOrRef[] | undefined;
|
|
19
|
+
shapeExpr: shapeExpr;
|
|
20
|
+
}
|
|
21
|
+
export type shapeExpr = ShapeOr | ShapeAnd | ShapeNot | NodeConstraint | Shape | ShapeExternal;
|
|
22
|
+
export type shapeExprOrRef = shapeExpr | shapeDeclRef;
|
|
23
|
+
export interface ShapeOr {
|
|
24
|
+
type: "ShapeOr";
|
|
25
|
+
shapeExprs: shapeExprOrRef[];
|
|
26
|
+
}
|
|
27
|
+
export interface ShapeAnd {
|
|
28
|
+
type: "ShapeAnd";
|
|
29
|
+
shapeExprs: shapeExprOrRef[];
|
|
30
|
+
}
|
|
31
|
+
export interface ShapeNot {
|
|
32
|
+
type: "ShapeNot";
|
|
33
|
+
shapeExpr: shapeExprOrRef;
|
|
34
|
+
}
|
|
35
|
+
export interface ShapeExternal {
|
|
36
|
+
type: "ShapeExternal";
|
|
37
|
+
}
|
|
38
|
+
export type shapeDeclRef = shapeDeclLabel | ShapeDecl;
|
|
39
|
+
export type shapeDeclLabel = IRIREF | BNODE;
|
|
40
|
+
export type nodeKind = "iri" | "bnode" | "nonliteral" | "literal";
|
|
41
|
+
export interface NodeConstraint extends xsFacets, semactsAndAnnotations {
|
|
42
|
+
type: "NodeConstraint";
|
|
43
|
+
nodeKind?: nodeKind | undefined;
|
|
44
|
+
datatype?: IRIREF | undefined;
|
|
45
|
+
values?: valueSetValue[] | undefined;
|
|
46
|
+
}
|
|
47
|
+
export interface xsFacets extends stringFacets, numericFacets {
|
|
48
|
+
}
|
|
49
|
+
export interface stringFacets {
|
|
50
|
+
length?: INTEGER | undefined;
|
|
51
|
+
minlength?: INTEGER | undefined;
|
|
52
|
+
maxlength?: INTEGER | undefined;
|
|
53
|
+
pattern?: STRING | undefined;
|
|
54
|
+
flags?: STRING | undefined;
|
|
55
|
+
}
|
|
56
|
+
export interface numericFacets {
|
|
57
|
+
mininclusive?: numericLiteral | undefined;
|
|
58
|
+
minexclusive?: numericLiteral | undefined;
|
|
59
|
+
maxinclusive?: numericLiteral | undefined;
|
|
60
|
+
maxexclusive?: numericLiteral | undefined;
|
|
61
|
+
totaldigits?: INTEGER | undefined;
|
|
62
|
+
fractiondigits?: INTEGER | undefined;
|
|
63
|
+
}
|
|
64
|
+
export type numericLiteral = INTEGER | DECIMAL | DOUBLE;
|
|
65
|
+
export type valueSetValue = objectValue | IriStem | IriStemRange | LiteralStem | LiteralStemRange | Language | LanguageStem | LanguageStemRange;
|
|
66
|
+
export type objectValue = IRIREF | ObjectLiteral;
|
|
67
|
+
export interface ObjectLiteral {
|
|
68
|
+
value: STRING;
|
|
69
|
+
language?: STRING | undefined;
|
|
70
|
+
type?: STRING | undefined;
|
|
71
|
+
}
|
|
72
|
+
export interface IriStem {
|
|
73
|
+
type: "IriStem";
|
|
74
|
+
stem: IRIREF;
|
|
75
|
+
}
|
|
76
|
+
export type iriRangeStem = IRIREF | Wildcard;
|
|
77
|
+
export type iriRangeExclusion = IRIREF | IriStem;
|
|
78
|
+
export interface IriStemRange {
|
|
79
|
+
type: "IriStemRange";
|
|
80
|
+
stem: iriRangeStem;
|
|
81
|
+
exclusions: iriRangeExclusion[];
|
|
82
|
+
}
|
|
83
|
+
export interface LiteralStem {
|
|
84
|
+
type: "LiteralStem";
|
|
85
|
+
stem: STRING;
|
|
86
|
+
}
|
|
87
|
+
export type literalRangeStem = string | Wildcard;
|
|
88
|
+
export type literalRangeExclusion = string | LiteralStem;
|
|
89
|
+
export interface LiteralStemRange {
|
|
90
|
+
type: "LiteralStemRange";
|
|
91
|
+
stem: literalRangeStem;
|
|
92
|
+
exclusions: literalRangeExclusion[];
|
|
93
|
+
}
|
|
94
|
+
export interface Language {
|
|
95
|
+
type: "Language";
|
|
96
|
+
languageTag: LANGTAG;
|
|
97
|
+
}
|
|
98
|
+
export interface LanguageStem {
|
|
99
|
+
type: "LanguageStem";
|
|
100
|
+
stem: LANGTAG;
|
|
101
|
+
}
|
|
102
|
+
export type languageRangeStem = string | Wildcard;
|
|
103
|
+
export type languageRangeExclusion = string | LanguageStem;
|
|
104
|
+
export interface LanguageStemRange {
|
|
105
|
+
type: "LanguageStemRange";
|
|
106
|
+
stem: languageRangeStem;
|
|
107
|
+
exclusions: languageRangeExclusion[];
|
|
108
|
+
}
|
|
109
|
+
export interface Wildcard {
|
|
110
|
+
type: "Wildcard";
|
|
111
|
+
}
|
|
112
|
+
export interface Shape extends semactsAndAnnotations {
|
|
113
|
+
type: "Shape";
|
|
114
|
+
closed?: BOOL | undefined;
|
|
115
|
+
extra?: IRIREF[] | undefined;
|
|
116
|
+
extends?: shapeExprOrRef[];
|
|
117
|
+
expression?: tripleExprOrRef | undefined;
|
|
118
|
+
}
|
|
119
|
+
export type tripleExpr = EachOf | OneOf | TripleConstraint;
|
|
120
|
+
export type tripleExprOrRef = tripleExpr | tripleExprRef;
|
|
121
|
+
export interface tripleExprBase extends semactsAndAnnotations {
|
|
122
|
+
id?: tripleExprLabel | undefined;
|
|
123
|
+
min?: INTEGER | undefined;
|
|
124
|
+
max?: INTEGER | undefined;
|
|
125
|
+
}
|
|
126
|
+
export interface EachOf extends tripleExprBase {
|
|
127
|
+
type: "EachOf";
|
|
128
|
+
expressions: tripleExprOrRef[];
|
|
129
|
+
}
|
|
130
|
+
export interface OneOf extends tripleExprBase {
|
|
131
|
+
type: "OneOf";
|
|
132
|
+
expressions: tripleExprOrRef[];
|
|
133
|
+
}
|
|
134
|
+
export interface TripleConstraint extends tripleExprBase {
|
|
135
|
+
type: "TripleConstraint";
|
|
136
|
+
inverse?: BOOL | undefined;
|
|
137
|
+
predicate: IRIREF;
|
|
138
|
+
valueExpr?: shapeExprOrRef | undefined;
|
|
139
|
+
}
|
|
140
|
+
export type tripleExprRef = tripleExprLabel;
|
|
141
|
+
export type tripleExprLabel = IRIREF | BNODE;
|
|
142
|
+
export interface SemAct {
|
|
143
|
+
type: "SemAct";
|
|
144
|
+
name: IRIREF;
|
|
145
|
+
code?: STRING | undefined;
|
|
146
|
+
}
|
|
147
|
+
export interface Annotation {
|
|
148
|
+
type: "Annotation";
|
|
149
|
+
predicate: IRI;
|
|
150
|
+
object: objectValue;
|
|
151
|
+
}
|
|
152
|
+
export type IRIREF = string;
|
|
153
|
+
export type BNODE = string;
|
|
154
|
+
export type INTEGER = number;
|
|
155
|
+
export type STRING = string;
|
|
156
|
+
export type DECIMAL = number;
|
|
157
|
+
export type DOUBLE = number;
|
|
158
|
+
export type LANGTAG = string;
|
|
159
|
+
export type BOOL = boolean;
|
|
160
|
+
export type IRI = string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShexJTypes.js","sourceRoot":"","sources":["../src/ShexJTypes.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldo/traverser-shexj",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.29",
|
|
4
4
|
"description": "A type-traverser for ShexJ",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"homepage": "https://github.com/o-development/ldobjects/tree/main/packages/traverser-shexj#readme",
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/jest": "^27.0.3",
|
|
24
|
-
"@types/shexj": "^2.1.3",
|
|
25
24
|
"jest": "^27.4.5",
|
|
26
25
|
"ts-jest": "^27.1.2"
|
|
27
26
|
},
|
|
@@ -30,10 +29,10 @@
|
|
|
30
29
|
"src"
|
|
31
30
|
],
|
|
32
31
|
"dependencies": {
|
|
33
|
-
"@ldo/type-traverser": "^0.0.1-alpha.
|
|
32
|
+
"@ldo/type-traverser": "^0.0.1-alpha.29"
|
|
34
33
|
},
|
|
35
34
|
"publishConfig": {
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
38
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "56f78cef2b1b0d668c47d356c5f13517fe714505"
|
|
39
38
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ShexJTraverserTypes } from ".";
|
|
2
|
-
import type {
|
|
3
|
-
import type { shapeExpr, valueSetValue } from "
|
|
2
|
+
import type { TraverserDefinitions } from "@ldo/type-traverser";
|
|
3
|
+
import type { shapeExpr, valueSetValue } from "./ShexJTypes";
|
|
4
4
|
|
|
5
|
-
export const ShexJTraverserDefinition:
|
|
5
|
+
export const ShexJTraverserDefinition: TraverserDefinitions<ShexJTraverserTypes> =
|
|
6
6
|
{
|
|
7
7
|
Schema: {
|
|
8
8
|
kind: "interface",
|
|
@@ -29,7 +29,9 @@ export const ShexJTraverserDefinition: TraverserDefinition<ShexJTraverserTypes>
|
|
|
29
29
|
shapeExprOrRef: {
|
|
30
30
|
kind: "union",
|
|
31
31
|
selector: (item) =>
|
|
32
|
-
typeof item === "string"
|
|
32
|
+
typeof item === "string" || item.type === "ShapeDecl"
|
|
33
|
+
? "shapeDeclRef"
|
|
34
|
+
: "shapeExpr",
|
|
33
35
|
},
|
|
34
36
|
ShapeOr: {
|
|
35
37
|
kind: "interface",
|
|
@@ -55,7 +57,8 @@ export const ShexJTraverserDefinition: TraverserDefinition<ShexJTraverserTypes>
|
|
|
55
57
|
},
|
|
56
58
|
shapeDeclRef: {
|
|
57
59
|
kind: "union",
|
|
58
|
-
selector: () =>
|
|
60
|
+
selector: (value) =>
|
|
61
|
+
typeof value === "string" ? "shapeDeclLabel" : "ShapeDecl",
|
|
59
62
|
},
|
|
60
63
|
shapeDeclLabel: {
|
|
61
64
|
kind: "union",
|
|
@@ -41,7 +41,7 @@ import type {
|
|
|
41
41
|
tripleExprRef,
|
|
42
42
|
valueSetValue,
|
|
43
43
|
Wildcard,
|
|
44
|
-
} from "
|
|
44
|
+
} from "./ShexJTypes";
|
|
45
45
|
import type { ValidateTraverserTypes } from "@ldo/type-traverser";
|
|
46
46
|
|
|
47
47
|
export type ShexJTraverserTypes = ValidateTraverserTypes<{
|
|
@@ -110,7 +110,7 @@ export type ShexJTraverserTypes = ValidateTraverserTypes<{
|
|
|
110
110
|
shapeDeclRef: {
|
|
111
111
|
kind: "union";
|
|
112
112
|
type: shapeDeclRef;
|
|
113
|
-
typeNames: "shapeDeclLabel";
|
|
113
|
+
typeNames: "shapeDeclLabel" | "ShapeDecl";
|
|
114
114
|
};
|
|
115
115
|
shapeDeclLabel: {
|
|
116
116
|
kind: "union";
|
|
@@ -0,0 +1,602 @@
|
|
|
1
|
+
// These type definitions are slightly modified to make up for the fact that the "extends" clause can loop back on itself
|
|
2
|
+
|
|
3
|
+
export {}; // only export specified symbols (strict-export-declare-modifiers)
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Structure for expressing a Shape Expression schema.
|
|
7
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapes-schema">ShEx Schema definition</a>
|
|
8
|
+
*/
|
|
9
|
+
export interface Schema {
|
|
10
|
+
/**
|
|
11
|
+
* Mandatory type "Schema".
|
|
12
|
+
*/
|
|
13
|
+
type: "Schema";
|
|
14
|
+
/**
|
|
15
|
+
* JSON-LD <a href="https://www.w3.org/TR/json-ld11/#the-context">@context</a> for ShEx.
|
|
16
|
+
*/
|
|
17
|
+
"@context"?: "http://www.w3.org/ns/shex.jsonld" | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* List of semantic actions to be executed when evaluating conformance.
|
|
20
|
+
*/
|
|
21
|
+
startActs?: SemAct[] | undefined; // +
|
|
22
|
+
/**
|
|
23
|
+
* Identifies default starting shape expression.
|
|
24
|
+
*/
|
|
25
|
+
start?: shapeExprOrRef | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* List of ShEx schemas to <a href="http://shex.io/shex-semantics/#import">import</a> when processing this schema.
|
|
28
|
+
*/
|
|
29
|
+
imports?: IRIREF[] | undefined; // +
|
|
30
|
+
/**
|
|
31
|
+
* The list of {@link ShapeDecl}s defined in this schema. Each MUST include and {@link ShapeOr#id}.
|
|
32
|
+
*/
|
|
33
|
+
shapes?: ShapeDecl[] | undefined; // +
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface semactsAndAnnotations {
|
|
37
|
+
/**
|
|
38
|
+
* List of semantic actions to be executed when evaluating conformance.
|
|
39
|
+
*/
|
|
40
|
+
semActs?: SemAct[] | undefined; // +;
|
|
41
|
+
/**
|
|
42
|
+
* List of {@link SemAct#predicate}/{@link SemAct#object} annotations.
|
|
43
|
+
*/
|
|
44
|
+
annotations?: Annotation[] | undefined; // +
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A declaration for a shapeExpr with added inheritance constraints.
|
|
49
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapedecl">ShEx ShapeDecl definition</a>
|
|
50
|
+
*/
|
|
51
|
+
export interface ShapeDecl {
|
|
52
|
+
/**
|
|
53
|
+
* Mandatory type "ShapeDecl".
|
|
54
|
+
*/
|
|
55
|
+
type: "ShapeDecl";
|
|
56
|
+
/**
|
|
57
|
+
* The identifier is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
58
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
59
|
+
*/
|
|
60
|
+
id: shapeDeclLabel;
|
|
61
|
+
/**
|
|
62
|
+
* Whether this ShapeDecl participates in <a href="http://shex.io/shex-semantics/#dfn-inheritanceSubstitution">inheritance substitution</a>.
|
|
63
|
+
*/
|
|
64
|
+
abstract?: BOOL | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* The list of {@link shapeExprOrRef}s that a neighborhood MUST conform to in order to conform to this ShapeDecl.
|
|
67
|
+
*/
|
|
68
|
+
restricts?: shapeExprOrRef[] | undefined; // +
|
|
69
|
+
/**
|
|
70
|
+
* The {@link shapeExpr} to which this neighborhood MUST also conform.
|
|
71
|
+
*/
|
|
72
|
+
shapeExpr: shapeExpr;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Union of shape expression types.
|
|
77
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapeexpr">ShEx shapeExpr definition</a>
|
|
78
|
+
*/
|
|
79
|
+
export type shapeExpr =
|
|
80
|
+
| ShapeOr
|
|
81
|
+
| ShapeAnd
|
|
82
|
+
| ShapeNot
|
|
83
|
+
| NodeConstraint
|
|
84
|
+
| Shape
|
|
85
|
+
| ShapeExternal;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Union of shapeExpr and shapeDeclRef.
|
|
89
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapeexpr">ShEx shapeExpr definition</a>
|
|
90
|
+
*/
|
|
91
|
+
export type shapeExprOrRef = shapeExpr | shapeDeclRef;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A non-exclusive choice of shape expressions; considered conformant if any of {@link #shapeExprs} conforms.
|
|
95
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapeor">ShEx shapeExpr definition</a>
|
|
96
|
+
*/
|
|
97
|
+
export interface ShapeOr {
|
|
98
|
+
/**
|
|
99
|
+
* Mandatory type "ShapeOr".
|
|
100
|
+
*/
|
|
101
|
+
type: "ShapeOr";
|
|
102
|
+
/**
|
|
103
|
+
* List of two or more {@link shapeExprOrRef}s in this disjunction.
|
|
104
|
+
*/
|
|
105
|
+
shapeExprs: shapeExprOrRef[]; // {2,}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* A conjunction of shape expressions; considered conformant if each conjunct conforms.
|
|
110
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapeor">ShEx shapeExpr definition</a>
|
|
111
|
+
*/
|
|
112
|
+
export interface ShapeAnd {
|
|
113
|
+
/**
|
|
114
|
+
* Mandatory type "ShapeAnd".
|
|
115
|
+
*/
|
|
116
|
+
type: "ShapeAnd";
|
|
117
|
+
/**
|
|
118
|
+
* List of two or more {@link shapeExprOrRef}s in this conjunction.
|
|
119
|
+
*/
|
|
120
|
+
shapeExprs: shapeExprOrRef[]; // {2,}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* A negated shape expressions; considered conformant if {@link #shapeExpr} is not conformant.
|
|
125
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapenot">ShEx shapeExpr definition</a>
|
|
126
|
+
*/
|
|
127
|
+
export interface ShapeNot {
|
|
128
|
+
/**
|
|
129
|
+
* Mandatory type "ShapeNot".
|
|
130
|
+
*/
|
|
131
|
+
type: "ShapeNot";
|
|
132
|
+
/**
|
|
133
|
+
* The {@link shapeExprOrRef} that must be non-conformant for this shape expression to be conformant.
|
|
134
|
+
*/
|
|
135
|
+
shapeExpr: shapeExprOrRef;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A shape expression not defined in this schema or in any imported schema. The definition of this shape expression is NOT defined by ShEx.
|
|
140
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-shapeexternal">ShEx shapeExpr definition</a>
|
|
141
|
+
*/
|
|
142
|
+
export interface ShapeExternal {
|
|
143
|
+
/**
|
|
144
|
+
* Mandatory type "ShapeExternal".
|
|
145
|
+
*/
|
|
146
|
+
type: "ShapeExternal";
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* A reference a shape expression.
|
|
151
|
+
* The reference is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
152
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
153
|
+
* This is modified to also include the possibility of ShapeDecl
|
|
154
|
+
*/
|
|
155
|
+
export type shapeDeclRef = shapeDeclLabel | ShapeDecl;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* An identifier for a shape expression.
|
|
159
|
+
* The identifier is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
160
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
161
|
+
*/
|
|
162
|
+
export type shapeDeclLabel = IRIREF | BNODE;
|
|
163
|
+
|
|
164
|
+
export type nodeKind = "iri" | "bnode" | "nonliteral" | "literal";
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* A collection of constraints on <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-node">RDF Term</a>s expected for conformance.
|
|
168
|
+
* The identifier is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
169
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
170
|
+
*/
|
|
171
|
+
export interface NodeConstraint extends xsFacets, semactsAndAnnotations {
|
|
172
|
+
/**
|
|
173
|
+
* Mandatory type "NodeConstraint".
|
|
174
|
+
*/
|
|
175
|
+
type: "NodeConstraint";
|
|
176
|
+
/**
|
|
177
|
+
* Type of <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-node">RDF Term</a> expected for a conformant RDF node.
|
|
178
|
+
* @see <a href="http://shex.io/shex-semantics/#nodeKind">ShEx nodeKind definition</a>
|
|
179
|
+
*/
|
|
180
|
+
nodeKind?: nodeKind | undefined;
|
|
181
|
+
/**
|
|
182
|
+
* The <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-datatype-iri">RDF Literal datatype IRITerm</a> expected for a conformant RDF node.
|
|
183
|
+
* @see <a href="http://shex.io/shex-semantics/#datatype">ShEx datatype definition</a>
|
|
184
|
+
*/
|
|
185
|
+
datatype?: IRIREF | undefined;
|
|
186
|
+
/**
|
|
187
|
+
* The set of permissible values.
|
|
188
|
+
* @see <a href="http://shex.io/shex-semantics/#values">ShEx values definition</a>
|
|
189
|
+
*/
|
|
190
|
+
values?: valueSetValue[] | undefined;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The set of XML Schema Facets supported in ShEx; defers to {@link stringFacets} and {@link numericFacets}.
|
|
195
|
+
* @see <a href="http://shex.io/shex-semantics/#xs-string">ShEx String Facet Constraints</a> and <a href="http://shex.io/shex-semantics/#xs-numeric">ShEx Numeric Facet Constraints</a>.
|
|
196
|
+
*/
|
|
197
|
+
export interface xsFacets extends stringFacets, numericFacets {}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The set of <a href="https://www.w3.org/TR/xmlschema-2/#facets">XML Schema Facets</a> applying to <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form">lexical forms of RDF terms</a>.
|
|
201
|
+
* @see <a href="http://shex.io/shex-semantics/#xs-string">ShEx String Facet Constraints</a>.
|
|
202
|
+
*/
|
|
203
|
+
export interface stringFacets {
|
|
204
|
+
/**
|
|
205
|
+
* Expected length of the lexical form of an RDF Term.
|
|
206
|
+
*/
|
|
207
|
+
length?: INTEGER | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* Expected minimum length of the lexical form of an RDF Term.
|
|
210
|
+
*/
|
|
211
|
+
minlength?: INTEGER | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Expected maximum length of the lexical form of an RDF Term.
|
|
214
|
+
*/
|
|
215
|
+
maxlength?: INTEGER | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* Regular expression which the lexical forn of an RDF Term must match.
|
|
218
|
+
*/
|
|
219
|
+
pattern?: STRING | undefined;
|
|
220
|
+
/**
|
|
221
|
+
* Optional flags for the regular expression in {@link pattern}.
|
|
222
|
+
*/
|
|
223
|
+
flags?: STRING | undefined;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The set of <a href="https://www.w3.org/TR/xmlschema-2/#facets">XML Schema Facets</a> applying to <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-value-space">numeric values of RDF terms</a>.
|
|
228
|
+
* @see <a href="http://shex.io/shex-semantics/#xs-numeric">ShEx Numeric Facet Constraints</a>.
|
|
229
|
+
*/
|
|
230
|
+
export interface numericFacets {
|
|
231
|
+
/**
|
|
232
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value <= {@link mininclusive}.
|
|
233
|
+
*/
|
|
234
|
+
mininclusive?: numericLiteral | undefined;
|
|
235
|
+
/**
|
|
236
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value < {@link minexclusive}.
|
|
237
|
+
*/
|
|
238
|
+
minexclusive?: numericLiteral | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value > {@link maxinclusive}.
|
|
241
|
+
*/
|
|
242
|
+
maxinclusive?: numericLiteral | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value >= {@link maxexclusive}.
|
|
245
|
+
*/
|
|
246
|
+
maxexclusive?: numericLiteral | undefined;
|
|
247
|
+
/**
|
|
248
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value whose canonical form has {@link totaldigits} digits.
|
|
249
|
+
* @see <a href="http://shex.io/shex-semantics/#nodeSatisfies-totaldigits">ShEx totalDigits definition</a>
|
|
250
|
+
*/
|
|
251
|
+
totaldigits?: INTEGER | undefined;
|
|
252
|
+
/**
|
|
253
|
+
* Conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> has as a numeric value whose canonical form has {@link fractiondigits} digits.
|
|
254
|
+
* @see <a href="http://shex.io/shex-semantics/#nodeSatisfies-fractiondigits">ShEx fractionDigits definition</a>
|
|
255
|
+
*/
|
|
256
|
+
fractiondigits?: INTEGER | undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Union of numeric types in ShEx used in {@link numericFacets}s.
|
|
261
|
+
*/
|
|
262
|
+
export type numericLiteral = INTEGER | DECIMAL | DOUBLE;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Union of numeric types that may appear in a value set.
|
|
266
|
+
* @see {@link NodeConstraint#values}.
|
|
267
|
+
*/
|
|
268
|
+
export type valueSetValue =
|
|
269
|
+
| objectValue
|
|
270
|
+
| IriStem
|
|
271
|
+
| IriStemRange
|
|
272
|
+
| LiteralStem
|
|
273
|
+
| LiteralStemRange
|
|
274
|
+
| Language
|
|
275
|
+
| LanguageStem
|
|
276
|
+
| LanguageStemRange;
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* JSON-LD representation of a URL or a Literal.
|
|
280
|
+
*/
|
|
281
|
+
export type objectValue = IRIREF | ObjectLiteral;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* A <a href="https://www.w3.org/TR/json-ld11/#value-objects">JSON-LD Value Object</a> used to express an <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a>.
|
|
285
|
+
*/
|
|
286
|
+
export interface ObjectLiteral {
|
|
287
|
+
/**
|
|
288
|
+
* The <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form">lexical form</a> of an RDF Literal.
|
|
289
|
+
*/
|
|
290
|
+
value: STRING;
|
|
291
|
+
/**
|
|
292
|
+
* The <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag">language tag</a> of an RDF Literal.
|
|
293
|
+
*/
|
|
294
|
+
language?: STRING | undefined;
|
|
295
|
+
/**
|
|
296
|
+
* The <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-datatype">datatype</a> of an RDF Literal.
|
|
297
|
+
*/
|
|
298
|
+
type?: STRING | undefined;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Matchs an <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-iri">RDF IRI</a> starting with the character sequence in {@link stem}.
|
|
303
|
+
*/
|
|
304
|
+
export interface IriStem {
|
|
305
|
+
/**
|
|
306
|
+
* Mandatory type "IriStem".
|
|
307
|
+
*/
|
|
308
|
+
type: "IriStem";
|
|
309
|
+
/**
|
|
310
|
+
* substring of IRI to be matched.
|
|
311
|
+
*/
|
|
312
|
+
stem: IRIREF;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export type iriRangeStem = IRIREF | Wildcard;
|
|
316
|
+
export type iriRangeExclusion = IRIREF | IriStem;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Filters a matching <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-iri">RDF IRI</a>s through a list of exclusions.
|
|
320
|
+
* The initial match is made on an IRI stem per {@link IriStem} or a {@link Wildcard} to accept any IRI.
|
|
321
|
+
* The {@link exclusion}s are either specific IRIs or {@link IRIStem}s.
|
|
322
|
+
*/
|
|
323
|
+
export interface IriStemRange {
|
|
324
|
+
/**
|
|
325
|
+
* Mandatory type "IriStemRange".
|
|
326
|
+
*/
|
|
327
|
+
type: "IriStemRange";
|
|
328
|
+
/**
|
|
329
|
+
* substring of IRI to be matched or a {@link Wildcard} matching any IRI.
|
|
330
|
+
*/
|
|
331
|
+
stem: iriRangeStem;
|
|
332
|
+
/**
|
|
333
|
+
* IRIs or {@link IRIStem}s to exclude.
|
|
334
|
+
*/
|
|
335
|
+
exclusions: iriRangeExclusion[]; // +
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Matchs an <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a> starting with the character sequence in {@link stem}.
|
|
340
|
+
*/
|
|
341
|
+
export interface LiteralStem {
|
|
342
|
+
/**
|
|
343
|
+
* Mandatory type "LiteralStem".
|
|
344
|
+
*/
|
|
345
|
+
type: "LiteralStem";
|
|
346
|
+
/**
|
|
347
|
+
* substring of Literal to be matched.
|
|
348
|
+
*/
|
|
349
|
+
stem: STRING;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
export type literalRangeStem = string | Wildcard;
|
|
353
|
+
export type literalRangeExclusion = string | LiteralStem;
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Filters a matching <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-literal">RDF Literal</a>s through a list of exclusions.
|
|
357
|
+
* The initial match is made on an Literal stem per {@link LiteralStem} or a {@link Wildcard} to accept any Literal.
|
|
358
|
+
* The {@link exclusion}s are either specific Literals or {@link LiteralStem}s.
|
|
359
|
+
*/
|
|
360
|
+
export interface LiteralStemRange {
|
|
361
|
+
/**
|
|
362
|
+
* Mandatory type "LiteralStemRange".
|
|
363
|
+
*/
|
|
364
|
+
type: "LiteralStemRange";
|
|
365
|
+
/**
|
|
366
|
+
* substring of Literal to be matched or a {@link Wildcard} matching any Literal.
|
|
367
|
+
*/
|
|
368
|
+
stem: literalRangeStem;
|
|
369
|
+
/**
|
|
370
|
+
* Literals or {@link LiteralStem}s to exclude.
|
|
371
|
+
*/
|
|
372
|
+
exclusions: literalRangeExclusion[]; // +
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* An <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag">RDF Language Tag</a>.
|
|
377
|
+
*/
|
|
378
|
+
export interface Language {
|
|
379
|
+
/**
|
|
380
|
+
* Mandatory type "Language".
|
|
381
|
+
*/
|
|
382
|
+
type: "Language";
|
|
383
|
+
/**
|
|
384
|
+
* The <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-lexical-form">lexical representation</a> of an RDF Language Tag.
|
|
385
|
+
*/
|
|
386
|
+
languageTag: LANGTAG;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Matchs an <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-language-tag">RDF Language Tag</a> starting with the character sequence in {@link stem}.
|
|
391
|
+
*/
|
|
392
|
+
export interface LanguageStem {
|
|
393
|
+
/**
|
|
394
|
+
* Mandatory type "LanguageStem".
|
|
395
|
+
*/
|
|
396
|
+
type: "LanguageStem";
|
|
397
|
+
/**
|
|
398
|
+
* substring of Language Tag to be matched.
|
|
399
|
+
*/
|
|
400
|
+
stem: LANGTAG;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export type languageRangeStem = string | Wildcard;
|
|
404
|
+
export type languageRangeExclusion = string | LanguageStem;
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Filters a matching <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-langugae-tag">RDF Language Tag</a>s through a list of exclusions.
|
|
408
|
+
* The initial match is made on an Language Tag stem per {@link Language TagStem} or a {@link Wildcard} to accept any Language Tag.
|
|
409
|
+
* The {@link exclusion}s are either specific Language Tags or {@link Language TagStem}s.
|
|
410
|
+
*/
|
|
411
|
+
export interface LanguageStemRange {
|
|
412
|
+
/**
|
|
413
|
+
* Mandatory type "LanguageStemRange".
|
|
414
|
+
*/
|
|
415
|
+
type: "LanguageStemRange";
|
|
416
|
+
/**
|
|
417
|
+
* substring of Language-Tag to be matched or a {@link Wildcard} matching any Language Tag.
|
|
418
|
+
*/
|
|
419
|
+
stem: languageRangeStem;
|
|
420
|
+
/**
|
|
421
|
+
* Language Tags or {@link LanguageStem}s to exclude.
|
|
422
|
+
*/
|
|
423
|
+
exclusions: languageRangeExclusion[]; // +
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* An empty object signifying than any item may be matched.
|
|
428
|
+
* This is used in {@link IriStemRange}, {@link LiteralStemRange} and {@link LanguageStemRange}.
|
|
429
|
+
*/
|
|
430
|
+
export interface Wildcard {
|
|
431
|
+
/**
|
|
432
|
+
* Mandatory type "Wildcard".
|
|
433
|
+
*/
|
|
434
|
+
type: "Wildcard";
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* A collection of {@link tripleExpr}s which must be matched by <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-triple">RDF Triple</a>s in conformance data.
|
|
439
|
+
*/
|
|
440
|
+
export interface Shape extends semactsAndAnnotations {
|
|
441
|
+
/**
|
|
442
|
+
* Mandatory type "Shape".
|
|
443
|
+
*/
|
|
444
|
+
type: "Shape";
|
|
445
|
+
/**
|
|
446
|
+
* Only the predicates mentioned in the {@link expression} may appear in conformant data.
|
|
447
|
+
*/
|
|
448
|
+
closed?: BOOL | undefined;
|
|
449
|
+
/**
|
|
450
|
+
* Permit extra triples with these predicates to appear in triples which don't match any {@link TripleConstraint}s mentioned in the {@link expression}.
|
|
451
|
+
*/
|
|
452
|
+
extra?: IRIREF[] | undefined;
|
|
453
|
+
/**
|
|
454
|
+
* List of one or more {@link shapeExprOrRef}s that a neighborhood must satisfy in order to conform to this shape.
|
|
455
|
+
*/
|
|
456
|
+
extends?: shapeExprOrRef[];
|
|
457
|
+
/**
|
|
458
|
+
* A tree of {@link tripleExpr}s specifying a set triples into or out of conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-node">RDF Nodes</a>.
|
|
459
|
+
*/
|
|
460
|
+
expression?: tripleExprOrRef | undefined;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Union of triple expression types.
|
|
465
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-tripleexpr">ShEx tripleExpr definition</a>
|
|
466
|
+
*/
|
|
467
|
+
export type tripleExpr = EachOf | OneOf | TripleConstraint;
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* A tripleExpr or a label to one.
|
|
471
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-tripleexpr">ShEx tripleExpr definition</a>
|
|
472
|
+
*/
|
|
473
|
+
export type tripleExprOrRef = tripleExpr | tripleExprRef;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Common attributes appearing in every form of {@link tripleExpr}.
|
|
477
|
+
*/
|
|
478
|
+
export interface tripleExprBase extends semactsAndAnnotations {
|
|
479
|
+
/**
|
|
480
|
+
* Optional identifier for {@link tripleExpr}s for reference by {@link tripleExprRef}.
|
|
481
|
+
* The identifier is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
482
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
483
|
+
*/
|
|
484
|
+
id?: tripleExprLabel | undefined;
|
|
485
|
+
/**
|
|
486
|
+
* Minimum number of times matching triples must appear in conformant data.
|
|
487
|
+
*/
|
|
488
|
+
min?: INTEGER | undefined;
|
|
489
|
+
/**
|
|
490
|
+
* Maximum number of times matching triples must appear in conformant data.
|
|
491
|
+
*/
|
|
492
|
+
max?: INTEGER | undefined;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* A list of of triple expressions; considered conformant if there is some conforming mapping of the examined triples to the {@link #tripleExprs}.
|
|
497
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-eachof">ShEx EachOf definition</a>
|
|
498
|
+
*/
|
|
499
|
+
export interface EachOf extends tripleExprBase {
|
|
500
|
+
/**
|
|
501
|
+
* Mandatory type "EachOf".
|
|
502
|
+
*/
|
|
503
|
+
type: "EachOf";
|
|
504
|
+
expressions: tripleExprOrRef[]; // {2,}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* An exclusive choice of triple expressions; considered conformant if exactly one of {@link #shapeExprs} conforms.
|
|
509
|
+
* @see <a href="http://shex.io/shex-semantics/#dfn-oneof">ShEx OneOf definition</a>
|
|
510
|
+
*/
|
|
511
|
+
export interface OneOf extends tripleExprBase {
|
|
512
|
+
/**
|
|
513
|
+
* Mandatory type "OneOf".
|
|
514
|
+
*/
|
|
515
|
+
type: "OneOf";
|
|
516
|
+
expressions: tripleExprOrRef[]; // {2,}
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* A template matching a number of triples attached to the node being validated.
|
|
521
|
+
*/
|
|
522
|
+
export interface TripleConstraint extends tripleExprBase {
|
|
523
|
+
/**
|
|
524
|
+
* Mandatory type "TripleConstraint".
|
|
525
|
+
*/
|
|
526
|
+
type: "TripleConstraint";
|
|
527
|
+
/**
|
|
528
|
+
* If false, the TripleConstraint matches the a triple composed of a focus node, the {@link predicate} and an object matching the (optional) {@link shapeExpr}.
|
|
529
|
+
* If true, the TripleConstraint matches the a triple composed of a subject matching the (optional) {@link shapeExpr}, the {@link predicate} and focus node.
|
|
530
|
+
*/
|
|
531
|
+
inverse?: BOOL | undefined;
|
|
532
|
+
/**
|
|
533
|
+
* The predicate expected in a matching <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-triple">RDF Triple</a>.
|
|
534
|
+
*/
|
|
535
|
+
predicate: IRIREF;
|
|
536
|
+
/**
|
|
537
|
+
* A {@link shapeExpr} matching a conformant <a href="https://www.w3.org/TR/rdf11-concepts/#dfn-triple">RDF Triple</a>s subject or object, depending on the value of {@link inverse}.
|
|
538
|
+
*/
|
|
539
|
+
valueExpr?: shapeExprOrRef | undefined;
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* A reference a triple expression.
|
|
544
|
+
* The reference is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
545
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
546
|
+
*/
|
|
547
|
+
export type tripleExprRef = tripleExprLabel;
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* An identifier for a triple expression.
|
|
551
|
+
* The identifier is an <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">IRI</a> or a <a href="https://www.w3.org/TR/json-ld11/#identifying-blank-nodes">BlankNode</a>
|
|
552
|
+
* as expressed in <a href="https://www.w3.org/TR/json-ld11/">JSON-LD 1.1</a>.
|
|
553
|
+
*/
|
|
554
|
+
export type tripleExprLabel = IRIREF | BNODE;
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* An extension point for Shape Expressions allowing external code to be invoked during validation.
|
|
558
|
+
*/
|
|
559
|
+
export interface SemAct {
|
|
560
|
+
/**
|
|
561
|
+
* Mandatory type "SemAct".
|
|
562
|
+
*/
|
|
563
|
+
type: "SemAct";
|
|
564
|
+
/*
|
|
565
|
+
* Identifier of the language for this semantic action.
|
|
566
|
+
*/
|
|
567
|
+
name: IRIREF;
|
|
568
|
+
/*
|
|
569
|
+
* The actual code to be interpreted/executed.
|
|
570
|
+
* This may be kept separate from the ShEx containing the schema by including only {@link name}s in the schema.
|
|
571
|
+
*/
|
|
572
|
+
code?: STRING | undefined;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* An assertion about some part of a ShEx schema which has no affect on conformance checking.
|
|
577
|
+
* These can be useful for documentation, provenance tracking, form generation, etch.
|
|
578
|
+
*/
|
|
579
|
+
export interface Annotation {
|
|
580
|
+
/**
|
|
581
|
+
* Mandatory type "Annotation".
|
|
582
|
+
*/
|
|
583
|
+
type: "Annotation";
|
|
584
|
+
/**
|
|
585
|
+
* The <a href="https://www.w3.org/TR/json-ld11/#node-identifiers">RDF Predicate</a> of the annotation.
|
|
586
|
+
*/
|
|
587
|
+
predicate: IRI;
|
|
588
|
+
/**
|
|
589
|
+
* A value for the above {@link predicate}.
|
|
590
|
+
*/
|
|
591
|
+
object: objectValue;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
export type IRIREF = string;
|
|
595
|
+
export type BNODE = string;
|
|
596
|
+
export type INTEGER = number;
|
|
597
|
+
export type STRING = string;
|
|
598
|
+
export type DECIMAL = number;
|
|
599
|
+
export type DOUBLE = number;
|
|
600
|
+
export type LANGTAG = string;
|
|
601
|
+
export type BOOL = boolean;
|
|
602
|
+
export type IRI = string;
|