Skip to content

A SHACL OWL "profile" to aid ontologies mixing SHACL and OWL #246

Open
@ajnelson-nist

Description

@ajnelson-nist

I'm posting this mindful of the scope of the current SHACL working group not including other modeling languages. I am hopeful that this stays within bounds for a modeling language that has already had some concepts used by SHACL, OWL 2, specifically for owl:Ontology, and incidentally owl:imports.

Summary: This is a request to add a graph as a resource in the SHACL suite for the benefit of ontologies that want to use SHACL, AND be conformant to OWL 2 DL (or other profile), and not fall into OWL 2 FULL.

There are ontologies that use a mixture of SHACL and OWL for the two languages' non-overlapping features. There is some roundabout compatibility support for OWL class modeling with SHACL, such as in SHACL 1.0's Section 2.1.3.3 definition of implicit class targets and SHACL Class's positional description that lets owl:Class substitute straightforwardly for rdfs:Class.

However, usage of SHACL in an OWL ontology currently does not satisfy OWL 2 DL rules, without a little extra work left to the implementing ontologists. Syntactically, there is a requirement that can be elided from "skipping ahead" in the OWL specs to OWL 2 Web Ontology Language Mapping to RDF Graphs (Second Edition), that:

  • Whenever o is the object in a triple s rdf:type o, o needs to be an instance of owl:Class (or owl:Restriction and other reserved OWL IRIs, but they're beside the point for this issue).
  • Whenever p is the predicate in a triple s p o, p must be exactly one of owl:ObjectProperty, owl:DatatypeProperty, or owl:AnnotationProperty.

SHACL and SHACL-SHACL are currently defined primarily with RDFS concepts. Every class and property are rdfs:Class and rdf:Property. The SHACL 1.0 implementation includes the triple sh: a owl:Ontology ., so in a sense, a toe is already dipped into the OWL waters.

The issue is, if an ontology is using SHACL and OWL, the ontology will not be conformant to OWL 2 DL unless it takes the extra step of assigning OWL modeling concepts to every concept in SHACL used in the ontology. E.g., if sh:declares is used, it needs to be defined as an owl:ObjectProperty or owl:AnnotationProperty. I think there is no reason to leave every SHACL-and-OWL adopter the task of adding these statements, especially if there is any pondering they might do on whether every property should be an owl:AnnotationProperty or not.

For the benefit of ontologies mixing OWL and SHACL, can a graph be provided that:

  • For each class in SHACL, asserts it is an owl:Class;
  • For each property in SHACL, asserts it is an owl:AnnotationProperty.

From my experience with OWL 2 DL conformance testing, I believe this would be sufficient to enable OWL 2 DL conformance testing with SHACL concepts not being an impediment.

If anyone wants to dig into the reasoning for global assignment of owl:AnnotationProperty - again, being mindful of scoping of working group activities - this is to:

  • Allow the freedom to let SHACL properties have ranges of literals or non-literal nodes without OWL concerns, and
  • Implicitly separate SHACL modeling from OWL modeling involving owl:Restrictions (c/o the reminder that owl:AnnotationPropertys cannot be restricted - see all occurrences of owl:onProperty in the OWL-RDF mapping I cited above, and note "AP" for "Annotation Property" never occurs).

I suggest this graph file be standalone, and not use owl:imports to bring in anything (including the core SHACL spec graph). The new graph should be able to be owl:imports-able by itself.

This graph can be typed up in about 10 minutes with a plain text editor, and I believe would be straightforward to maintain with the evolving SHACL 1.2 and beyond specifications with a mutual coverage checking script. The harder question for the group is the decision to provide this.

Somewhat related issues I can recall offhand:

Metadata

Metadata

Assignees

No one assigned

    Labels

    UCRUse Cases and RequirementsVocabulariesFor issues with the RDF files that the WG maintains

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions