-
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
Include guiElement and guiAttribute in API v2 #755
Conversation
…es method into several methods.
…n ontologies from the triplestore (ongoing)
…asel/Knora into wip/update-salsah-gui-attributes
…to transform them later.
…ute when serving ontologies in API v2 in the default schema.
# Conflicts: # webapi/src/test/resources/test-data/ontologyR2RV2/allOntologyMetadata.json
# Conflicts: # webapi/src/main/scala/org/knora/webapi/messages/store/triplestoremessages/TriplestoreMessages.scala # webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala
…lement and salsah-gui:guiAttribute.
…asel/Knora into wip/update-salsah-gui-attributes
@tobiasschweizer this PR removes |
Could you please check if that requires changes in the SALSAH 2 GUI? |
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.
did you maybe run the Salsah 1 tests?
this PR requires dhlab-basel/Salsah#190 to merged too |
Good catch! Had to fix a bug for that. They pass now. |
great, thanks :-) |
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.
LGTM. thanks :-)
Some general thoughts about the release notes. Maybe we should add something like a migration guide. There we could move the stuff from |
@subotic Thanks! A migration guide sounds like a good idea to me. |
@benjamingeer just a question: didn't you say that you would would come with a script to make existing ontologies comply with the new requirements of |
Ok, I have just been explained by @loicjaouen and @gfoo where I should look for this information. Just ignore my question/comment. |
@mrivoal Existing ontologies should not be affected by this PR; it just affects the way ontologies are represented in API v2. |
Sorry. I mixed up this issue with #737, which requires us to update our existing ontologies according to v.1.2.0 Release Notes. |
@mrivoal No worries! |
OntologyResponderV2
to support serving built-in ontologies likesalsah-gui
from the triplestore, including OWL named individuals.salsah-gui
so that GraphDB's consistency checker can check the use ofguiElement
andguiAttribute
.salsah-gui
ontology in API v2 in the default schema.hasOntologies
format, eliminatinghasStandoffClasses
andhasStandoffProperties
.salsah-gui:guiElement
andsalsah-gui:guiAttribute
when serving ontologies in API v2 in the default schema.salsah-gui:guiElement
andsalsah-gui:guiAttribute
to be included in new property definitions created via API v2.The existing design of ontology loading and caching in
OntologyResponderV2
was made for API v1, which only needed to serve project-specific ontologies. It was based on several different SPARQL SELECT queries for different sorts of entities. These queries knew quite a lot about the structure of Knora ontologies. Only certain kinds of entities and cardinalities were loaded and cached, and the rest of the code relied on that. Now that we have to serve classes likesalsah-gui:Guielement
and properties likesalsah-gui:guiAttribute
, that’s no longer workable. Rather than add more SELECT queries and special cases, it seems better to redesign the whole thing.The revised design in this PR is based on a CONSTRUCT query that just reads all statements from each ontology graph. This makes the code simpler and probably easier to read. All entities are then processed in the same way into
Content
objects. As a result, code using these objects must now assume that everything that’s in the ontologies in the triplestore is also in the ontology cache. TheContent
objects are then wrapped inRead
objects, which have more knowledge about the different types of Knora entities and how to represent them in the API.Also, I've restructured the cache so each ontology, including
knora-base
, is now stored in aReadOntologyV2
object. This should make it easier to do #762.As an extra bonus, IntelliJ IDEA no longer uses 100% CPU when you work on
OntologyResponderV2
.Resolves #746.
Resolves #760.