Skip to content

Commit 90e674e

Browse files
Merge pull request #248 from w3c/shacl12-test-suite
#247: Starting point for SHACL 1.2 test suite
2 parents 52c8dbb + 4c70765 commit 90e674e

File tree

151 files changed

+9323
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+9323
-0
lines changed

shacl12-test-suite/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# SHACL 1.2 test-suite
2+
3+
This repository contains the SHACL test-suite for SHACL 1.2.
4+
5+
The format follows the previously published
6+
http://w3c.github.io/data-shapes/data-shapes-test-suite/
7+
8+
The content from the data-shapes-test-suite folder remains unaffected, for SHACL 1.0.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
2+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3+
@prefix sht: <http://www.w3.org/ns/shacl-test#> .
4+
5+
<>
6+
a mf:Manifest ;
7+
rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/core/complex" ;
8+
mf:include <personexample.ttl> ;
9+
mf:include <shacl-shacl.ttl> ;
10+
.
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://datashapes.org/sh/tests/core/complex/personexample.test#> .
3+
@prefix mf: <http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#> .
4+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
5+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
6+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7+
@prefix sh: <http://www.w3.org/ns/shacl#> .
8+
@prefix sht: <http://www.w3.org/ns/shacl-test#> .
9+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10+
11+
ex:Alice
12+
rdf:type ex:Person ;
13+
ex:ssn "987-65-432A" ;
14+
.
15+
ex:Bob
16+
rdf:type ex:Person ;
17+
ex:ssn "123-45-6789" ;
18+
ex:ssn "124-35-6789" ;
19+
.
20+
ex:Calvin
21+
rdf:type ex:Person ;
22+
ex:birthDate "1999-09-09"^^xsd:date ;
23+
ex:worksFor ex:UntypedCompany ;
24+
.
25+
ex:PersonShape
26+
rdf:type sh:NodeShape ;
27+
sh:closed "true"^^xsd:boolean ;
28+
sh:ignoredProperties (
29+
rdf:type
30+
) ;
31+
sh:property _:b61064 ;
32+
sh:property _:b60054 ;
33+
sh:property [
34+
sh:path [
35+
sh:inversePath ex:worksFor ;
36+
] ;
37+
sh:name "employee" ;
38+
] ;
39+
sh:targetClass ex:Person ;
40+
.
41+
_:b61064
42+
sh:path ex:ssn ;
43+
sh:datatype xsd:string ;
44+
sh:maxCount 1 ;
45+
sh:pattern "^\\d{3}-\\d{2}-\\d{4}$"
46+
.
47+
_:b60054
48+
sh:path ex:worksFor ;
49+
sh:class ex:Company ;
50+
sh:nodeKind sh:IRI
51+
.
52+
<>
53+
rdf:type mf:Manifest ;
54+
mf:entries (
55+
<personexample>
56+
) ;
57+
.
58+
<personexample>
59+
rdf:type sht:Validate ;
60+
rdfs:label "Test of personexample" ;
61+
mf:action [
62+
sht:dataGraph <> ;
63+
sht:shapesGraph <> ;
64+
] ;
65+
mf:result [
66+
rdf:type sh:ValidationReport ;
67+
sh:conforms "false"^^xsd:boolean ;
68+
sh:result [
69+
rdf:type sh:ValidationResult ;
70+
sh:focusNode ex:Alice ;
71+
sh:resultPath ex:ssn ;
72+
sh:resultSeverity sh:Violation ;
73+
sh:sourceConstraintComponent sh:PatternConstraintComponent ;
74+
sh:sourceShape _:b61064 ;
75+
sh:value "987-65-432A" ;
76+
] ;
77+
sh:result [
78+
rdf:type sh:ValidationResult ;
79+
sh:focusNode ex:Bob ;
80+
sh:resultPath ex:ssn ;
81+
sh:resultSeverity sh:Violation ;
82+
sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
83+
sh:sourceShape _:b61064 ;
84+
] ;
85+
sh:result [
86+
rdf:type sh:ValidationResult ;
87+
sh:focusNode ex:Calvin ;
88+
sh:resultPath ex:birthDate ;
89+
sh:resultSeverity sh:Violation ;
90+
sh:sourceConstraintComponent sh:ClosedConstraintComponent ;
91+
sh:sourceShape ex:PersonShape ;
92+
sh:value "1999-09-09"^^xsd:date ;
93+
] ;
94+
sh:result [
95+
rdf:type sh:ValidationResult ;
96+
sh:focusNode ex:Calvin ;
97+
sh:resultPath ex:worksFor ;
98+
sh:resultSeverity sh:Violation ;
99+
sh:sourceConstraintComponent sh:ClassConstraintComponent ;
100+
sh:sourceShape _:b60054 ;
101+
sh:value ex:UntypedCompany ;
102+
] ;
103+
] ;
104+
mf:status sht:approved ;
105+
.

0 commit comments

Comments
 (0)