-
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
Graph data API operation #267
Conversation
- Filter out deleted nodes. - Return permissions and other info on resources and LinkValues.
# Conflicts: # webapi/WebapiBuild.sbt # webapi/scripts/graphdb-se-knora-test-load-data.ttl
# Conflicts: # webapi/src/main/scala/org/knora/webapi/util/TransformData.scala
I have a problem regarding permissions. I wanted to open http://localhost:3333/v1/graphdata/http%3A%2F%2Fdata.knora.org%2Fa-thing-with-text-values in graph view, but did not see any results. I am logged in as These two API requests give me all information about the resources (including the links): But the request to graph view gives me an empty result
|
Do you plan to include the resources' properties (besides linking properties) as well? In the old graph view, we had the option to expand a resource's properties to get more information about the instance. |
@@ -20,7 +20,7 @@ | |||
knora-base:isDeleted false ; | |||
knora-base:attachedToUser <http://data.knora.org/users/9XBCrDV3SRa7kS1WwynB4Q> ; | |||
knora-base:attachedToProject <http://data.knora.org/projects/anything> ; | |||
rdfs:label "Ein Ding für wen, der die Dinge liebe" ; | |||
rdfs:label "Ein Ding für wen, dem die Dinge gefallen" ; |
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.
für jemanden, dem
the new generation of triplestores will do a grammar check and randomly reject transactions if the found a violation of German grammar
Lukas and I decided not to do this, for better performance. We can add some JavaScript that opens the resource viewer if you click on a node. |
This is because I forgot that link values for standoff links don't have permissions. Fixed. I also noticed that if you query a node that has no links, you get an empty graph. Fixed this too. Added tests for both cases. |
Ok, the query for http://localhost:3333/v1/graphdata/http%3A%2F%2Fdata.knora.org%2Fa-thing-with-text-values works now. I encounter a strange behavior when opening some resources of type For example in the case of "excluded alpha": Could this be caused by a change in Another thing that attracted my attention is the mouse wheel event in the graph view. I would expect it to make the graph scale but instead it flickers. |
# Conflicts: # webapi/src/main/scala/org/knora/webapi/KnoraService.scala
|
||
QueryResultEdge( | ||
linkValueIri = rowMap("linkValue"), | ||
sourceNodeIri = if (outbound) startNode.nodeIri else nodeIri, |
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.
Could you add a comment here explaining why the Iris are swapped depending on the state of outbound (outgoing or incoming links)?
I opened another issue for the |
* develop: Improve configuration for more concurrent requests (#338) Upgrade to Scala 2.12 (#343) Fix various inconsistencies in knora-base.ttl and docs. (#330) Fix language switching and login/logout in SALSAH (#331) Graph data API operation (#267) Allow connections over HTTPS (#332) Update README.md Add link to GraphDB. fix (salsah): Add missing JavaScript “var”. fix (webapi): Fix RouteUtilV1 so it returns HTML instead of JSON when requested (#326) Ontology and documentation fixes. (#325) fix (salsah): Create multiple links in a resource, and other bug fixes (#315) feature (webapi): Make TransformData fix “test” labels on regions. (#311) Fixes for subclasses and subproperties (#303) Add script to update docs on knora.org (#300) docs: Make trivial change for testing purposes. fix (webapi): CORS problems (#307) Use inference to optimise searches on GraphDB (#301)
This implements the API operation
/v1/graphdata/
, which returns a graph of resources that are reachable from a certain resource.?depth
query parameter, currently not used in the SALSAH GUI, so it defaults to a depth of 4).knora-base:hasLinkTo
, except:knora-base:isPartOf
resource R2, no link from R1 to R2 is included in the graph.The old SALSAH GUI used arbor.js to render the graph in JavaScript. Since that library hasn't been updated in 5 years, I've replaced it with the better-maintained and easier-to-use Cytoscape library.
After much experimentation with different SPARQL query designs (see #269), this implementation uses simple recursive SPARQL queries. I haven't tested it with a huge graph, but performance seems OK for graphs that aren't very big. To improve performance, it doesn't return resource properties (as the old SALSAH did). RDFS inference is also used on GraphDB for better performance.
I also did a little refactoring so the responders no longer decide whether to use inference, in the interest of simplifying the responders. Since not every triplestore offers this choice on a per-query basis, I think it's better to assume that either the repository was created with inference enabled or it wasn't. So now the store package enables inference only with GraphDB, and it's up to the templates to disable it if they don't want it (which they currently do anyway).
Closes #269.