Difference between revisions of "SimpleGraph"
Jump to navigation
Jump to search
| Line 3: | Line 3: | ||
= FileSystem example = | = FileSystem example = | ||
The graph below shows the source code structure for the SimpleGraph project. | The graph below shows the source code structure for the SimpleGraph project. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<graphviz> | <graphviz> | ||
digraph FileSystemGraph { | digraph FileSystemGraph { | ||
| Line 53: | Line 43: | ||
} | } | ||
</graphviz> | </graphviz> | ||
| + | == explanation == | ||
| + | === creating the graph === | ||
| + | This graph visualization has been produced with the following Java lines which make sure that the | ||
| + | "src" Directory can be handled as a gremlin graph: | ||
| + | <source lang='java'> | ||
| + | // create a new FileSystem acces supplying the result as a SimpleSystem API | ||
| + | SimpleSystem fs=new FileSystem(); | ||
| + | // connect to this system with no extra information (e.g. no credentials) and move to the "src" node | ||
| + | SimpleNode start = fs.connect("").moveTo("src"); | ||
| + | // do gremlin style out traversals recusively to any depth | ||
| + | start.recursiveOut("files",Integer.MAX_VALUE); | ||
| + | </source> | ||
| + | === converting the graph to graphviz === | ||
| + | The graph is now available and can be traversed to create a graphviz version of it. We use | ||
| + | the {{Rythm}} template engine to do so. Within Rythm you can use Java code. | ||
| + | |||
| + | |||
}} | }} | ||
| + | |||
[[Category:frontend]] | [[Category:frontend]] | ||
[[Category:SiGNaL]] | [[Category:SiGNaL]] | ||
Revision as of 16:11, 13 January 2018
SimpleGraph
SimpleGraph is an open source project that allows to wrap Systems APIs in a way that graph algorithms and storage can be applied. As an implementation Apache Gremlin/Tinkerpop is used.
FileSystem example
The graph below shows the source code structure for the SimpleGraph project.
The file "mwstore://local-backend/local-public/diagrams/archive/20251124004901!Diagrams_e41f63e992350a6812c4f7cd745f9deb.png" already exists.
explanation
creating the graph
This graph visualization has been produced with the following Java lines which make sure that the "src" Directory can be handled as a gremlin graph:
// create a new FileSystem acces supplying the result as a SimpleSystem API
SimpleSystem fs=new FileSystem();
// connect to this system with no extra information (e.g. no credentials) and move to the "src" node
SimpleNode start = fs.connect("").moveTo("src");
// do gremlin style out traversals recusively to any depth
start.recursiveOut("files",Integer.MAX_VALUE);
converting the graph to graphviz
The graph is now available and can be traversed to create a graphviz version of it. We use the Template:Rythm template engine to do so. Within Rythm you can use Java code.