Skip to content

Commit 9c4f352

Browse files
committed
use list contraints in SHACL SHACL shape
1 parent 5150572 commit 9c4f352

File tree

1 file changed

+26
-37
lines changed

1 file changed

+26
-37
lines changed

shacl12-vocabularies/shacl-shacl.ttl

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ shsh:ShapeShape
7474
sh:ignoredProperties, sh:in, sh:languageIn, sh:lessThan, sh:lessThanOrEquals, sh:maxCount, sh:maxExclusive,
7575
sh:maxInclusive, sh:maxLength, sh:memberShape, sh:minCount, sh:minExclusive, sh:minInclusive, sh:minLength, sh:node, sh:nodeKind,
7676
sh:not, sh:or, sh:pattern, sh:property, sh:qualifiedMaxCount, sh:qualifiedMinCount, sh:qualifiedValueShape,
77-
sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone ,
77+
sh:qualifiedValueShape, sh:qualifiedValueShapesDisjoint, sh:qualifiedValueShapesDisjoint, sh:uniqueLang, sh:xone,
7878
sh:minListLength, sh:maxListLength, sh:uniqueMembers ;
7979

8080
sh:targetObjectsOf sh:memberShape ; # memberShape-node
@@ -123,14 +123,16 @@ shsh:ShapeShape
123123
sh:maxCount 1 ; # deactivated-maxCount
124124
sh:datatype xsd:boolean ; # deactivated-datatype
125125
] ;
126-
127126
sh:property [
128127
sh:path sh:and ;
129-
sh:node shsh:ListShape ; # and-node
128+
sh:memberShape shsh:ShapeShape ; # and-memberShape
130129
] ;
131130
sh:property [
132131
sh:path sh:class ;
133-
sh:nodeKind sh:IRI ; # class-nodeKind
132+
sh:or (
133+
[ sh:nodeKind sh:IRI ]
134+
[ sh:memberShape [ sh:nodeKind sh:IRI ] ]
135+
) ; # class-nodeKind
134136
] ;
135137
sh:property [
136138
sh:path sh:closed ;
@@ -139,16 +141,16 @@ shsh:ShapeShape
139141
] ;
140142
sh:property [
141143
sh:path sh:ignoredProperties ;
142-
sh:node shsh:ListShape ; # ignoredProperties-node
143-
sh:maxCount 1 ; # multiple-parameters
144-
] ;
145-
sh:property [
146-
sh:path ( sh:ignoredProperties [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
147-
sh:nodeKind sh:IRI ; # ignoredProperties-members-nodeKind
144+
sh:memberShape [ sh:nodeKind sh:IRI ] ; # languageIn-members-datatype
145+
sh:minListLength 1 ; # languageIn-members-datatype
146+
sh:maxCount 1 ; # multiple-parameters
148147
] ;
149148
sh:property [
150149
sh:path sh:datatype ;
151-
sh:nodeKind sh:IRI ; # datatype-nodeKind
150+
sh:or (
151+
[ sh:nodeKind sh:IRI ]
152+
[ sh:memberShape [ sh:nodeKind sh:IRI ] ]
153+
) ; # datatype-nodeKind
152154
sh:maxCount 1 ; # datatype-maxCount
153155
] ;
154156
sh:property [
@@ -161,17 +163,14 @@ shsh:ShapeShape
161163
] ;
162164
sh:property [
163165
sh:path sh:in ;
164-
sh:maxCount 1 ; # in-maxCount
165-
sh:node shsh:ListShape ; # in-node
166+
sh:maxCount 1 ; # in-maxCount
167+
sh:minListLength 1 ; # in-minListLength
166168
] ;
167169
sh:property [
168170
sh:path sh:languageIn ;
169-
sh:maxCount 1 ; # languageIn-maxCount
170-
sh:node shsh:ListShape ; # languageIn-node
171-
] ;
172-
sh:property [
173-
sh:path ( sh:languageIn [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
174-
sh:datatype xsd:string ; # languageIn-members-datatype
171+
sh:maxCount 1 ; # languageIn-maxCount
172+
sh:minListLength 1 ; # languageIn-minListLength
173+
sh:memberShape [ sh:datatype xsd:string ] ; # languageIn-members-datatype
175174
] ;
176175
sh:property [
177176
sh:path sh:lessThan ;
@@ -185,7 +184,7 @@ shsh:ShapeShape
185184
sh:path sh:maxCount ;
186185
sh:datatype xsd:integer ; # maxCount-datatype
187186
sh:maxCount 1 ; # maxCount-maxCount
188-
sh:minInclusive 0 ; # maxCount-minInclusive
187+
sh:minInclusive 0 ; # maxCount-minInclusive
189188
] ;
190189
sh:property [
191190
sh:path sh:maxExclusive ;
@@ -253,7 +252,7 @@ shsh:ShapeShape
253252
] ;
254253
sh:property [
255254
sh:path sh:or ;
256-
sh:node shsh:ListShape ; # or-node
255+
sh:memberShape shsh:ShapeShape ; # or-memberShape
257256
] ;
258257
sh:property [
259258
sh:path sh:pattern ;
@@ -295,7 +294,7 @@ shsh:ShapeShape
295294
] ;
296295
sh:property [
297296
sh:path sh:xone ;
298-
sh:node shsh:ListShape ; # xone-node
297+
sh:memberShape shsh:ShapeShape ; # xone-memberShape
299298
] .
300299

301300
shsh:NodeShapeShape
@@ -346,11 +345,7 @@ shsh:ShapesListShape
346345
sh:targetObjectsOf sh:and ; # and-members-node
347346
sh:targetObjectsOf sh:or ; # or-members-node
348347
sh:targetObjectsOf sh:xone ; # xone-members-node
349-
sh:property [
350-
sh:path ( [ sh:zeroOrMorePath rdf:rest ] rdf:first ) ;
351-
sh:node shsh:ShapeShape ;
352-
] .
353-
348+
sh:memberShape shsh:ShapeShape .
354349

355350
# A path of blank node path syntax, used to simulate recursion
356351
_:PathPath
@@ -377,13 +372,15 @@ shsh:PathNodeShape
377372
sh:xone ( # path-metarule
378373
[ sh:nodeKind sh:IRI ] # 2.3.1.1: Predicate path
379374
[ sh:nodeKind sh:BlankNode ; # 2.3.1.2: Sequence path
380-
sh:node shsh:PathListWithAtLeast2Members ;
375+
sh:memberShape shsh:PathShape ; # sequence-memberShape
376+
sh:minListLength 2 ; # sequence-minListLength
381377
]
382378
[ sh:nodeKind sh:BlankNode ; # 2.3.1.3: Alternative path
383379
sh:closed true ;
384380
sh:property [
385381
sh:path sh:alternativePath ;
386-
sh:node shsh:PathListWithAtLeast2Members ;
382+
sh:memberShape shsh:PathShape ; # alternativePath-memberShape
383+
sh:minListLength 2 ; # alternativePath-minListLength
387384
sh:minCount 1 ;
388385
sh:maxCount 1 ;
389386
]
@@ -422,14 +419,6 @@ shsh:PathNodeShape
422419
]
423420
) .
424421

425-
shsh:PathListWithAtLeast2Members
426-
a sh:NodeShape ;
427-
sh:node shsh:ListShape ;
428-
sh:property [
429-
sh:path [ sh:oneOrMorePath rdf:rest ] ;
430-
sh:minCount 2 ; # 1 other list node plus rdf:nil
431-
] .
432-
433422
shsh:ShapesGraphShape
434423
a sh:NodeShape ;
435424
sh:targetObjectsOf sh:shapesGraph ;

0 commit comments

Comments
 (0)