Skip to content

Commit

Permalink
ci: build image but only skip push
Browse files Browse the repository at this point in the history
  • Loading branch information
tpluscode committed Feb 7, 2024
1 parent 4df403b commit 984ad64
Show file tree
Hide file tree
Showing 14 changed files with 672 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/modern-masks-knock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cube-link": patch
---

Visualize validation profile (closes #114)
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"test:basic-cube-constraint": "./test/check-metadata.sh --profile=basic-cube-constraint",
"test:standalone-cube-constraint": "./test/check-metadata.sh --profile=standalone-cube-constraint",
"test:standalone-constraint-constraint": "./test/check-metadata.sh --profile=standalone-constraint-constraint",
"test:profile-visualize": "./test/check-metadata.sh --profile=profile-visualize",
"test:profile-opendataswiss": "./test/check-metadata.sh --profile=profile-opendataswiss",
"test:profile-opendataswiss-lindas": "./test/check-metadata.sh --profile=profile-opendataswiss-lindas",
"release": "changeset tag"
Expand Down
56 changes: 56 additions & 0 deletions test/profile-visualize/invalid-datatype-langstring.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX meta: <https://cube.link/meta/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX cube: <https://cube.link/>
PREFIX ex: <http://example.org/>

ex:Cube
a cube:Cube, dcat:Dataset ;
cube:observationSet <observationSet> ;
cube:observationConstraint <observationConstraint> ;
schema:name "Example cube" ;
schema:publisher <publisher> ;
schema:creator <creator> ;
schema:contributor <contributor> ;
dcterms:identifier "cube-1234" ;
schema:workExample <https://ld.admin.ch/application/visualize> ;
schema:creativeWorkStatus <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published> ;
dcterms:creator ex:John-Doe ;
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 .

<observationConstraint> a cube:Constraint ;
sh:closed true ;
sh:property
[
schema:name "Value" ;
sh:path <dimension1> ;
sh:datatype rdf:langString ;
],
[
sh:path rdf:type ;
sh:nodeKind sh:IRI
],
[
sh:path cube:observedBy ;
sh:nodeKind sh:IRI
] ;
.
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
@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:NodeConstraintComponent ;
sh:sourceShape [
sh:path cube:observationConstraint ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:node <https://cube.link/shape/profile-opendataswiss-lindas#ObservationConstraintShape> ;
] ;
sh:focusNode <http://example.org/Cube> ;
sh:value <observationConstraint> ;
sh:resultMessage "Value does not have shape <https://cube.link/shape/profile-opendataswiss-lindas#ObservationConstraintShape>" ;
sh:detail [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:NodeKindConstraintComponent ;
sh:sourceShape [
sh:nodeKind sh:IRI ;
] ;
sh:focusNode _:b1 ;
sh:value _:b1 ;
sh:resultMessage "Value does not have node kind <http://www.w3.org/ns/shacl#IRI>" ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:OrConstraintComponent ;
sh:sourceShape _:b393 ;
sh:focusNode <observationConstraint> ;
sh:value _:b2 ;
sh:resultMessage "Observation constraint must have exactly one datatype. It cannot be rdf:langString" ;
sh:resultPath sh:property ;
] ;
sh:resultPath cube:observationConstraint ;
], [
rdf:type sh:ValidationResult ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:OrConstraintComponent ;
sh:sourceShape _:b393 ;
sh:focusNode <observationConstraint> ;
sh:value _:b2 ;
sh:resultMessage "Observation constraint must have exactly one datatype. It cannot be rdf:langString" ;
sh:resultPath sh:property ;
] ;
sh:conforms false .

_:b393 sh:path sh:property ;
sh:or (
[
sh:node <https://cube.link/shape/profile-opendataswiss-lindas#ObservationConstraintDatatypeProperty> ;
]
[
sh:node <https://cube.link/shape/profile-opendataswiss-lindas#ObservationConstraintCoreProperty> ;
]
) ;
sh:message "Observation constraint must have exactly one datatype. It cannot be rdf:langString" .
55 changes: 55 additions & 0 deletions test/profile-visualize/invalid-no-status.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX meta: <https://cube.link/meta/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX cube: <https://cube.link/>
PREFIX ex: <http://example.org/>

ex:Cube
a cube:Cube, dcat:Dataset ;
cube:observationSet <observationSet> ;
cube:observationConstraint <observationConstraint> ;
schema:name "Example cube" ;
schema:publisher <publisher> ;
schema:creator <creator> ;
schema:contributor <contributor> ;
dcterms:identifier "cube-1234" ;
schema:workExample <https://ld.admin.ch/application/visualize> ;
# schema:creativeWorkStatus <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Draft> ;
dcterms:creator ex:John-Doe ;
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 .

<observationConstraint> a cube:Constraint ;
sh:closed true ;
sh:property
[
schema:name "Value" ;
sh:path <dimension1> ;
sh:datatype xsd:decimal ;
],
[
sh:path rdf:type ;
sh:nodeKind sh:IRI
],
[
sh:path cube:observedBy ;
sh:nodeKind sh:IRI
] ;
.
24 changes: 24 additions & 0 deletions test/profile-visualize/invalid-no-status.ttl.approved.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@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:MinCountConstraintComponent ;
sh:sourceShape [
sh:path schema:creativeWorkStatus ;
sh:in (
<https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published>
<https://ld.admin.ch/vocabulary/CreativeWorkStatus/Draft>
) ;
sh:minCount 1 ;
] ;
sh:focusNode <http://example.org/Cube> ;
sh:resultPath schema:creativeWorkStatus ;
sh:resultMessage "Less than 1 values" ;
] ;
sh:conforms false .
63 changes: 63 additions & 0 deletions test/profile-visualize/invalid-temporal.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX qudt: <http://qudt.org/schema/qudt/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX meta: <https://cube.link/meta/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX cube: <https://cube.link/>
PREFIX ex: <http://example.org/>

ex:Cube
a cube:Cube, dcat:Dataset ;
cube:observationSet <observationSet> ;
cube:observationConstraint <observationConstraint> ;
schema:name "Example cube" ;
schema:publisher <publisher> ;
schema:creator <creator> ;
schema:contributor <contributor> ;
dcterms:identifier "cube-1234" ;
schema:workExample <https://ld.admin.ch/application/visualize> ;
schema:creativeWorkStatus <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Published> ;
dcterms:creator ex:John-Doe ;
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> ;
<y> "2000"^^xsd:gYear ;
.

<observationConstraint> a cube:Constraint ;
sh:closed true ;
sh:property
[
# no datatype, no time:unitType
schema:name "Year" ;
sh:path <y> ;
sh:nodeKind sh:Literal ;
meta:dataKind
[
a time:GeneralDateTimeDescription ;
] ;
],
[
sh:path rdf:type ;
sh:nodeKind sh:IRI
],
[
sh:path cube:observedBy ;
sh:nodeKind sh:IRI
] ;
.
17 changes: 17 additions & 0 deletions test/profile-visualize/invalid-temporal.ttl.approved.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@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 <https://cube.link/shape/profile-opendataswiss-lindas#TemporalDimensionConstraint> ;
sh:focusNode _:b3 ;
sh:value _:b3 ;
sh:resultMessage "Temporal dimension must be one of XSD datatypes: gYear, gYearMonth, date, dateTime, or have time:unitType" ;
] ;
sh:conforms false .
55 changes: 55 additions & 0 deletions test/profile-visualize/valid-draft.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX meta: <https://cube.link/meta/>
PREFIX sh: <http://www.w3.org/ns/shacl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX schema: <http://schema.org/>
PREFIX dcat: <http://www.w3.org/ns/dcat#>
PREFIX cube: <https://cube.link/>
PREFIX ex: <http://example.org/>

ex:Cube
a cube:Cube, dcat:Dataset ;
cube:observationSet <observationSet> ;
cube:observationConstraint <observationConstraint> ;
schema:name "Example cube" ;
schema:publisher <publisher> ;
schema:creator <creator> ;
schema:contributor <contributor> ;
dcterms:identifier "cube-1234" ;
schema:workExample <https://ld.admin.ch/application/visualize> ;
schema:creativeWorkStatus <https://ld.admin.ch/vocabulary/CreativeWorkStatus/Draft> ;
dcterms:creator ex:John-Doe ;
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 .

<observationConstraint> a cube:Constraint ;
sh:closed true ;
sh:property
[
schema:name "Value" ;
sh:path <dimension1> ;
sh:datatype xsd:decimal ;
],
[
sh:path rdf:type ;
sh:nodeKind sh:IRI
],
[
sh:path cube:observedBy ;
sh:nodeKind sh:IRI
] ;
.
Loading

0 comments on commit 984ad64

Please sign in to comment.