Skip to content

Commit 1982156

Browse files
committed
Merge branch 'gh-pages' into issue-289-shsh-note
2 parents f44c1e9 + 9272a74 commit 1982156

File tree

10 files changed

+1109
-523
lines changed

10 files changed

+1109
-523
lines changed

shacl12-core/index.html

Lines changed: 484 additions & 521 deletions
Large diffs are not rendered by default.

shacl12-sparql/index.html

Lines changed: 343 additions & 0 deletions
Large diffs are not rendered by default.

shacl12-test-suite/tests/core/targets/manifest.ttl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
mf:include <multipleTargets-001.ttl> ;
99
mf:include <targetClass-001.ttl> ;
1010
mf:include <targetClassImplicit-001.ttl> ;
11+
mf:include <targetClassImplicit-002.ttl> ;
1112
mf:include <targetNode-001.ttl> ;
1213
mf:include <targetObjectsOf-001.ttl> ;
1314
mf:include <targetSubjectsOf-001.ttl> ;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://datashapes.org/sh/tests/core/targets/targetClassImplicit-002.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:InvalidInstance
12+
rdf:type ex:SubClass ;
13+
rdfs:label "Invalid instance" ;
14+
.
15+
ex:SubClass
16+
rdf:type rdfs:Class ;
17+
rdfs:label "Sub class" ;
18+
rdfs:subClassOf ex:SuperClass ;
19+
.
20+
ex:SuperClass
21+
a sh:ShapeClass ;
22+
rdfs:label "Super class" ;
23+
sh:in (
24+
ex:ValidInstance
25+
) ;
26+
.
27+
ex:ValidInstance
28+
rdf:type ex:SubClass ;
29+
rdfs:label "Valid instance" ;
30+
.
31+
<>
32+
rdf:type mf:Manifest ;
33+
mf:entries (
34+
<targetClassImplicit-002>
35+
) ;
36+
.
37+
<targetClassImplicit-002>
38+
rdf:type sht:Validate ;
39+
rdfs:label "Verify that sh:ShapeClass is interpreted as implicit class target" ;
40+
mf:action [
41+
sht:dataGraph <> ;
42+
sht:shapesGraph <> ;
43+
] ;
44+
mf:result [
45+
rdf:type sh:ValidationReport ;
46+
sh:conforms "false"^^xsd:boolean ;
47+
sh:result [
48+
rdf:type sh:ValidationResult ;
49+
sh:focusNode ex:InvalidInstance ;
50+
sh:resultSeverity sh:Violation ;
51+
sh:sourceConstraintComponent sh:InConstraintComponent ;
52+
sh:sourceShape ex:SuperClass ;
53+
sh:value ex:InvalidInstance ;
54+
] ;
55+
] ;
56+
mf:status sht:approved ;
57+
.

shacl12-test-suite/tests/sparql/manifest.ttl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
mf:include <node/manifest.ttl> ;
99
mf:include <property/manifest.ttl> ;
1010
mf:include <pre-binding/manifest.ttl> ;
11+
mf:include <targets/manifest.ttl> ;
1112
.

