-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 571: Reduce UCO OWL RDF List review scope to OWL Sequences #572
Conversation
When testing CASE-Corpora, I found an error in an OWL assertion I'd written: dcat:Dataset
rdfs:comment "Within CASE-Corpora, the property hasDatasetDirectory is a unique identifier for a Dataset."@en ;
owl:hasKey case-corpora:hasDatasetDirectory ;
. This turns out to be incorrect. The SHACL validation report from state a65ebe9 (brought in via the @prefix case-corpora: <http://example.org/ontology/case-corpora/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix uco-owl: <https://ontology.unifiedcyberontology.org/owl/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
[] a sh:ValidationReport ;
sh:conforms false ;
sh:result [ a sh:ValidationResult ;
sh:detail [ a sh:ValidationResult ;
sh:focusNode case-corpora:hasDatasetDirectory ;
sh:resultMessage "Node case-corpora:hasDatasetDirectory does not conform to exactly one shape in [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] , [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:path [ sh:oneOrMorePath rdf:rest ] ; sh:xone ( [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:maxCount Literal(\"1\", datatype=xsd:integer) ; sh:minCount Literal(\"1\", datatype=xsd:integer) ; sh:path rdf:first ] ] ) ] ]" ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:XoneConstraintComponent ;
sh:sourceShape uco-owl:Sequence-shape ;
sh:value case-corpora:hasDatasetDirectory ] ;
sh:focusNode case-corpora:hasDatasetDirectory ;
sh:resultMessage "Value does not conform to Shape uco-owl:Sequence-shape. See details for more information." ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
sh:sourceShape uco-owl:hasKey-objects-shape ;
sh:value case-corpora:hasDatasetDirectory ] . It is a bit obscuring for the |
I think it will be a better user experience to spell the shapes for each sequence-valued property like this instead: # Replace this ...
uco-owl:hasKey-objects-shape
a sh:NodeShape ;
sh:node uco-owl:Sequence-shape ;
sh:targetObjectsOf owl:hasKey ;
.
# ... with this:
uco-owl:hasKey-subjects-shape
a sh:NodeShape ;
sh:property [
a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:hasKey ;
] ;
sh:targetSubjectsOf owl:hasKey ;
. Here is how that same validation report on the incorrect @prefix case-corpora: <http://example.org/ontology/case-corpora/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix uco-owl: <https://ontology.unifiedcyberontology.org/owl/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
[] a sh:ValidationReport ;
sh:conforms false ;
sh:result [ a sh:ValidationResult ;
sh:detail [ a sh:ValidationResult ;
sh:focusNode case-corpora:hasDatasetDirectory ;
sh:resultMessage "Node case-corpora:hasDatasetDirectory does not conform to exactly one shape in [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] , [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:path [ sh:oneOrMorePath rdf:rest ] ; sh:xone ( [ rdf:type sh:NodeShape ; sh:hasValue rdf:nil ] [ rdf:type sh:NodeShape ; sh:nodeKind sh:BlankNode ; sh:property [ rdf:type sh:PropertyShape ; sh:maxCount Literal(\"1\", datatype=xsd:integer) ; sh:minCount Literal(\"1\", datatype=xsd:integer) ; sh:path rdf:first ] ] ) ] ]" ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:XoneConstraintComponent ;
sh:sourceShape uco-owl:Sequence-shape ;
sh:value case-corpora:hasDatasetDirectory ] ;
sh:focusNode dcat:Dataset ;
sh:resultMessage "Value does not conform to Shape uco-owl:Sequence-shape. See details for more information." ;
sh:resultPath owl:hasKey ;
sh:resultSeverity sh:Violation ;
sh:sourceConstraintComponent sh:NodeConstraintComponent ;
sh:sourceShape [ a sh:PropertyShape ;
sh:node uco-owl:Sequence-shape ;
sh:path owl:hasKey ] ;
sh:value case-corpora:hasDatasetDirectory ] . The whole flagged triple can now be found with |
Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
This causes `ValidationResult`s to yield sufficient information to find the whole triple that should have used a sequence. With the prior spelling, only the object of the triple would have been directly identified; the predicate could be manually deduced from the shape name; and the subject was completely absent from the validation result. The noted comment on PR 572 illustrates the difference in results when testing CASE-Corpora. The issue is replicated as new PASS and XFAIL test members. A follow-on patch will regenerate Make-managed files. References: * #571 * #572 (comment) Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
References: * #571 * #572 (comment) Signed-off-by: Alex Nelson <alexander.nelson@nist.gov>
This Pull Request resolves all requirements of Issue #571 .
Coordination
develop
unstable
branch (c5eba72
)unstable
branch tracking UCO'sunstable
as submodule (ce25a0b
)