Skip to content

Commit bb0f363

Browse files
committed
chore: remove blank node targetNodes for lists
1 parent 4395034 commit bb0f363

File tree

4 files changed

+70
-51
lines changed

4 files changed

+70
-51
lines changed

shacl12-test-suite/tests/core/node/maxListLength-001.ttl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ ex:ListShape
1212
rdf:type sh:NodeShape ;
1313
sh:maxListLength 2 ;
1414
# Satisfies all constraints
15-
sh:targetNode ( 1 2 ), rdf:nil ;
15+
sh:targetNode ex:list0, rdf:nil ;
1616
# Violates maxListLength constraint
17-
sh:targetNode _:b1, ex:notAList ;
17+
sh:targetNode ex:list1, ex:notAList ;
1818
.
1919

20-
_:b1
20+
ex:list0
21+
rdf:first 1 ;
22+
rdf:rest ( 2 ) .
23+
24+
ex:list1
2125
rdf:first 1 ;
2226
rdf:rest ( 2 3 ) .
2327

shacl12-test-suite/tests/core/node/memberShape-001.ttl

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,64 @@ ex:IRIShape a sh:NodeShape ;
1414
ex:IRIListShape
1515
rdf:type sh:NodeShape ;
1616
sh:memberShape ex:IRIShape ;
17-
sh:targetNode ( ex:Alice ex:Bob ) ;
17+
sh:targetNode ex:list0 ;
1818
# Valid empty list
19-
sh:targetNode () ;
20-
# _:b1 is valid, the remainder trigger violations (including _:b3 which has no properties in this graph)
21-
sh:targetNode _:b1, _:b2, _:b3, _:b4, _:b5, _:b6, _:b7, _:b9 ;
19+
sh:targetNode rdf:nil ;
20+
# ex:list1 is valid, the remainder trigger violations (including ex:list3 which has no properties in this graph)
21+
sh:targetNode ex:list1, ex:list2, ex:list3, ex:list4, ex:list5, ex:list6, ex:list7, ex:list9 ;
2222
.
2323

24-
_:b1
24+
ex:list0
25+
rdf:first ex:Alice ;
26+
rdf:rest (
27+
ex:Bob
28+
) ;
29+
.
30+
31+
ex:list1
2532
rdf:first ex:Alice ;
2633
rdf:rest rdf:nil ;
2734
ex:extraProperty "extra" ;
2835
.
2936

30-
_:b2
37+
ex:list2
3138
rdf:first ex:Alice ;
3239
rdf:rest (
3340
"Bob"
3441
)
3542
.
3643

37-
_:b4
44+
ex:list4
3845
rdf:first ex:Alice ;
3946
.
4047

41-
_:b5
48+
ex:list5
4249
rdf:first "Charlie" ;
4350
rdf:rest (
4451
"Donna"
4552
)
4653
.
4754

48-
_:b6
55+
ex:list6
4956
rdf:first "Charlie" ;
5057
.
5158

52-
_:b8 rdfs:label "Malformed SHACL List" .
59+
ex:list8 rdfs:label "Malformed SHACL List" .
5360

54-
_:b7
61+
ex:list7
5562
rdf:first "Charlie" ;
56-
rdf:rest _:b8 ;
63+
rdf:rest ex:list8 ;
5764
.
5865

59-
# using _:b9 and _:b10 to test recursive list error
60-
_:b9
66+
# using ex:list9 and ex:list10 to test recursive list error
67+
ex:list9
6168
rdf:first ex:Alice ;
62-
rdf:rest _:b10 ;
69+
rdf:rest ex:list10 ;
6370
.
6471

65-
_:b10
72+
ex:list10
6673
rdf:first "Bob" ;
67-
rdf:rest _:b9 .
74+
rdf:rest ex:list9 .
6875

