Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New version of system vocab and ref document for recursion propagatio…
…n based on "undefined". Added/updated tests for these changes.
- Loading branch information
1 parent
d7dbe19
commit dbe442a
Showing
7 changed files
with
459 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# baseURI: http://www.w3.org/ns/shacl/test/features/core/and-003 | ||
|
||
@prefix ex: <http://example.org/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
<> | ||
a sh:Graph ; | ||
sh:shapesGraph <http://www.w3.org/ns/shacl> ; | ||
. | ||
|
||
|
||
# Shape Definitions ----------------------------------------------------------- | ||
|
||
ex:RecursiveShape | ||
a sh:Shape ; | ||
sh:property [ | ||
sh:predicate ex:property2 ; | ||
sh:valueShape ex:RecursiveShape ; | ||
] ; | ||
. | ||
|
||
ex:AndShape | ||
a sh:Shape ; | ||
sh:constraint [ | ||
a sh:AndConstraint ; | ||
sh:shapes ( | ||
[ | ||
sh:property [ | ||
sh:predicate ex:property1 ; | ||
sh:maxCount 1 ; | ||
] | ||
] | ||
ex:RecursiveShape | ||
) | ||
] ; | ||
. | ||
|
||
# Instances ------------------------------------------------------------------- | ||
|
||
ex:ValidInstance1 | ||
sh:nodeShape ex:AndShape ; | ||
ex:property1 "One" ; | ||
. | ||
|
||
# Invalid: Infinite loop | ||
ex:InvalidInstance1 | ||
sh:nodeShape ex:AndShape ; | ||
ex:property2 ex:InvalidInstance1 ; | ||
. | ||
|
||
# Invalid: more than one property1 | ||
ex:InvalidInstance2 | ||
sh:nodeShape ex:AndShape ; | ||
ex:property1 "One" ; | ||
ex:property1 "Two" ; | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
data-shapes-test-suite/tests/features/core/recursive-002.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# baseURI: http://www.w3.org/ns/shacl/test/features/core/recursive-002 | ||
|
||
@prefix ex: <http://example.org/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
<> | ||
a sh:Graph ; | ||
sh:shapesGraph <http://www.w3.org/ns/shacl> ; | ||
. | ||
|
||
# Shapes ---------------------------------------------------------------------- | ||
|
||
ex:MyShape | ||
a sh:Shape ; | ||
sh:property [ | ||
sh:predicate ex:property ; | ||
sh:valueShape ex:MyShape ; | ||
] ; | ||
. | ||
|
||
# Instances ------------------------------------------------------------------- | ||
|
||
ex:Instance | ||
sh:nodeShape ex:MyShape ; | ||
ex:property ex:Instance . |
84 changes: 84 additions & 0 deletions
84
data-shapes-test-suite/tests/features/core/recursive-003.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# baseURI: http://www.w3.org/ns/shacl/test/features/core/recursive-003 | ||
|
||
@prefix ex: <http://example.org/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
|
||
<> | ||
a sh:Graph ; | ||
sh:shapesGraph <http://www.w3.org/ns/shacl> ; | ||
rdfs:comment "Based on an example suggested by Simon in https://lists.w3.org/Archives/Public/public-data-shapes-wg/2015Jun/0083.html" ; | ||
. | ||
|
||
# Shapes ---------------------------------------------------------------------- | ||
|
||
ex:recursionShapeExample | ||
a sh:Shape ; | ||
sh:property [ | ||
sh:predicate ex:someProperty ; | ||
sh:valueShape ex:hasAShape ; | ||
] . | ||
|
||
ex:hasAShape | ||
a sh:Shape ; | ||
sh:constraint [ | ||
a sh:AndConstraint ; | ||
sh:shapes (ex:ValueTypeAShape ex:notBShape) | ||
] . | ||
|
||
ex:hasBShape | ||
a sh:Shape ; | ||
sh:constraint [ | ||
a sh:AndConstraint ; | ||
sh:shapes (ex:ValueTypeBShape ex:notAShape) | ||
] . | ||
|
||
ex:notAShape | ||
a sh:Shape ; | ||
sh:constraint [ | ||
a sh:NotConstraint ; | ||
sh:shape ex:hasAShape ; | ||
] . | ||
|
||
ex:notBShape | ||
a sh:Shape ; | ||
sh:constraint [ | ||
a sh:NotConstraint ; | ||
sh:shape ex:hasBShape; | ||
] . | ||
|
||
ex:ValueTypeAShape | ||
a sh:Shape ; | ||
sh:property [ | ||
sh:predicate ex:property ; | ||
sh:valueType ex:ClassA ; | ||
] . | ||
|
||
ex:ValueTypeBShape | ||
a sh:Shape ; | ||
sh:property [ | ||
sh:predicate ex:property ; | ||
sh:valueType ex:ClassB ; | ||
] . | ||
|
||
|
||
# Instances ------------------------------------------------------------------- | ||
|
||
ex:InstanceOfA | ||
a ex:ClassA ; | ||
. | ||
|
||
ex:InstanceOfB | ||
a ex:ClassB ; | ||
. | ||
|
||
ex:Instance1 | ||
sh:nodeShape ex:recursionShapeExample ; | ||
ex:someProperty ex:Instance2 ; | ||
. | ||
|
||
ex:Instance2 | ||
ex:property ex:InstanceOfA ; | ||
. |
Oops, something went wrong.