-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: cases for blank node contact point
- Loading branch information
Showing
6 changed files
with
233 additions
and
0 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
50 changes: 50 additions & 0 deletions
50
test/standalone-cube-constraint/invalid.blankContactPoint.missingEmail.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,50 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix cube: <https://cube.link/> . | ||
@prefix observation: <https://environment.ld.admin.ch/foen/nfi/observation/max_min_undefined> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix schema: <http://schema.org/> . | ||
@base <https://example.org/> . | ||
|
||
<cube> a cube:Cube ; | ||
cube:observationConstraint <shape> ; | ||
cube:observationSet <observationSet> ; | ||
schema:name "Example cube" ; | ||
schema:publisher <publisher> ; | ||
schema:creator <creator> ; | ||
schema:contributor <contributor> ; | ||
schema:dateCreated "2020-10-10"^^xsd:date ; | ||
schema:dateModified "2020-10-10"^^xsd:date ; | ||
schema:datePublished "2020-11-11"^^xsd:date ; | ||
schema:contactPoint | ||
[ | ||
schema:name "John Doe" ; | ||
# schema:email "[email protected]" ; | ||
] . | ||
|
||
<observationSet> cube:observation <observation> . | ||
|
||
<observation> a cube:Observation ; | ||
cube:observedBy <observer> ; | ||
<dimension1> 4.9 . | ||
|
||
<shape> a cube:Constraint ; | ||
sh:targetClass cube:Observation ; | ||
sh:closed true ; | ||
sh:property | ||
[ | ||
sh:path rdf:type ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:path cube:observedBy ; ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:datatype xsd:decimal ; | ||
sh:path <dimension1> ; | ||
schema:name "some Quantity" | ||
] ; | ||
. |
41 changes: 41 additions & 0 deletions
41
test/standalone-cube-constraint/invalid.blankContactPoint.missingEmail.ttl.approved.txt
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,41 @@ | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix cube: <https://cube.link/> . | ||
|
||
_:report a sh:ValidationReport ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:OrConstraintComponent ; | ||
sh:sourceShape [ | ||
sh:path schema:contactPoint ; | ||
sh:minCount 1 ; | ||
sh:or ( | ||
[ | ||
sh:nodeKind sh:IRI ; | ||
] | ||
[ | ||
sh:nodeKind sh:BlankNode ; | ||
sh:property [ | ||
sh:path schema:email ; | ||
sh:minCount 1 ; | ||
sh:message "Contact point needs an email" ; | ||
sh:datatype xsd:string ; | ||
], [ | ||
sh:path schema:name ; | ||
sh:minCount 1 ; | ||
sh:message "Contact point needs a name" ; | ||
sh:datatype xsd:string ; | ||
] ; | ||
] | ||
) ; | ||
sh:message "cube:Cube needs a schema:contactpoint" ; | ||
] ; | ||
sh:focusNode <https://example.org/cube> ; | ||
sh:resultPath schema:contactPoint ; | ||
sh:value _:b1 ; | ||
sh:resultMessage "cube:Cube needs a schema:contactpoint" ; | ||
] ; | ||
sh:conforms false . |
50 changes: 50 additions & 0 deletions
50
test/standalone-cube-constraint/invalid.blankContactPoint.missingName.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,50 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix cube: <https://cube.link/> . | ||
@prefix observation: <https://environment.ld.admin.ch/foen/nfi/observation/max_min_undefined> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix schema: <http://schema.org/> . | ||
@base <https://example.org/> . | ||
|
||
<cube> a cube:Cube ; | ||
cube:observationConstraint <shape> ; | ||
cube:observationSet <observationSet> ; | ||
schema:name "Example cube" ; | ||
schema:publisher <publisher> ; | ||
schema:creator <creator> ; | ||
schema:contributor <contributor> ; | ||
schema:dateCreated "2020-10-10"^^xsd:date ; | ||
schema:dateModified "2020-10-10"^^xsd:date ; | ||
schema:datePublished "2020-11-11"^^xsd:date ; | ||
schema:contactPoint | ||
[ | ||
# schema:name "John Doe" ; | ||
schema:email "[email protected]" ; | ||
] . | ||
|
||
<observationSet> cube:observation <observation> . | ||
|
||
<observation> a cube:Observation ; | ||
cube:observedBy <observer> ; | ||
<dimension1> 4.9 . | ||
|
||
<shape> a cube:Constraint ; | ||
sh:targetClass cube:Observation ; | ||
sh:closed true ; | ||
sh:property | ||
[ | ||
sh:path rdf:type ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:path cube:observedBy ; ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:datatype xsd:decimal ; | ||
sh:path <dimension1> ; | ||
schema:name "some Quantity" | ||
] ; | ||
. |
41 changes: 41 additions & 0 deletions
41
test/standalone-cube-constraint/invalid.blankContactPoint.missingName.ttl.approved.txt
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,41 @@ | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix schema: <http://schema.org/> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix cube: <https://cube.link/> . | ||
|
||
_:report a sh:ValidationReport ; | ||
sh:result [ | ||
rdf:type sh:ValidationResult ; | ||
sh:resultSeverity sh:Violation ; | ||
sh:sourceConstraintComponent sh:OrConstraintComponent ; | ||
sh:sourceShape [ | ||
sh:path schema:contactPoint ; | ||
sh:minCount 1 ; | ||
sh:or ( | ||
[ | ||
sh:nodeKind sh:IRI ; | ||
] | ||
[ | ||
sh:nodeKind sh:BlankNode ; | ||
sh:property [ | ||
sh:path schema:email ; | ||
sh:minCount 1 ; | ||
sh:message "Contact point needs an email" ; | ||
sh:datatype xsd:string ; | ||
], [ | ||
sh:path schema:name ; | ||
sh:minCount 1 ; | ||
sh:message "Contact point needs a name" ; | ||
sh:datatype xsd:string ; | ||
] ; | ||
] | ||
) ; | ||
sh:message "cube:Cube needs a schema:contactpoint" ; | ||
] ; | ||
sh:focusNode <https://example.org/cube> ; | ||
sh:resultPath schema:contactPoint ; | ||
sh:value _:b1 ; | ||
sh:resultMessage "cube:Cube needs a schema:contactpoint" ; | ||
] ; | ||
sh:conforms false . |
50 changes: 50 additions & 0 deletions
50
test/standalone-cube-constraint/valid.blankContactPoint.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,50 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix cube: <https://cube.link/> . | ||
@prefix observation: <https://environment.ld.admin.ch/foen/nfi/observation/max_min_undefined> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix schema: <http://schema.org/> . | ||
@base <https://example.org/> . | ||
|
||
<cube> a cube:Cube ; | ||
cube:observationConstraint <shape> ; | ||
cube:observationSet <observationSet> ; | ||
schema:name "Example cube" ; | ||
schema:publisher <publisher> ; | ||
schema:creator <creator> ; | ||
schema:contributor <contributor> ; | ||
schema:dateCreated "2020-10-10"^^xsd:date ; | ||
schema:dateModified "2020-10-10"^^xsd:date ; | ||
schema:datePublished "2020-11-11"^^xsd:date ; | ||
schema:contactPoint | ||
[ | ||
schema:name "John Doe" ; | ||
schema:email "[email protected]" ; | ||
] . | ||
|
||
<observationSet> cube:observation <observation> . | ||
|
||
<observation> a cube:Observation ; | ||
cube:observedBy <observer> ; | ||
<dimension1> 4.9 . | ||
|
||
<shape> a cube:Constraint ; | ||
sh:targetClass cube:Observation ; | ||
sh:closed true ; | ||
sh:property | ||
[ | ||
sh:path rdf:type ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:path cube:observedBy ; ; | ||
sh:nodeKind sh:IRI | ||
] ; | ||
sh:property | ||
[ | ||
sh:datatype xsd:decimal ; | ||
sh:path <dimension1> ; | ||
schema:name "some Quantity" | ||
] ; | ||
. |