ucoProject / UCO

This repository is for development of the Unified Cyber Ontology.
Apache License 2.0
73 stars 34 forks source link

Disjointedness already denoted in UCO should be enforced #586

Closed ajnelson-nist closed 2 weeks ago

ajnelson-nist commented 5 months ago

Disclaimer

Participation by NIST in the creation of the documentation of mentioned software is not intended to imply a recommendation or endorsement by the National Institute of Standards and Technology, nor is it intended to imply that any specific software is necessarily the best available for the purpose.

Background

UCO Issue 430 introduced core:UcoInherentCharacterizationThing, a top-level abstract class to denote some classes within UCO as disjoint with core:UcoObject. For instance, no object should be both a observable:File and observable:FileFacet. Introducing that class was the first use of OWL disjointedness in UCO. A few other uses of disjointedness are in UCO as well, found by scanning the ontology directory tree for the word "disjoint":

I specifically noticed core:UcoObject and core:UcoInherentCharacterizationThing when I was testing a new class under proposal (Qualities, in Issue 535) and how it interacts with the proposed endurant/perdurant divide (Issue 544). Details aside (they'll be discussed on at least the Qualities proposal), I'd ended up instantiating a node that was an eventual subclass of core:UcoObject and core:UcoInherentCharacterizationThing, and got no SHACL errors.

UCO should add new shapes, in the style of the current disjointedness-enforcement shapes, to enforce the expectations already encoded in its OWL. The reason for continuing the current disjointedness-enforcement shapes style is that those shapes are independent of the class IRI, and are singly devoted to use of sh:not, for the sake of controlling the SHACL violation message. (Message reporting doesn't quite work as would be desired from embedding sh:message in the node linked by sh:not.)

Requirements

Requirement 1

UCO must enforce the already-encoded disjointedness for core:UcoObject and core:UcoInherentCharacterizationThing.

Requirement 2

UCO must enforce the already-encoded disjointedness for types:Thread and co:List.

Risk / Benefit analysis

Benefits

Risks

Competencies demonstrated

Competency 1

The Quality class design that triggered this proposal basically followed this subclass structure, which came together across a few different test spaces:

drafting:Endurant
    rdfs:subClassOf uco-core:UcoOjbect ;
    .

drafting:Quality
    rdfs:subClassOf
        drafting:Endurant ,
        uco-core:UcoInherentCharacterizationThing
        ;
    .

Competency Question 1.1

Should this trigger a SHACL violation?

kb:Quality-328166c0-cc7d-4a96-9fd1-25eb3b7bf5b0
    a drafting:Quality ;
    .

Result 1.1

Yes.

Solution suggestion

Add the following shapes:


################################
# For core.ttl

core:UcoInherentCharacterizationThing-disjointWith-UcoObject-shape
    a sh:NodeShape ;
    sh:message "observable:UcoInherentCharacterizationThing and observable:UcoObject are disjoint classes.  Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
    sh:not [
        a sh:NodeShape ;
        sh:class core:UcoObject ;
    ] ;
    sh:severity sh:Warning ;
    sh:targetClass core:UcoInherentCharacterizationThing ;
    .

################################
# For types.ttl

types:Thread-disjointWith-co-List-shape
    a sh:NodeShape ;
    sh:message "types:Thread and co:List are disjoint classes.  Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
    sh:not [
        a sh:NodeShape ;
        sh:class co:List ;
    ] ;
    sh:severity sh:Warning ;
    sh:targetClass types:Thread ;
    .

types:ThreadItem-disjointWith-co-ListItem-shape
    a sh:NodeShape ;
    sh:message "types:ThreadItem and co:ListItem are disjoint classes.  Assigning both types to a single node will be an error in UCO 2.0.0."@en ;
    sh:not [
        a sh:NodeShape ;
        sh:class co:ListItem ;
    ] ;
    sh:severity sh:Warning ;
    sh:targetClass types:ThreadItem ;
    .

In UCO 2.0.0, remove the sh:severity and future-tense remarks in the sh:messages.

Coordination

ajnelson-nist commented 5 months ago

The Gist I mentioned in the Issue is here.