-
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
Redesign the ontology responder for better performance #252
Conversation
…ter performance (#185) (WIP).
@@ -2283,7 +2284,9 @@ | |||
|
|||
:resourceIcon "region.gif"^^xsd:string ; | |||
|
|||
:hasPermissions "V knora-base:UnknownUser,knora-base:KnownUser|M knora-base:ProjectMember" ; |
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.
This is the state I have on my test server for BEOL. What happens if someone creates a Region now? Will it have any permissions?
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.
No, it will have no permissions.
… changes - fix broken indices in browers tests - prevent hasStandoffLinkTo from being submitted on resource creation
I think this should be excluded since it is a generic property that has to be used via subproperties only. |
…by the ontology responder.
- Change SALSAH tests to refresh the ontology cache before running.
* feature (salsah): Start implementing rdfs:label as a pseudo-value. * feature (salsah): Add a special property for viewing and editing rdfs:label in different resource viewers. * feature (change a resource's label): add a route to change a resource's label - TODO: documentation and tests * feature (change a resource's label): add suppor in the GUI for changing a label - TODO: reset does not work properly yet. Editing is still active. * test (change a resource's label): add tests and documentation * fix (change a resource's label): clarify comments, improve SPARQL * fix (change a resource's label): indicate named graph in update query - remove resource class check from update query's where clause (because it is in the knora-base named graph) * enhancement (SPARQL update): check that resource is a subclass of kb:Resource - use GRAPH statement in DELETE and INSERT clauses instead of global WITH * fix (webapi): Fix default triplestore setting. * test: Fix broken test. * fix (salsah): Add support for creating a new resource with a label (WIP) * fix (webapi): Implement property predicate inheritance, which was missing from #252 and caused #263. * docs: Clarify rdfs:label in knora-base.tex. * refactor (webapi): Simplify property predicate inheritance. * style (webapi): Fix typo. * fix (salsah): Don't submit invalid JSON for an optional property that that user removed from the resource creation form (#179). * fix (salsah): Don't allow a region to be created in jquery.resadd.js. - Sort property definitions by guiorder in the API response describing a resource type. - Don't display an add button for knora-base:hasStandoffLinkto. - Try to display the label on a region (not working yet). * fix (salsah): Support knora-base:UriValue. * feature (salsah): Add support for boolean values. * test: Fix test data now that the ontology responder sorts properties by guiorder. * feature (salsah): Fix label and comment editing and display (#261 and #284) (in progress) - Display labels on regions. - If there is no comment on a value, return a JSON null in the API. - Add a route 'valuecomments' with an HTTP delete method for deleting a comment. * feature (webapi): Merge changes from #285 to support optional value comments. * docs: Update knora-base.rst. * fix (salah): Fix editing a comment after deleting it. - Fix value responder test of comment editing. - Add missing SALSAH icons. * fix (salsah): Don't allow the user to write a comment on a label. * test: Fix SALSAH resource creation test. * docs: Fix typescript interfaces to allow nulls. * fix (webapi): Return a value's comment when querying the value. - Add tests for creating and querying value comments.
This pull request implements a new loading and caching design in the ontology responder.
The old design was based on the assumption that resource and property definitions could be loaded and cached incrementally, and that since they were cached, they could be loaded via relatively complex (hence relatively slow) SPARQL queries. This proved to be too slow in the case where all definitions must be loaded and returned for a single API request (#185).
The new design loads and caches all ontology information when the application starts. It uses simple, fast SPARQL queries, and does the rest of the processing in Scala, e.g. to calculate cardinality inheritance in resource classes.
To make this work, the ontology responder needs to receive a
LoadOntologiesRequest
when the application starts.KnoraService
sends this message on startup, and I also changed each test spec to send it after the test data is loaded.Previously, the data in an
EntityInfoV1
was pre-filtered according to the user's preferred language and the system's default language. Now, anEntityInfoV1
contains all available translations, and the methodgetPredicateObject
can be used to filter by language.I fixed some bugs in
knora-base.ttl
:hasPermissions
was attached to some resource classes, but it is only for resource instances.knora-dc.ttl
as well as full definitions inknora-base.ttl
, but Knora assumes that each class is defined in only one ontology.I also fixed some incorrect test data.
Closes #185.