shacl12-test-suite/tests/sparql/property/manifest.ttl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<>
66
a mf:Manifest ;
77
rdfs:label "Tests converted from http://datashapes.org/sh/tests/tests/sparql/property" ;
8+
mf:include <property-select-001.ttl> ;
89
mf:include <sparql-001.ttl> ;
910
.
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://example.org/ns#> .
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:Person-fullName
12+
a sh:PropertyShape ;
13+
sh:targetClass ex:Person ;
14+
sh:name "full name" ;
15+
sh:path [
16+
sh:prefixes <http://example.org/ns> ;
17+
sh:select """
18+
SELECT ?fullName
19+
WHERE {
20+
$this ex:firstName ?firstName .
21+
$this ex:lastName ?lastName .
22+
BIND (CONCAT(?firstName, " ", ?lastName) AS ?fullName) .
23+
}
24+
"""
25+
] ;
26+
sh:datatype xsd:string ;
27+
sh:hasValue "John Muir" .
28+
29+
<http://example.org/ns>
30+
a owl:Ontology ;
31+
sh:declare [
32+
sh:prefix "ex" ;
33+
sh:namespace "http://example.org/ns#"^^xsd:anyURI ;
34+
] .
35+
36+
ex:JohnMuir
37+
a ex:Person ;
38+
ex:firstName "John" ;
39+
ex:lastName "Muir" .
40+
41+
ex:JohnWayne
42+
a ex:Person ;
43+
ex:firstName "John" ;
44+
ex:lastName "Wayne" .
45+
46+
<>
47+
rdf:type mf:Manifest ;
48+
mf:entries (
49+
<property-select-001>
50+
) ;
51+
.
52+
<property-select-001>
53+
rdf:type sht:Validate ;
54+
rdfs:label "Test of a sh:property with a sh:select expression 001" ;
55+
mf:action [
56+
sht:dataGraph <> ;
57+
sht:shapesGraph <> ;
58+
] ;
59+
mf:result [
60+
rdf:type sh:ValidationReport ;
61+
sh:conforms "false"^^xsd:boolean ;
62+
sh:result [
63+
rdf:type sh:ValidationResult ;
64+
sh:focusNode ex:JohnWayne ;
65+
sh:resultPath [
66+
sh:prefixes <http://example.org/ns> ;
67+
sh:select """
68+
SELECT ?fullName
69+
WHERE {
70+
$this ex:firstName ?firstName .
71+
$this ex:lastName ?lastName .
72+
BIND (CONCAT(?firstName, " ", ?lastName) AS ?fullName) .
73+
}
74+
"""
75+
] ;
76+
sh:resultSeverity sh:Violation ;
77+
sh:sourceConstraintComponent sh:HasValueConstraintComponent ;
78+
sh:sourceShape ex:Person-fullName ;
79+
] ;
80+
] ;
81+
mf:status sht:approved ;
82+
.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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 for SPARQL-based targets" ;
8+
mf:include <targetNode-select-001.ttl> ;
9+
.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
@prefix dash: <http://datashapes.org/dash#> .
2+
@prefix ex: <http://example.org/ns#> .
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:ChildShape
12+
a sh:NodeShape ;
13+
rdfs:label "Child shape" ;
14+
rdfs:comment "This shape applies to all persons under 18 years of age." ;
15+
sh:targetNode [
16+
sh:select """
17+
PREFIX ex: <http://example.org/ns#>
18+
SELECT ?person
19+
WHERE {
20+
?person a/rdfs:subClassOf* ex:Person .
21+
?person ex:age ?age .
22+
FILTER (?age < 18) .
23+
}
24+
"""
25+
] ;
26+
sh:property ex:ChildShape-driversLicense .
27+
28+
ex:ChildShape-driversLicense
29+
a sh:PropertyShape ;
30+
sh:path ex:driversLicense ;
31+
sh:maxCount 0 .
32+
33+
ex:Benjamin
34+
a ex:Person ;
35+
ex:driversLicense "123" ;
36+
ex:age 17 .
37+
38+
ex:Klaus
39+
a ex:Person ;
40+
ex:driversLicense "456" ;
41+
ex:age 48 .
42+
43+
ex:Bernd
44+
a ex:Person ;
45+
ex:driversLicense "789" .
46+
47+
<>
48+
rdf:type mf:Manifest ;
49+
mf:entries (
50+
<targetNode-select-001>
51+
) ;
52+
.
53+
<targetNode-select-001>
54+
rdf:type sht:Validate ;
55+
rdfs:label "Test of sh:targetNode with a sh:select expression 001" ;
56+
mf:action [
57+
sht:dataGraph <> ;
58+
sht:shapesGraph <> ;
59+
] ;
60+
mf:result [
61+
rdf:type sh:ValidationReport ;
62+
sh:conforms "false"^^xsd:boolean ;
63+
sh:result [
64+
rdf:type sh:ValidationResult ;
65+
sh:focusNode ex:Benjamin ;
66+
sh:resultPath ex:driversLicense ;
67+
sh:resultSeverity sh:Violation ;
68+
sh:sourceConstraintComponent sh:MaxCountConstraintComponent ;
69+
sh:sourceShape ex:ChildShape-driversLicense ;
70+
] ;
71+
] ;
72+
mf:status sht:approved ;
73+
.

shacl12-vocabularies/shacl.ttl

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# - Changed rdfs:label of sh:nodeValidator from "shape validator" to "node validator"
1313
# - Fixed rdfs:label of sh:TripleRule, moved into comment
1414
# - Made rdfs:label of sh:LessThanOrEqualsConstraintComponent upper case
15+
# - Added support for sh:singleLine (see https://github.com/w3c/data-shapes/issues/177)
16+
# - Deleted any terms related to SHACL-JS (see https://github.com/w3c/data-shapes/issues/264)
17+
# - Added sh:NodeExpression and related infrastructure
18+
# - Added sh:SelectExpression and its parameters
1519