6976
<>
7077
rdf:type mf:Manifest ;
@@ -85,7 +92,7 @@ _:b10
8592
sh:conforms "false"^^xsd:boolean ;
8693
sh:result [
8794
rdf:type sh:ValidationResult ;
88-
sh:focusNode _:b2 ;
95+
sh:focusNode ex:list2 ;
8996
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
9097
sh:resultSeverity sh:Violation ;
9198
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
@@ -102,43 +109,43 @@ _:b10
102109
] ;
103110
sh:result [
104111
rdf:type sh:ValidationResult ;
105-
sh:focusNode _:b3 ;
112+
sh:focusNode ex:list3 ;
106113
sh:resultMessage "Value is a malformed SHACL List." ;
107114
sh:resultSeverity sh:Violation ;
108115
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
109116
sh:sourceShape ex:IRIListShape ;
110-
sh:value _:b3 ;
117+
sh:value ex:list3 ;
111118
sh:detail [
112119
rdf:type sh:ValidationResult ;
113-
sh:focusNode _:b3 ;
114-
sh:resultMessage "Value is a malformed SHACL List. _:b3 is missing rdf:first and rdf:rest properties." ;
120+
sh:focusNode ex:list3 ;
121+
sh:resultMessage "Value is a malformed SHACL List. ex:list3 is missing rdf:first and rdf:rest properties." ;
115122
sh:resultSeverity sh:Violation ;
116123
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
117124
sh:sourceShape ex:IRIListShape ;
118-
sh:value _:b3 ;
125+
sh:value ex:list3 ;
119126
] ;
120127
] ;
121128
sh:result [
122129
rdf:type sh:ValidationResult ;
123-
sh:focusNode _:b4 ;
130+
sh:focusNode ex:list4 ;
124131
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
125132
sh:resultSeverity sh:Violation ;
126133
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
127134
sh:sourceShape ex:IRIListShape ;
128-
sh:value _:b4 ;
135+
sh:value ex:list4 ;
129136
sh:detail [
130137
rdf:type sh:ValidationResult ;
131-
sh:focusNode _:b4 ;
132-
sh:resultMessage "Value is a malformed SHACL List. _:b4 is missing rdf:rest property." ;
138+
sh:focusNode ex:list4 ;
139+
sh:resultMessage "Value is a malformed SHACL List. ex:list4 is missing rdf:rest property." ;
133140
sh:resultSeverity sh:Violation ;
134141
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
135142
sh:sourceShape ex:IRIListShape ;
136-
sh:value _:b4 ;
143+
sh:value ex:list4 ;
137144
] ;
138145
] ;
139146
sh:result [
140147
rdf:type sh:ValidationResult ;
141-
sh:focusNode _:b5 ;
148+
sh:focusNode ex:list5 ;
142149
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
143150
sh:resultSeverity sh:Violation ;
144151
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
@@ -163,7 +170,7 @@ _:b10
163170
] ;
164171
sh:result [
165172
rdf:type sh:ValidationResult ;
166-
sh:focusNode _:b6 ;
173+
sh:focusNode ex:list6 ;
167174
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
168175
sh:resultSeverity sh:Violation ;
169176
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
@@ -178,17 +185,17 @@ _:b10
178185
sh:value "Charlie" ;
179186
], [
180187
rdf:type sh:ValidationResult ;
181-
sh:focusNode _:b6 ;
182-
sh:resultMessage "Value is a malformed SHACL List. _:b6 is missing rdf:rest property." ;
188+
sh:focusNode ex:list6 ;
189+
sh:resultMessage "Value is a malformed SHACL List. ex:list6 is missing rdf:rest property." ;
183190
sh:resultSeverity sh:Violation ;
184191
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
185192
sh:sourceShape ex:IRIListShape ;
186-
sh:value _:b6 ;
193+
sh:value ex:list6 ;
187194
] ;
188195
] ;
189196
sh:result [
190197
rdf:type sh:ValidationResult ;
191-
sh:focusNode _:b7 ;
198+
sh:focusNode ex:list7 ;
192199
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
193200
sh:resultSeverity sh:Violation ;
194201
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
@@ -203,17 +210,17 @@ _:b10
203210
sh:value "Charlie" ;
204211
], [
205212
rdf:type sh:ValidationResult ;
206-
sh:focusNode _:b8 ;
207-
sh:resultMessage "Value is a malformed SHACL List. _:b8 is missing rdf:first and rdf:rest property." ;
213+
sh:focusNode ex:list8 ;
214+
sh:resultMessage "Value is a malformed SHACL List. ex:list8 is missing rdf:first and rdf:rest property." ;
208215
sh:resultSeverity sh:Violation ;
209216
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
210217
sh:sourceShape ex:IRIListShape ;
211-
sh:value _:b8 ;
218+
sh:value ex:list8 ;
212219
] ;
213220
] ;
214221
sh:result [
215222
rdf:type sh:ValidationResult ;
216-
sh:focusNode _:b9 ;
223+
sh:focusNode ex:list9 ;
217224
sh:resultMessage "Value does not conform to Shape ex:IRIListShape. See details for more information." ;
218225
sh:resultSeverity sh:Violation ;
219226
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
@@ -228,12 +235,12 @@ _:b10
228235
sh:value "Charlie" ;
229236
], [
230237
rdf:type sh:ValidationResult ;
231-
sh:focusNode _:b10 ;
232-
sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List _:b9 follows from _:b10." ;
238+
sh:focusNode ex:list10 ;
239+
sh:resultMessage "Value is a malformed SHACL List. A list cannot have itself in the rdf:rest+ path. List ex:list9 follows from ex:list10." ;
233240
sh:resultSeverity sh:Violation ;
234241
sh:sourceConstraintComponent sh:MemberShapeConstraintComponent ;
235242
sh:sourceShape ex:IRIListShape ;
236-
sh:value _:b9 ;
243+
sh:value ex:list9 ;
237244
] ;
238245
] ;
239246
] ;

