ucoProject / UCO

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

Confirm the use of a disjoint statement between `core:UcoObject` and `core:Facet` #378

Closed plbt5 closed 2 years ago

plbt5 commented 2 years ago

Background

The distinction between UcoObjects and Facets, and particularly its use in an ontological artefact, is insufficiently understood by, and creates confusion for, the community members. Any class that is defined in UCO (or CASE) cannot have both a core:UcoObject and a core:Facet in its superclass hierarchy, specified or inferenced alike.

Requirements

Requirement 1

Clarify the distinction between an ontological core:UcoObject and an ontological core:Facet, and how each of them are used appropriately. This requirement pertains to design documentation.

Requirement 2

Prevent incorrect use of the Facet and the UcoObject, particularly that inferencing might decide that a Class has both a Facet and a UcoObject in its supertype hierarchy. This requirement pertains to the ontology's inferencing capability

Risk / Benefit analysis

Benefits

Risks

The submitter is unaware of risks associated with this change

Competencies demonstrated

Competency 1

A community member wants to get informed about the distinction and use of core:UcoObject and of core:Facet.

Competency Question 1.1

Where can I find appropriate information about the distinction and use of core:UcoObject and of core:Facet?

Result 1.1

In the UCO Design Document

Competency 2

Specify a particular Class directly as a subclass of core:UcoObject and of core:Facet.

Competency Question 2.1

Is the ontology consistent?

Result 2.1

No

X-Ref matrix: Requirements - Competencies

Requirement 1 Requirement 2
Competency 1
Competency 2

Solution suggestion

Disjointness has to be explicitly stated for a reasoning system to make use of it. Therefore, add the triple:

to uco-core.

Coordination

ajnelson-nist commented 2 years ago

This nudges UCO into an interesting testing space. The owl:disjointWith statement is a commitment, but in the context of SHACL, means nothing quiet yet. It is meant to be verified by an OWL engine, and on finding an error case (an object that is both a UcoObject and Facet), the engine would likely return a result that "the ontology" is inconsistent, hopefully with an explanation of which non-inferred triples caused the inconsistency. "The ontology" could be a user's knowledge graph, containing an inconsistent individual.

With UCO's testing how happening with SHACL, what is a reasonable way to implement this consistency check?

The SPARQL test to detect violations of this disjointedness commitment in a user's knowledge graph would be:

SELECT $this
WHERE {
  $this a/rdfs:subClassOf* core:UcoObject .
  $this a/rdfs:subClassOf* core:Facet .
}

The test to detect violations "upstream" of instance data (i.e. something UCO could include in its unit testing) would be:

SELECT $this
WHERE {
  $this rdfs:subClassOf* core:Facet .
  $this rdfs:subClassOf* core:UcoObject .
}

Either of these could be added to a sh:NodeShape using a SHACL-SPARQL rule. (Here is an example. One thing that tripped me up initially - the SELECT query returns all non-conformant nodes, not all conformant nodes.)

These could be significantly compute-expensive tests to incorporate into the ontology. However, with some judicious use of sh:deactivated we might be able to leave it in the ontology, and let users opt in by deleting the sh:deactivated triple.

sbarnum commented 2 years ago

I am a little confused by the issue in question here. There is no core:Object class in UCO. Is the use of "core:Object" here intended to actually be referencing core:UcoObject? core:UcoObject and core:Facet are definitely intended to be disjoint. Subclasses of Facet are only ever used as instances of the core:hasFacet property which only exists on subclasses of core:UcoObject. I believe that this is fairly clearly explained in Section 3 of the UCO design document (https://unifiedcyberontology.org/resources/uco_design_document.html) that characterizes the concept and use of Objects. This paragraph from Section 3 of the UCO design document seems to be highly relevant here:

In the UCO RDFS/OWL/SHACL ontology, classes are defined for any relevant domain concept as well as for any structured concept characterizing some aspect of a domain concept. Domain concept classes (e.g., File, Action, Identity, Location, Device, etc.) are defined as subclasses of the UcoObject class while structured concept classes characterizing some aspect of a domain concept are considered part of the domain concept and thus are not. A subset of some structured concept classes characterizing some aspect of a domain concept are defined as facet classes as described in #5 below.

ajnelson-nist commented 2 years ago

core:Object should be core:UcoObject. I'll fix that now.

ajnelson-nist commented 2 years ago

@sbarnum I think I've gotten the changes. Apologies for missing that.

plbt5 commented 2 years ago

Indeed Sean, it should have been "core:UcoObject". This is my bad. Paul

On 17 May 2022, at 05:56, Sean Barnum @.***> wrote:

I am a little confused by the issue in question here. There is no core:Object class in UCO. Is the use of "core:Object" here intended to actually be referencing core:UcoObject? core:UcoObject and core:Facet are definitely intended to be disjoint. Subclasses of Facet are only ever used as instances of the core:hasFacet property which only exists on subclasses of core:UcoObject. I believe that this is fairly clearly explained in Section 3 of the UCO design document (https://unifiedcyberontology.org/resources/uco_design_document.html https://unifiedcyberontology.org/resources/uco_design_document.html) that characterizes the concept and use of Objects. This paragraph from Section 3 of the UCO design document seems to be highly relevant here:

In the UCO RDFS/OWL/SHACL ontology, classes are defined for any relevant domain concept as well as for any structured concept characterizing some aspect of a domain concept. Domain concept classes (e.g., File, Action, Identity, Location, Device, etc.) are defined as subclasses of the UcoObject class while structured concept classes characterizing some aspect of a domain concept are considered part of the domain concept and thus are not. A subset of some structured concept classes characterizing some aspect of a domain concept are defined as facet classes as described in #5 https://github.com/ucoProject/UCO/issues/5 below.

— Reply to this email directly, view it on GitHub https://github.com/ucoProject/UCO/issues/378#issuecomment-1128380883, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAWGQKZFHEU33EH5R7OLLTVKMKGXANCNFSM5VZKVJIA. You are receiving this because you authored the thread.

ajnelson-nist commented 2 years ago

@plbt5 : One point of feedback on the posted solution: The PR includes no SHACL shape or unit test to enforce this disjointedness.

Are we content with leaving SHACL enforcement out of the solution of this proposal? I am ~30% in favor of that omission, because I suspect (but have not tested) that it would be a significantly expensive SHACL-SPARQL based test.

plbt5 commented 2 years ago

@ajnelson-nist: The purpose of upfront testing is to make sure that one's data fit the ontology, and this is mostly to assure data validity and improve overall performance, maybe clarity of faults. The test process performance for a SHACL-shape to assure disjointness is proportional to the number of triples to check, i.e., the size of the data. Therefore, you don't win w.r.t. the performance of the reasoner. Regarding clarity, I'm pretty sure that the reasoner will report with a clear reference to where the disjointness occurs.

In conclusion, what would we win with writing weary WACL wishes?

ajnelson-nist commented 2 years ago

PR 385 has passed its review checklist.