@shaclmate/validator 4.0.60 → 4.0.62

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.
@@ -0,0 +1,405 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix sh: <http://www.w3.org/ns/shacl#> .
4
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5
+
6
+ @prefix shsh: <http://www.w3.org/ns/shacl-shacl#> .
7
+
8
+ shsh:
9
+ rdfs:label "SHACL for SHACL"@en ;
10
+ rdfs:comment "This shapes graph can be used to validate SHACL shapes graphs against a subset of the SHACL syntax rules."@en ;
11
+ sh:declare [
12
+ sh:prefix "shsh" ;
13
+ sh:namespace "http://www.w3.org/ns/shacl-shacl#" ;
14
+ ] .
15
+
16
+
17
+ shsh:ListShape
18
+ a sh:NodeShape ;
19
+ rdfs:label "List shape"@en ;
20
+ rdfs:comment "A shape describing well-formed RDF lists. Currently does not check for non-recursion. This could be expressed using SHACL-SPARQL."@en ;
21
+ rdfs:seeAlso <https://www.w3.org/TR/shacl/#syntax-rule-SHACL-list> ;
22
+ sh:property [
23
+ sh:path [ sh:zeroOrMorePath rdf:rest ] ;
24
+ rdfs:comment "Each list member (including this node) must be have the shape shsh:ListNodeShape."@en ;
25
+ sh:hasValue rdf:nil ;
26
+ sh:node shsh:ListNodeShape ;
27
+ ] .
28
+
29
+ shsh:ListNodeShape
30
+ a sh:NodeShape ;
31
+ rdfs:label "List node shape"@en ;
32
+ rdfs:comment "Defines constraints on what it means for a node to be a node within a well-formed RDF list. Note that this does not check whether the rdf:rest items are also well-formed lists as this would lead to unsupported recursion."@en ;
33
+ sh:or ( [
34
+ sh:hasValue rdf:nil ;
35
+ sh:property [
36
+ sh:path rdf:first ;
37
+ sh:maxCount 0 ;
38
+ ] ;
39
+ sh:property [
40
+ sh:path rdf:rest ;
41
+ sh:maxCount 0 ;
42
+ ] ;
43
+ ]
44
+ [
45
+ sh:not [ sh:hasValue rdf:nil ] ;
46
+ sh:property [
47
+ sh:path rdf:first ;
48
+ sh:maxCount 1 ;
49
+ sh:minCount 1 ;
50
+ ] ;
51
+ sh:property [
52
+ sh:path rdf:rest ;
53
+ sh:maxCount 1 ;
54
+ sh:minCount 1 ;
55
+ ] ;
56
+ ] ) .
57
+
58
+ shsh:ShapeShape
59
+ a sh:NodeShape ;
60
+ rdfs:label "Shape shape"@en ;
61
+ rdfs:comment "A shape that can be used to validate syntax rules for other shapes."@en ;
62
+
63
+ # See https://www.w3.org/TR/shacl/#shapes for what counts as a shape
64
+ sh:targetClass sh:NodeShape ;
65
+ sh:targetClass sh:PropertyShape ;
66
+ sh:targetSubjectsOf sh:targetClass, sh:targetNode, sh:targetObjectsOf, sh:targetSubjectsOf ;
67
+ sh:targetSubjectsOf sh:and, sh:class, sh:closed, sh:datatype, sh:disjoint, sh:equals, sh:flags, sh:hasValue,
68
+ sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive,
69
+ sh:maxInclusive, sh:maxLength, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind,
70
+ sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape,
71
+ sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ;
72
+
73
+ sh:targetObjectsOf sh:node ; # node-node
74
+ sh:targetObjectsOf sh:not ; # not-node
75
+ sh:targetObjectsOf sh:property ; # property-node
76
+ sh:targetObjectsOf sh:qualifiedValueShape ; # qualifiedValueShape-node
77
+
78
+ # Shapes are either node shapes or property shapes
79
+ sh:xone ( shsh:NodeShapeShape shsh:PropertyShapeShape ) ;
80
+
81
+ sh:property [
82
+ sh:path sh:targetNode ;
83
+ sh:nodeKind sh:IRIOrLiteral ; # targetNode-nodeKind
84
+ ] ;
85
+ sh:property [
86
+ sh:path sh:targetClass ;
87
+ sh:nodeKind sh:IRI ; # targetClass-nodeKind
88
+ ] ;
89
+ sh:property [
90
+ sh:path sh:targetSubjectsOf ;
91
+ sh:nodeKind sh:IRI ; # targetSubjectsOf-nodeKind
92
+ ] ;
93
+ sh:property [
94
+ sh:path sh:targetObjectsOf ;
95
+ sh:nodeKind sh:IRI ; # targetObjectsOf-nodeKind
96
+ ] ;
97
+ sh:or ( [ sh:not [
98
+ sh:class rdfs:Class ;
99
+ sh:or ( [ sh:class sh:NodeShape ] [ sh:class sh:PropertyShape ] )
100
+ ] ]
101
+ [ sh:nodeKind sh:IRI ]
102
+ ) ; # implicit-targetClass-nodeKind
103
+
104
+ sh:property [
105
+ sh:path sh:severity ;
106
+ sh:maxCount 1 ; # severity-maxCount
107
+ sh:nodeKind sh:IRI ; # severity-nodeKind
108
+ ] ;
109
+ sh:property [
110
+ sh:path sh:message ;
111
+ sh:or ( [ sh:datatype xsd:string ] [ sh:datatype rdf:langString ] ) ; # message-datatype
112
+ ] ;
113
+ sh:property [
114
+ sh:path sh:deactivated ;
115
+ sh:maxCount 1 ; # deactivated-maxCount
116
+ sh:in ( true false ) ; # deactivated-datatype
117
+ ] ;
118
+
119
+ sh:property [
120
+ sh:path sh:and ;
121
+ sh:node shsh:ListShape ; # and-node
122
+ ] ;
123
+ sh:property [
124
+ sh:path sh:class ;
125
+ sh:nodeKind sh:IRI ; # class-nodeKind
126
+ ] ;
127
+ sh:property [
128
+ sh:path sh:closed ;
129
+ sh:datatype xsd:boolean ; # closed-datatype
130
+ sh:maxCount 1 ; # multiple-parameters
131
+ ] ;
132
+ sh:property [
133
+ sh:path sh:ignoredProperties ;
134
+ sh:node shsh:ListShape ; # ignoredProperties-node
135
+ sh:maxCount 1 ; # multiple-parameters
136
+ ] ;
137
+ sh:property [
138
+ sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
139
+ sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind
140
+ ] ;
141
+ sh:property [
142
+ sh:path sh:datatype ;
143
+ sh:nodeKind sh:IRI ; # datatype-nodeKind
144
+ sh:maxCount 1 ; # datatype-maxCount
145
+ ] ;
146
+ sh:property [
147
+ sh:path sh:disjoint ;
148
+ sh:nodeKind sh:IRI ; # disjoint-nodeKind
149
+ ] ;
150
+ sh:property [
151
+ sh:path sh:equals ;
152
+ sh:nodeKind sh:IRI ; # equals-nodeKind
153
+ ] ;
154
+ sh:property [
155
+ sh:path sh:in ;
156
+ sh:maxCount 1 ; # in-maxCount
157
+ sh:node shsh:ListShape ; # in-node
158
+ ] ;
159
+ sh:property [
160
+ sh:path sh:languageIn ;
161
+ sh:maxCount 1 ; # languageIn-maxCount
162
+ sh:node shsh:ListShape ; # languageIn-node
163
+ ] ;
164
+ sh:property [
165
+ sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
166
+ sh:datatype xsd:string ; # languageIn-members-datatype
167
+ ] ;
168
+ sh:property [
169
+ sh:path sh:lessThan ;
170
+ sh:nodeKind sh:IRI ; # lessThan-nodeKind
171
+ ] ;
172
+ sh:property [
173
+ sh:path sh:lessThanOrEquals ;
174
+ sh:nodeKind sh:IRI ; # lessThanOrEquals-nodeKind
175
+ ] ;
176
+ sh:property [
177
+ sh:path sh:maxCount ;
178
+ sh:datatype xsd:integer ; # maxCount-datatype
179
+ sh:maxCount 1 ; # maxCount-maxCount
180
+ ] ;
181
+ sh:property [
182
+ sh:path sh:maxExclusive ;
183
+ sh:maxCount 1 ; # maxExclusive-maxCount
184
+ sh:nodeKind sh:Literal ; # maxExclusive-nodeKind
185
+ ] ;
186
+ sh:property [
187
+ sh:path sh:maxInclusive ;
188
+ sh:maxCount 1 ; # maxInclusive-maxCount
189
+ sh:nodeKind sh:Literal ; # maxInclusive-nodeKind
190
+ ] ;
191
+ sh:property [
192
+ sh:path sh:maxLength ;
193
+ sh:datatype xsd:integer ; # maxLength-datatype
194
+ sh:maxCount 1 ; # maxLength-maxCount
195
+ ] ;
196
+ sh:property [
197
+ sh:path sh:minCount ;
198
+ sh:datatype xsd:integer ; # minCount-datatype
199
+ sh:maxCount 1 ; # minCount-maxCount
200
+ ] ;
201
+ sh:property [
202
+ sh:path sh:minExclusive ;
203
+ sh:maxCount 1 ; # minExclusive-maxCount
204
+ sh:nodeKind sh:Literal ; # minExclusive-nodeKind
205
+ ] ;
206
+ sh:property [
207
+ sh:path sh:minInclusive ;
208
+ sh:maxCount 1 ; # minInclusive-maxCount
209
+ sh:nodeKind sh:Literal ; # minInclusive-nodeKind
210
+ ] ;
211
+ sh:property [
212
+ sh:path sh:minLength ;
213
+ sh:datatype xsd:integer ; # minLength-datatype
214
+ sh:maxCount 1 ; # minLength-maxCount
215
+ ] ;
216
+ sh:property [
217
+ sh:path sh:nodeKind ;
218
+ sh:in ( sh:BlankNode sh:IRI sh:Literal sh:BlankNodeOrIRI sh:BlankNodeOrLiteral sh:IRIOrLiteral ) ; # nodeKind-in
219
+ sh:maxCount 1 ; # nodeKind-maxCount
220
+ ] ;
221
+ sh:property [
222
+ sh:path sh:or ;
223
+ sh:node shsh:ListShape ; # or-node
224
+ ] ;
225
+ sh:property [
226
+ sh:path sh:pattern ;
227
+ sh:datatype xsd:string ; # pattern-datatype
228
+ sh:maxCount 1 ; # multiple-parameters
229
+ # Not implemented: syntax rule pattern-regex
230
+ ] ;
231
+ sh:property [
232
+ sh:path sh:flags ;
233
+ sh:datatype xsd:string ; # flags-datatype
234
+ sh:maxCount 1 ; # multiple-parameters
235
+ ] ;
236
+ sh:property [
237
+ sh:path sh:qualifiedMaxCount ;
238
+ sh:datatype xsd:integer ; # qualifiedMaxCount-datatype
239
+ sh:maxCount 1 ; # multiple-parameters
240
+ ] ;
241
+ sh:property [
242
+ sh:path sh:qualifiedMinCount ;
243
+ sh:datatype xsd:integer ; # qualifiedMinCount-datatype
244
+ sh:maxCount 1 ; # multiple-parameters
245
+ ] ;
246
+ sh:property [
247
+ sh:path sh:qualifiedValueShape ;
248
+ sh:maxCount 1 ; # multiple-parameters
249
+ ] ;
250
+ sh:property [
251
+ sh:path sh:qualifiedValueShapesDisjoint ;
252
+ sh:datatype xsd:boolean ; # qualifiedValueShapesDisjoint-datatype
253
+ sh:maxCount 1 ; # multiple-parameters
254
+ ] ;
255
+ sh:property [
256
+ sh:path sh:uniqueLang ;
257
+ sh:datatype xsd:boolean ; # uniqueLang-datatype
258
+ sh:maxCount 1 ; # uniqueLang-maxCount
259
+ ] ;
260
+ sh:property [
261
+ sh:path sh:xone ;
262
+ sh:node shsh:ListShape ; # xone-node
263
+ ] .
264
+
265
+ shsh:NodeShapeShape
266
+ a sh:NodeShape ;
267
+ sh:targetObjectsOf sh:node ; # node-node
268
+ sh:property [
269
+ sh:path sh:path ;
270
+ sh:maxCount 0 ; # NodeShape-path-maxCount
271
+ ] ;
272
+ sh:property [
273
+ sh:path sh:lessThan ;
274
+ sh:maxCount 0 ; # lessThan-scope
275
+ ] ;
276
+ sh:property [
277
+ sh:path sh:lessThanOrEquals ;
278
+ sh:maxCount 0 ; # lessThanOrEquals-scope
279
+ ] ;
280
+ sh:property [
281
+ sh:path sh:maxCount ;
282
+ sh:maxCount 0 ; # maxCount-scope
283
+ ] ;
284
+ sh:property [
285
+ sh:path sh:minCount ;
286
+ sh:maxCount 0 ; # minCount-scope
287
+ ] ;
288
+ sh:property [
289
+ sh:path sh:qualifiedValueShape ;
290
+ sh:maxCount 0 ; # qualifiedValueShape-scope
291
+ ] ;
292
+ sh:property [
293
+ sh:path sh:uniqueLang ;
294
+ sh:maxCount 0 ; # uniqueLang-scope
295
+ ] .
296
+
297
+ shsh:PropertyShapeShape
298
+ a sh:NodeShape ;
299
+ sh:targetObjectsOf sh:property ; # property-node
300
+ sh:property [
301
+ sh:path sh:path ;
302
+ sh:maxCount 1 ; # path-maxCount
303
+ sh:minCount 1 ; # PropertyShape-path-minCount
304
+ sh:node shsh:PathShape ; # path-node
305
+ ] .
306
+
307
+ # Values of sh:and, sh:or and sh:xone must be lists of shapes
308
+ shsh:ShapesListShape
309
+ a sh:NodeShape ;
310
+ sh:targetObjectsOf sh:and ; # and-members-node
311
+ sh:targetObjectsOf sh:or ; # or-members-node
312
+ sh:targetObjectsOf sh:xone ; # xone-members-node
313
+ sh:property [
314
+ sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
315
+ sh:node shsh:ShapeShape ;
316
+ ] .
317
+
318
+
319
+ # A path of blank node path syntax, used to simulate recursion
320
+ _:PathPath
321
+ sh:alternativePath (
322
+ ( [ sh:zeroOrMorePath rdf:rest ] rdf:first )
323
+ ( sh:alternativePath [ sh:zeroOrMorePath rdf:rest ] rdf:first )
324
+ sh:inversePath
325
+ sh:zeroOrMorePath
326
+ sh:oneOrMorePath
327
+ sh:zeroOrOnePath
328
+ ) .
329
+
330
+ shsh:PathShape
331
+ a sh:NodeShape ;
332
+ rdfs:label "Path shape"@en ;
333
+ rdfs:comment "A shape that can be used to validate the syntax rules of well-formed SHACL paths."@en ;
334
+ rdfs:seeAlso <https://www.w3.org/TR/shacl/#property-paths> ;
335
+ sh:property [
336
+ sh:path [ sh:zeroOrMorePath _:PathPath ] ;
337
+ sh:node shsh:PathNodeShape ;
338
+ ] .
339
+
340
+ shsh:PathNodeShape
341
+ sh:xone ( # path-metarule
342
+ [ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path
343
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path
344
+ sh:node shsh:PathListWithAtLeast2Members ;
345
+ ]
346
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path
347
+ sh:closed true ;
348
+ sh:property [
349
+ sh:path sh:alternativePath ;
350
+ sh:node shsh:PathListWithAtLeast2Members ;
351
+ sh:minCount 1 ;
352
+ sh:maxCount 1 ;
353
+ ]
354
+ ]
355
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.4: Inverse path
356
+ sh:closed true ;
357
+ sh:property [
358
+ sh:path sh:inversePath ;
359
+ sh:minCount 1 ;
360
+ sh:maxCount 1 ;
361
+ ]
362
+ ]
363
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.5: Zero-or-more path
364
+ sh:closed true ;
365
+ sh:property [
366
+ sh:path sh:zeroOrMorePath ;
367
+ sh:minCount 1 ;
368
+ sh:maxCount 1 ;
369
+ ]
370
+ ]
371
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.6: One-or-more path
372
+ sh:closed true ;
373
+ sh:property [
374
+ sh:path sh:oneOrMorePath ;
375
+ sh:minCount 1 ;
376
+ sh:maxCount 1 ;
377
+ ]
378
+ ]
379
+ [ sh:nodeKind sh:BlankNode ; # 2.3.1.7: Zero-or-one path
380
+ sh:closed true ;
381
+ sh:property [
382
+ sh:path sh:zeroOrOnePath ;
383
+ sh:minCount 1 ;
384
+ sh:maxCount 1 ;
385
+ ]
386
+ ]
387
+ ) .
388
+
389
+ shsh:PathListWithAtLeast2Members
390
+ a sh:NodeShape ;
391
+ sh:node shsh:ListShape ;
392
+ sh:property [
393
+ sh:path [ sh:oneOrMorePath rdf:rest ] ;
394
+ sh:minCount 2 ; # 1 other list node plus rdf:nil
395
+ ] .
396
+
397
+ shsh:ShapesGraphShape
398
+ a sh:NodeShape ;
399
+ sh:targetObjectsOf sh:shapesGraph ;
400
+ sh:nodeKind sh:IRI . # shapesGraph-nodeKind
401
+
402
+ shsh:EntailmentShape
403
+ a sh:NodeShape ;
404
+ sh:targetObjectsOf sh:entailment ;
405
+ sh:nodeKind sh:IRI . # entailment-nodeKind
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "dependencies": {
3
- "@shaclmate/shacl-ast": "4.0.60",
3
+ "@shaclmate/shacl-ast": "4.0.62",
4
4
  "@rdfjs/dataset": "~2.0.2",
5
5
  "@rdfjs/prefix-map": "~0.1.2",
6
6
  "@rdfjs/types": "~2.0.1",
@@ -78,5 +78,5 @@
78
78
  },
79
79
  "type": "module",
80
80
  "types": "./dist/index.d.ts",
81
- "version": "4.0.60"
81
+ "version": "4.0.62"
82
82
  }