Add basic validator #55
Conversation
| :ProfileDisjointFromResourceDescriptorShape | ||
| a sh:NodeShape ; | ||
| sh:message "Instances of prof:Profile must not also be instances of prof:ResourceDescriptor." ; | ||
| sh:not | ||
| [ | ||
| sh:class prof:ResourceDescriptor ; | ||
| ] ; | ||
| sh:targetClass prof:Profile ; | ||
| . | ||
|
|
||
| :ResourceDescriptorDisjointFromProfileShape | ||
| a sh:NodeShape ; | ||
| sh:message "Instances of prof:ResourceDescriptor must not also be instances of prof:Profile." ; | ||
| sh:not | ||
| [ | ||
| sh:class prof:Profile ; | ||
| ] ; | ||
| sh:targetClass prof:ResourceDescriptor ; | ||
| . |
There was a problem hiding this comment.
Hi @nicholascar ,
As part of my work in the SHACL 1.2 Profiling Task Force, I've also tried writing a similar validator to this graph. So, I have some opportunity to compare results with you.
These two highlighted shapes surprised me. I would have written the same (modulo IRI) if I saw owl:disjointWith statements in the prof Turtle graph, but I don't see them in today's code-state:
Lines 141 to 145 in de5b96a
Lines 156 to 163 in de5b96a
So, if these shapes are to be added, shouldn't prof.ttl receive an update to declare the classes owl:disjointWith one another?
| sh:property | ||
| [ | ||
| sh:maxCount 1 ; | ||
| sh:message "Each prof:ResourceDescriptor must have exactly one prof:hasRole value." ; | ||
| sh:minCount 1 ; | ||
| sh:path prof:hasRole ; | ||
| sh:nodeKind sh:IRI ; | ||
| ] , | ||
| [ | ||
| sh:maxCount 1 ; | ||
| sh:message "Each prof:ResourceDescriptor must have exactly one prof:hasArtifact value." ; | ||
| sh:minCount 1 ; | ||
| sh:path prof:hasArtifact ; | ||
| ] ; |
There was a problem hiding this comment.
Similar to my discovery path on the above remark, I would have encoded this cardinality restraint if I had seen it in today's code-state of prof.ttl.
So, shouldn't prof.ttl also receive an update adding:
:ResourceDescriptor
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty prof:hasRole ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
] ;
rdfs:subClassOf [
a owl:Restriction ;
owl:onProperty prof:hasArtifact ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
] ;
.
Closes #54