shacl12-test-suite/tests/core/node/minListLength-001.ttl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ ex:ListShape
1212
rdf:type sh:NodeShape ;
1313
sh:minListLength 1 ;
1414
# Satisfies all constraints
15-
sh:targetNode ( 1 2 ) ;
15+
sh:targetNode ex:list0 ;
1616
# Violates minListLength constraint
1717
sh:targetNode rdf:nil, ex:notAList ;
1818
.
1919

20+
ex:list0
21+
rdf:first 1 ;
22+
rdf:rest ( 2 ) .
23+
2024
<>
2125
rdf:type mf:Manifest ;
2226
mf:entries (

shacl12-test-suite/tests/core/node/uniqueMembers-001.ttl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ ex:ListShape
1212
rdf:type sh:NodeShape ;
1313
sh:uniqueMembers true ;
1414
# Satisfies all constraints
15-
sh:targetNode ( 1 2 ), rdf:nil ;
15+
sh:targetNode ex:list0, rdf:nil ;
1616
# Violates uniqueMembers constraint
17-
sh:targetNode _:b1, ex:notAList ;
17+
sh:targetNode ex:list1, ex:notAList ;
1818
.
1919

20-
_:b1
20+
ex:list0
21+
rdf:first 1 ;
22+
rdf:rest ( 2 ) .
23+
24+
ex:list1
2125
rdf:first 1 ;
2226
rdf:rest ( 2 1 2 2 ) .
2327

@@ -40,22 +44,22 @@ _:b1
4044
sh:conforms "false"^^xsd:boolean ;
4145
sh:result [
4246
rdf:type sh:ValidationResult ;
43-
sh:focusNode _:b1 ;
47+
sh:focusNode ex:list1 ;
4448
sh:resultMessage "Value does not conform to Shape ex:ListShape. See details for more information." ;
4549
sh:resultSeverity sh:Violation ;
4650
sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ;
4751
sh:sourceShape ex:ListShape ;
4852
sh:detail [
4953
rdf:type sh:ValidationResult ;
50-
sh:focusNode _:b1 ;
54+
sh:focusNode ex:list1 ;
5155
sh:resultMessage "List is required to have unique elements. Two occurences of '\"1\"^^xsd:integer' found." ;
5256
sh:resultSeverity sh:Violation ;
5357
sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ;
5458
sh:sourceShape ex:ListShape ;
5559
sh:value 1 ;
5660
], [
5761
rdf:type sh:ValidationResult ;
58-
sh:focusNode _:b1 ;
62+
sh:focusNode ex:list1 ;
5963
sh:resultMessage "List is required to have unique elements. Three occurences of '\"2\"^^xsd:integer' found." ;
6064
sh:resultSeverity sh:Violation ;
6165
sh:sourceConstraintComponent sh:UniqueMembersConstraintComponent ;

0 commit comments

Comments
 (0)