Skip to content

Commit 4fcf8b2

Browse files
committed
Update test cases to support node expressions in sh:node
1 parent 32d80ff commit 4fcf8b2

File tree

3 files changed

+32
-22
lines changed

3 files changed

+32
-22
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ ex:TestClass
1717
rdf:type sh:NodeShape ;
1818
rdfs:label "Test class" ;
1919
rdfs:subClassOf rdfs:Resource ;
20-
sh:node [
21-
sh:class ex:OtherClass ;
22-
] ;
20+
# Only using an IRI Expression here because Core doesn't define interesting node expressions
21+
sh:node ex:TestNodeShape ;
22+
.
23+
ex:TestNodeShape
24+
rdf:type sh:NodeShape ;
25+
sh:class ex:OtherClass ;
2326
.
2427
ex:ValidInstance
2528
rdf:type ex:OtherClass ;
@@ -46,6 +49,7 @@ ex:ValidInstance
4649
rdf:type sh:ValidationResult ;
4750
sh:focusNode ex:InvalidInstance ;
4851
sh:resultSeverity sh:Violation ;
52+
sh:sourceConstraint ex:TestNodeShape ;
4953
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
5054
sh:sourceShape ex:TestClass ;
5155
sh:value ex:InvalidInstance ;

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

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ ex:Anon
1212
rdf:type ex:Person ;
1313
ex:firstName "Anon" ;
1414
.
15+
ex:AssignedToShape ;
16+
rdf:type sh:NodeShape ;
17+
rdfs:comment "All assignees must have an email and a last name." ;
18+
sh:property [
19+
sh:path ex:email ;
20+
sh:maxCount 1 ;
21+
sh:minCount 1 ;
22+
] ;
23+
sh:property [
24+
sh:path ex:lastName ;
25+
sh:maxCount 1 ;
26+
sh:minCount 1 ;
27+
] ;
28+
.
1529
ex:Issue
1630
rdf:type rdfs:Class ;
1731
rdf:type sh:NodeShape ;
@@ -23,19 +37,8 @@ ex:Issue
2337
ex:Issue-assignedTo
2438
sh:path ex:assignedTo ;
2539
sh:class ex:Person ;
26-
sh:node [
27-
rdfs:comment "All assignees must have an email and a last name." ;
28-
sh:property [
29-
sh:path ex:email ;
30-
sh:maxCount 1 ;
31-
sh:minCount 1 ;
32-
] ;
33-
sh:property [
34-
sh:path ex:lastName ;
35-
sh:maxCount 1 ;
36-
sh:minCount 1 ;
37-
] ;
38-
] ;
40+
# Only using an IRI Expression here because Core doesn't define interesting node expressions
41+
sh:node ex:AssignedToShape ;
3942
.
4043
ex:Issue-submittedBy
4144
sh:path ex:submittedBy ;
@@ -104,6 +107,7 @@ ex:Person
104107
sh:focusNode ex:Issue_1 ;
105108
sh:resultPath ex:assignedTo ;
106109
sh:resultSeverity sh:Violation ;
110+
sh:sourceConstraint ex:AssignedToShape ;
107111
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
108112
sh:sourceShape ex:Issue-assignedTo ;
109113
sh:value ex:Anon ;

shacl12-test-suite/tests/core/property/qualifiedValueShape-001.ttl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,17 @@ ex:APGARObservationShape-related
2020
sh:qualifiedValueShape [
2121
sh:property [
2222
sh:path ex:related_target ;
23-
sh:node [
24-
sh:property [
25-
sh:path ex:reference ;
26-
sh:hasValue ex:something ;
27-
] ;
28-
] ;
23+
sh:node ex:NestedNodeShape ;
2924
] ;
3025
] ;
3126
.
27+
ex:NestedNodeShape
28+
rdf:type sh:NodeShape ;
29+
sh:property [
30+
sh:path ex:reference ;
31+
sh:hasValue ex:something ;
32+
] ;
33+
.
3234
ex:Observation1
3335
rdf:type ex:Observation ;
3436
ex:related [

0 commit comments

Comments
 (0)