-
Notifications
You must be signed in to change notification settings - Fork 18
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
Validate ontologies loaded from the triplestore #806
Conversation
- drawings-gods:hasPersonLinkedFileComment should have knora-base:subjectClassConstraint drawings-gods:PersonLinkedFile - remove cardinality on undefined property: drawings-gods:ifIToldYouGodCouldYouDrawDoNotKnow - remove cardinality on undefined property: drawings-gods:otherLanguages3
@subotic Cool, that fixed it, thanks. :) |
you're welcome :-) |
- Regenerate drawings-gods_ontology.ttl.
@loicjaouen @mrivoal The ontology verification introduced in this PR found some problems in
Please check whether these fixes are correct. Also, in this PR I've upgraded the RDF4J Turtle library to 2.3.0, so the output of |
@tobiasschweizer @SepidehAlassi The ontology verification introduced in this PR found a typo in |
…going). - Downgrade RDF4J SPARQL parser because of eclipse-rdf4j/rdf4j#1014
Great job! Thanks for fixing this! |
Dear dhlab, As you know, we have quite a bit of ontologies already here: https://github.com/nie-ine/Ontologies/tree/master/nie-ontologies Also, we wonder which goals the restrictions have, are the changes written to improve the performance or for another reason? Thank you so much for your answer. |
Yes, that's the intention.
The goal is to prevent errors. None of these restrictions are new. I think all of them are already described in the http://www.knora.org/documentation/manual/rst/02-knora-ontologies/knora-base.html Please read that document if you haven't already. If a project-specific ontology doesn't conform to the requirements of Currently it's possible to violate some of these restrictions without getting an error message, but you will get unexpected results. The purpose of this PR is to have all such violations cause error messages on startup. |
ok, thank you for this clarification, I did not realise that there are no new restrictions in this pr. |
I’ll double-check the docs and document any restrictions that weren’t documented before. |
# Conflicts: # webapi/_test_data/other.v1.DrawingsGodsV1Spec/drawings-gods_ontology.ttl # webapi/src/main/scala/org/knora/webapi/KnoraService.scala
@benjamingeer, yes, your changes to |
@benjamingeer wow, I am impressed! |
…link value properties.
- Update docs. - Update release notes.
@subotic I'll be on holiday next week, so there's no need to hurry to review this. :) |
knora-ontologies/knora-admin.ttl
Outdated
@@ -264,8 +266,6 @@ | |||
|
|||
rdfs:comment "A description of a user group"@en ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'A description of an institution'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are fast :-)
|
||
loadTestData(invalidOnto) | ||
|
||
expectMsgPF(timeout) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a tip, you could write
expectMsgPF(timeout) {
case msg: akka.actor.Status.Failure => msg.cause.isInstanceOf[InconsistentTriplestoreDataException] should ===(true)
}
as
expectMsgType[akka.actor.Status.Failure](timeout).cause should be (true)
expectMsgPF
is useful when you expect more than one message type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll do that next time. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test, that loads an ontology with a missing knora-base:attachedToProject
?
Good idea, I'll add one now. |
Thanks :-) |
… it has knora-base:attachedtToProject.
Thanks for the review! It's a relief to finally see this done. |
Thanks for doing it :-) It's a huge thing. |
* develop: feature (webapi): make project shortcode required (#824) doc (webapi): jekyll / paradox based documentation website (#751) Validate ontologies loaded from the triplestore (#806) fix (webapi): add searchbox gui element to hasOtherSomething property (#828) feature (webapi): allow loading data into graphdb on windows (internal PR) (#814) build (webapi): add missing library (#822) feature (webapi): allow changing of user’s password by system admin (#815) feature (webapi): OpenAPI / Swagger API documentation generation (#812)
* develop: feature (webapi): make project shortcode required (#824) doc (webapi): jekyll / paradox based documentation website (#751) Validate ontologies loaded from the triplestore (#806) fix (webapi): add searchbox gui element to hasOtherSomething property (#828) feature (webapi): allow loading data into graphdb on windows (internal PR) (#814) build (webapi): add missing library (#822) feature (webapi): allow changing of user’s password by system admin (#815) feature (webapi): OpenAPI / Swagger API documentation generation (#812)
Checks on classes
If a class is defined in a project-specific ontology:
knora-base:Value
).knora-base:hasValue
orknora-base:hasLinkTo
), and all its base classes with Knora IRIs must also be resource classes. A cardinality onknora-base:resourceProperty
orknora-base:hasValue
is forbidden. It must also have anrdfs:label
.Checks on properties
owl:Class
, orowl:Restriction
, and must be a subclass of the subject class constraints of all its base properties.rdfs:label
.If a property is defined in a project-specific ontology:
If a property is defined in a project-specific ontology and is a Knora resource property:
knora-base:hasValue
andknora-base:hasLinkTo
.knora-base:hasFileValue
.Other checks
salsah-gui:guiOrder
is allowed in anowl:Restriction
, not in a property definition.salsah-gui:guiElement
andsalsah-gui:guiAttribute
are allowed in a property definition, not in anowl:Restriction
.Other tasks
knora-api:projectIri
, useknora-api:attachedToProject
instead.Resolves #778.