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

provide metaclass export option #43

Closed
KonradHoeffner opened this issue Sep 8, 2023 · 1 comment
Closed

provide metaclass export option #43

KonradHoeffner opened this issue Sep 8, 2023 · 1 comment

Comments

@KonradHoeffner
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Ontologies often need validation checks for basic issues such as missing values, invalid references and cardinality violations.
The full power of a reasoner is often not needed and can also provide unintuitive messages.
For example, if you model a horse as having 4 legs, and you forget to model one, than a reasoner may tell you that your individual is not a horse, when the user expects to be told to add the missing leg.
SHACL shapes with validators such as PySHACL provide an easily automatable validation with messages that are intuitive to domain experts.
However SHACL shape target instances of classes, not subclasses of classes.

Describe the solution you'd like
As described at https://stackoverflow.com/questions/70756167/how-to-apply-shacl-to-subclasses-instead-of-instances and already successfully used in SNIK, metaclasses solve this problem.

So on top of this:

:Elefant rdf:type owl:Class;
 rdfs:subClassOf :Elephantidae.

:Elephantidae rdf:type owl:Class;
 rdfs:subClassOf :Animal.

You would add:

:Elefant rdf:type owl:Class;
 rdfs:subClassOf :Elephantidae.
 a :AnimalClass.

Where :AnimalClass is a meta class.
This allows one to immediately see without going through the whole hierarchy that :Elefant is an :Animal and crucially allows tools like PySHACL to function.
This also allows easier development and more resource-efficient tooling because SPARQL 1.1. property paths, which can be performance intensive, are not required to identify which subclass belongs to which core class.
I estimate this to be easy to implement in SMOG and could be gated behind a parameter.

Describe alternatives you've considered

  • I will investigate whether a metaclass could also be entered as a relation in the tabular source, which would then need to be repeated for each value.
  • Alternatively, PySHACL could add an ontology mode, but this will probably not be implemented.
@KonradHoeffner
Copy link
Contributor Author

Solved by #48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant