diff --git a/.github/workflows/shacl.yml b/.github/workflows/shacl.yml new file mode 100644 index 0000000..8301a49 --- /dev/null +++ b/.github/workflows/shacl.yml @@ -0,0 +1,20 @@ +name: shacl + +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Validate against SHACL shape + uses: konradhoeffner/shacl@v1 + with: + shacl: myshaclfile.ttl + data: TACIO.ttl + \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf126e8 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +[![SHACL status](https://github.com/username/reponame/actions/workflows/workflowname.yml/badge.svg)](https://github.com/username/reponame/actions/workflows/workflowname.yml) \ No newline at end of file diff --git a/myshaclfile.ttl b/myshaclfile.ttl new file mode 100644 index 0000000..f4bcf6c --- /dev/null +++ b/myshaclfile.ttl @@ -0,0 +1,65 @@ +@prefix sh: . +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix cco: . + +# Shapes Graph +[] rdf:type sh:NodeShape ; + sh:targetClass cco:ActOfEncoding ; + sh:property [ + sh:path rdfs:label ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ActOfEncoding must have a label." ; + ] ; + sh:property [ + sh:path cco:definition ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ActOfEncoding must have a definition." ; + ] . + +# Validate cco:ActOfCopying +[] rdf:type sh:NodeShape ; + sh:targetClass cco:ActOfCopying ; + sh:property [ + sh:path cco:definition ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ActOfCopying must have a definition." ; + ] ; + sh:property [ + sh:path rdfs:label ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ActOfCopying must have a label." ; + ] . + +# Object Property: cco:has_information_descendent_copy +[] rdf:type sh:PropertyShape ; + sh:targetObjectsOf cco:has_information_descendent_copy ; + sh:class cco:ReferenceCarrier ; + sh:message "Objects of cco:has_information_descendent_copy must be of type cco:ReferenceCarrier." . + +# Object Property: cco:is_a_canonical_copy_of +[] rdf:type sh:PropertyShape ; + sh:targetObjectsOf cco:is_a_canonical_copy_of ; + sh:class cco:ReferenceCarrier ; + sh:message "Objects of cco:is_a_canonical_copy_of must be of type cco:ReferenceCarrier." . + +# Validate Properties of cco:ReferenceCarrier +[] rdf:type sh:NodeShape ; + sh:targetClass cco:ReferenceCarrier ; + sh:property [ + sh:path rdfs:label ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ReferenceCarrier must have a label." ; + ] ; + sh:property [ + sh:path cco:definition ; + sh:datatype xsd:string ; + sh:minCount 1 ; + sh:message "Instances of cco:ReferenceCarrier must have a definition." ; + ] .