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

Improve validation of ontologies created outside API v2 #778

Closed
benjamingeer opened this issue Mar 13, 2018 · 0 comments
Closed

Improve validation of ontologies created outside API v2 #778

benjamingeer opened this issue Mar 13, 2018 · 0 comments
Assignees
Labels
enhancement improve existing code or new feature
Milestone

Comments

@benjamingeer
Copy link

The resolution of #286 was that we would focus on validating ontologies created via API v2. But there is also interest in better validation of ontologies created outside the API and loaded when Knora starts: #773. I think it shouldn't be difficult to refactor OntologyResponderV2 somewhat to do the following after loading all ontologies:

  • Check that all classes defined in project-specific ontologies are subclasses of knora-base:Resource. (Should it be possible for projects to define other sorts of classes? If so, perhaps there should be a requirement that such classes have non-Knora IRIs.)
  • Check that all properties defined in project-specific ontologies are subproperties of knora-base:hasValue or knora-base:hasLinkTo, and are not subproperties of knora-base:hasFileValue. (Same question as above.)
  • Check that all cardinalities directly defined on subclasses of knora-base:Resource are for subproperties of knora-base:hasValue or knora-base:hasLinkTo.
  • Check that the subproperties of knora-base:hasValue and knora-base:hasLinkTo all have subject classes that are subclasses of knora-base:Resource.
  • Check that the subproperties of knora-base:hasValue have object classes that are subclasses of knora-base:Value.
  • Check that the subproperties of knora-base:hasLinkTo have object classes that are subclasses of knora-base:Resource.
  • Check that the objects of rdfs:subClassOf are subclasses of knora-base:Resource if they have Knora IRIs.
  • Check that the objects of rdfs:subPropertyOf are subclasses of knora-base:hasValue or knora-base:hasLinkTo if they have Knora IRIs.
  • Check that salsah-gui:guiOrder, salsah-gui:guiElement, and salsah-gui:guiAttribute appear in the correct places.

Other validations that we do when creating ontologies via the API, but might be more work to do in this context:

  • Check that the subject and object classes of a subproperty are subclasses of the ones referred to in all its base properties.
  • Check that the cardinalities in a subclass are at least as restrictive as the ones it overrides from its base classes.
@benjamingeer benjamingeer added the enhancement improve existing code or new feature label Mar 13, 2018
@benjamingeer benjamingeer added this to the v1.4.0 milestone Mar 13, 2018
@benjamingeer benjamingeer self-assigned this Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement improve existing code or new feature
Projects
None yet
Development

No branches or pull requests

1 participant