-
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 graph view and graph query #269
Comments
Since the permission checking has to be done in Scala, it will need to work on an in-memory representation of the graph. This looks doable using Graph for Scala. After getting the SPARQL query results, we can remove any nodes that the user doesn't have permission to see, as well as any edges containing those nodes, and any edges whose link values the user doesn't have permission to see. To remove nodes that were only reachable via removed nodes, we can generate a new graph containing only what's still reachable from the initial node, like this:
Since two nodes can be connected by more than one edge, we'll need a multigraph with keyed edges. |
Since arbor.js hasn't been updated in 5 years, I'm looking for something else. These libraries look good and well-maintained: d3Uses SVG. Examples:
CytoscapeUses canvas. Example: http://js.cytoscape.org/demos/2ebdc40f1c2540de6cf0/ I didn't find a good WebGL option. My inclination is to try D3. |
I spent some time trying to get d3 to work, but it's difficult because most of the graph examples I found use d3 version 3, but now there's d3 version 4 and it's very different. I'm going to try Cytoscape, which looks easier because it's specifically for graphs. |
Cytoscape seems to work, now I just need to integrate it into SALSAH. |
The good news:
The bad news:
Options:
|
I've rewritten it using simple recursive SPARQL queries. Performance seems OK, and it works on Fuseki as well as GraphDB. |
This concerns the API operation to get a graph of resources that are reachable from a certain resource. It has these requirements:
knora-base:hasLinkTo
.knora-base:isPartOf
.The last time we tried to do this, we attempted to implement exactly what the old API did, but we didn't find a good SPARQL design. Also, it was difficult to make it efficient, because the old API provides an excessive amount of data, including all the properties of every node in the graph.
Thanks to Damyan Ognyanov at Ontotext, we have a proof-of-concept of a better SPARQL design (using a CONSTRUCT query with nested OPTIONAL blocks up to the requested maximum depth). It looks like we can get all the necessary data in one SPARQL query.
@lrosenth and I talked this over, and we're going to redesign the API operation, do a new design in the Knora API server, and change the implementation in the SALSAH GUI accordingly.
To deal with both large and small graphs, the GUI could support two ways of displaying the graph:
The API operation will return the minimum information needed to draw the graph, which is probably just the adjacency list, along with the label of each node and each edge, and the label of each node's resource class.
cc @milchkannen
The text was updated successfully, but these errors were encountered: