Skip to content
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

Add skeletal definitions of SKOS and SHACL terms used in gist in order to achieve DL-compliance #934

Closed
rjyounes opened this issue Jul 26, 2023 · 9 comments · Fixed by #1027
Assignees

Comments

@rjyounes
Copy link
Collaborator

rjyounes commented Jul 26, 2023

gist is not DL-compliant because it uses undeclared terms in the SHACL and SKOS namespaces. Add skeletal definitions (à la Protégé) to achieve DL compliance.

@rjyounes
Copy link
Collaborator Author

rjyounes commented Jul 26, 2023

need to remove this from the pre-commit hook:

function remove_skos_decls () {
  for fileToBeCommitted in $(git diff --cached --name-only) ; do
    permissions=$(stat -c "%a" "${fileToBeCommitted}")
    sed -e '/^skos/,+3d' "$fileToBeCommitted" > tmp$$
    mv tmp$$ "$fileToBeCommitted"
    chmod $permissions "${fileToBeCommitted}"
    git add --update "${fileToBeCommitted}"
  done

  return 0
}

This has now already been done - see issue #1010.

@dylan-sa
Copy link
Contributor

dylan-sa commented Jul 27, 2023

I like the idea of adding skeletal definitions to be DL-compatible, but it's worth thinking more about where the defs should come from and what they should look like. As @marksem has pointed out, Protege automatically generates the following definitions for gist:

#################################################################
#    Annotation properties
#################################################################
###  http://www.w3.org/2004/02/skos/core#definition
skos:definition rdf:type owl:AnnotationProperty .

###  http://www.w3.org/2004/02/skos/core#example
skos:example rdf:type owl:AnnotationProperty .

###  http://www.w3.org/2004/02/skos/core#prefLabel
skos:prefLabel rdf:type owl:AnnotationProperty .

###  http://www.w3.org/2004/02/skos/core#scopeNote
skos:scopeNote rdf:type owl:AnnotationProperty .

###  http://www.w3.org/ns/shacl#declare
sh:declare rdf:type owl:AnnotationProperty .

###  http://www.w3.org/ns/shacl#namespace
sh:namespace rdf:type owl:AnnotationProperty .

###  http://www.w3.org/ns/shacl#prefix
sh:prefix rdf:type owl:AnnotationProperty .

With these definitions added, gist does become DL-compatible. One worry though is that these automatically generated defs could go against the spirit of the definitions in the concepts' "home" ontologies. sh:declare, for instance, has a domain and range in the SHACL ontology, which suggests that it is not really intended to be an annotation property. Same for sh:namespace and sh:prefix.

@rjyounes
Copy link
Collaborator Author

DECISION:

  • Move SHACL to gistPrefixDeclarations ontology, with a note to users that if they load it, they will go outside OWL DL

  • Add SKOS stubs - the ones we use

  • Changes to make:

    • Pre-commit hook - remove function that removes SKOS stubs
    • gistCore - move SHACL to gistPrefixDeclarations
    • Add stub SKOS annotations to gistCore
    • Don't need to add SKOS stubs to gistPrefixDeclarations because it's already non-DL compliant
    • Documentation:
      • Add a note in the README to users that gist is OWL DL-compliant, and if they load the SHACL PrefixDeclarations, they will go outside OWL DL
      • Add a note on the website gist is DL-compliant, which makes it easier for you to remain DL compliant

@uscholdm
Copy link
Contributor

@dylan-sa

sh:declare, for instance, has a domain and range in the SHACL ontology, which suggests that it is not really intended to be an annotation property. Same for sh:namespace and sh:prefix.

I wondered about this so I looked it up in the spec: https://www.w3.org/TR/owl2-syntax/#Annotations
It turns out that annotation properties do have domains and ranges. Scroll down to figure 23. This may be moot, as we decided to move the shacl out - but a handy factoid to have in your back pocket.

@dylan-sa
Copy link
Contributor

dylan-sa commented Jul 27, 2023

Thanks, @uscholdm -- glad you pointed this out. I had based my original comment on an older doc, which stated: "Annotation properties must not be used in property axioms. Thus, in OWL DL one cannot define subproperties or domain/range constraints for annotation properties." Looks like this sentiment must have shifted w/ OWL 2, as figure 23 clearly shows that it's possible to define domains and ranges for annotation properties (even if they won't figure into reasoning).

Edit: Maybe there wasn't a shift in sentiment. Could be that they've always been allowed in OWL full, just not in DL? Anyways, suppose it's moot as you say. 🙂

@rjyounes
Copy link
Collaborator Author

Plus, they have no semantic weight since the reasoner doesn't run on annotation properties. Note:

OWL 2 provides means to state several types of axioms about annotation properties, as shown in Figure 23. These statements are treated as axioms only in order to simplify the structural specification of OWL 2.

I interpret this to mean (though it's just a hypothesis) that the structural specification is simplified by allowing the same axioms on annotation properties that are allowed on other OWL properties.

@uscholdm
Copy link
Contributor

Plus, they have no semantic weight since the reasoner doesn't run on annotation properties.

It's true that the OWL spec says nothing about how the inference engines should behave in the presence of axioms using annotation properties. That is usually taken to mean that inference engines ignore them - but that does not follow. What it really means is that an inference engine MAY ignore annotation property axioms and still be in spec.

In fact, some of the DL reasoners will draw the inferences you would expect -e.g. if you use an annotation property in a restriction. Pete Rivett pointed this out to me years ago. I was startled.

@rjyounes
Copy link
Collaborator Author

rjyounes commented Nov 6, 2023

Move SHACL to gistPrefixDeclarations ontology, with a note to users that if they load it, they will go outside OWL DL

I've forgotten why we made this decision, and it seems decidedly odd. Why are we willing to distribute an ontology that's not DL-compliant? Would it be better to eliminate the file?

@rjyounes
Copy link
Collaborator Author

Note: the removal of the function from the pre-commit hook has been done as part of issue #1010.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants