From 9de0e56cdcc43ef8afe75cbeca8ec6d57b9c29c4 Mon Sep 17 00:00:00 2001 From: Simone Baffelli Date: Wed, 13 Aug 2025 16:49:04 +0200 Subject: [PATCH] Added SHACL validation --- .../lib/python/lib-ro-crate-schema/test.shacl | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 0.2.x/lib/python/lib-ro-crate-schema/test.shacl diff --git a/0.2.x/lib/python/lib-ro-crate-schema/test.shacl b/0.2.x/lib/python/lib-ro-crate-schema/test.shacl new file mode 100644 index 0000000..af5e716 --- /dev/null +++ b/0.2.x/lib/python/lib-ro-crate-schema/test.shacl @@ -0,0 +1,104 @@ +PREFIX rdfs: +PREFIX rdf: +PREFIX owl: +PREFIX schema: +PREFIX xsd: +PREFIX openBIS: <_> +PREFIX sh: +PREFIX ex: <_> +#PREFIX crate: + + + +# ex:CrateDefinitionShape a sh:NodeShape ; +# sh:property [ +# sh:path "@graph" ; +# sh:minCount 1 ; +# ] . + +ex:ClassDefinitionShape a sh:NodeShape ; + sh:targetClass rdfs:Class ; + sh:property [ + sh:path rdfs:subClassOf ; + sh:nodeKind sh:IRI; + sh:minCount 1 ; + sh:maxCount 1; + ] ; + sh:property [ + sh:path owl:restriction ; + sh:minCount 0 ; + ] ; + sh:property [ + sh:path owl:equivalentClass ; + sh:minCount 0 ; + ] ; + sh:property [ + sh:path rdfs:label ; + sh:minCount 0 ; + ] ; + sh:property [ + sh:path rdfs:comment ; + sh:minCount 0 ; + ] . + +# ex:MetadataEntryShape a sh:NodeShape ; +# sh:property [ +# sh:path "@graph" ; +# ] . + +ex:OwlRestrictionDefinitionShape a sh:NodeShape; + sh:targetClass owl:restriction ; + sh:closed true; + sh:ignoredProperties (rdf:type) ; + #owl:onProperty should reference a valid rdfs:Property + sh:property [ + sh:path owl:onProperty; + sh:maxCount 1; + sh:minCount 1; + sh:nodeKind sh:IRI; + sh:class rdfs:Property ; + ] ; + sh:property [ + sh:path owl:minCardinality ; + sh:minCount 0; + sh:maxCount 1; + sh:in (0 1); + ] ; + sh:property [ + sh:path owl:maxCardinality ; + sh:minCount 0; + sh:maxCount 1; + sh:in (0 1); + ] . + +ex:PropertyDefinitionShape a sh:NodeShape ; + sh:targetClass rdfs:Property ; + sh:closed true; + sh:ignoredProperties (rdf:type) ; + sh:property [ + sh:path rdfs:label ; + sh:nodeKind sh:Literal ; + sh:minCount 0 ; + ] ; + sh:property [ + sh:path rdfs:comment ; + sh:minCount 0 ; + ] ; + sh:property [ + sh:path owl:equivalentProperty ; + sh:minCount 0 ; + sh:nodeKind sh:IRI ; + ] ; + sh:property [ + sh:path schema:domainIncludes ; + sh:minCount 0 ; + #sh:nodeKind sh:IRI ; + #sh:type rdfs:Class ; + ]; + sh:property [ + sh:path schema:rangeIncludes ; + sh:minCount 0 ; + #sh:nodeKind sh:IRI ; + #The type of the range reference is either a literal type or a reference to another rdfs:Class + #sh:type [sh:in (xsd:string xsd:integer xsd:date xsd:dateTime)]; + ] . \ No newline at end of file