Skip to content

Commit

Permalink
shacl validation
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbeve committed Nov 18, 2024
1 parent 4cec50a commit 86f06ca
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/shacl.yml
Original file line number Diff line number Diff line change
@@ -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

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
65 changes: 65 additions & 0 deletions myshaclfile.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix cco: <http://www.ontologyrepository.com/CommonCoreOntologies/> .

# 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." ;
] .

0 comments on commit 86f06ca

Please sign in to comment.