1620
@prefix owl: <http://www.w3.org/2002/07/owl#> .
1721
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@@ -54,6 +58,14 @@ sh:PropertyShape
5458
rdfs:subClassOf sh:Shape ;
5559
rdfs:isDefinedBy sh: .
5660

61+
sh:ShapeClass
62+
a rdfs:Class ;
63+
rdfs:comment "A shape class is a class that is also a node shape. sh:ShapeClass can be used as rdf:type instead of the combination of rdfs:Class and sh:NodeShape."@en ;
64+
rdfs:label "Shape class"@en ;
65+
rdfs:subClassOf rdfs:Class ;
66+
rdfs:subClassOf sh:NodeShape ;
67+
rdfs:isDefinedBy sh: .
68+
5769
sh:deactivated
5870
a rdf:Property ;
5971
rdfs:label "deactivated"@en ;
@@ -73,7 +85,7 @@ sh:targetClass
7385
sh:targetNode
7486
a rdf:Property ;
7587
rdfs:label "target node"@en ;
76-
rdfs:comment "Links a shape to individual nodes, indicating that these nodes must conform to the shape."@en ;
88+
rdfs:comment "Links a shape to node expressions, indicating that the output nodes must conform to the shape."@en ;
7789
rdfs:domain sh:Shape ;
7890
rdfs:isDefinedBy sh: .
7991

@@ -332,7 +344,6 @@ sh:path
332344
rdfs:label "path"@en ;
333345
rdfs:comment "Specifies the property path of a property shape."@en ;
334346
rdfs:domain sh:PropertyShape ;
335-
rdfs:range rdfs:Resource ;
336347
rdfs:isDefinedBy sh: .
337348

338349
sh:inversePath
@@ -1173,6 +1184,23 @@ sh:xone
11731184
rdfs:isDefinedBy sh: .
11741185

11751186

1187+
# Node Expressions ------------------------------------------------------------
1188+
1189+
sh:NodeExpression
1190+
a rdfs:Class ;
1191+
rdfs:label "Node expression"@en ;
1192+
rdfs:comment "The base class for the available node expression functions."@en ;
1193+
rdfs:subClassOf sh:Parameterizable ;
1194+
rdfs:isDefinedBy sh: .
1195+
1196+
sh:keyParameter
1197+
a rdf:Property ;
1198+
rdfs:label "key parameter"@en ;
1199+
rdfs:comment "Set to true for the parameter of a node expression function that uniquely identifies it."@en ;
1200+
rdfs:range xsd:boolean ;
1201+
rdfs:isDefinedBy sh: .
1202+
1203+
11761204
# General SPARQL execution support --------------------------------------------
11771205

11781206
sh:SPARQLExecutable
@@ -1310,6 +1338,34 @@ sh:SPARQLConstraint
13101338
rdfs:isDefinedBy sh: .
13111339

13121340

1341+
# SPARQL-based Node Expressions -----------------------------------------------
1342+
1343+
sh:SelectExpression
1344+
a rdfs:Class ;
1345+
rdfs:label "Select expression"@en ;
1346+
rdfs:comment "The class of node expressions based on SPARQL SELECT queries."@en ;
1347+
rdfs:subClassOf sh:NodeExpression ;
1348+
rdfs:subClassOf sh:SPARQLSelectExecutable ;
1349+
sh:parameter sh:SelectExpression-select ;
1350+
sh:parameter sh:SelectExpression-prefixes ;
1351+
rdfs:isDefinedBy sh: .
1352+
1353+
sh:SelectExpression-select
1354+
a sh:Parameter ;
1355+
sh:path sh:select ;
1356+
sh:name "select"@en ;
1357+
sh:description "The SELECT query that is executed during evaluation of this node expression. The output nodes are the bindings of the first result variable."@en ;
1358+
sh:keyParameter true ;
1359+
rdfs:isDefinedBy sh: .
1360+
1361+
sh:SelectExpression-prefixes
1362+
a sh:Parameter ;
1363+
sh:path sh:prefixes ;
1364+
sh:name "prefixes"@en ;
1365+
sh:description "The prefixes that shall be applied before parsing the associated SPARQL query. The object should define those prefixes using sh:declare."@en ;
1366+
rdfs:isDefinedBy sh: .
1367+
1368+
13131369
# Non-validating constraint properties ----------------------------------------
13141370

13151371
sh:defaultValue

0 commit comments

Comments
 (0)