Reports

Download

Community

Source

Getting Started

To use Filament core library, you will need to make sure that the core.jar is in your classpath along with its dependencies. The easiest way to do this is to use a build tool like Gradle or Maven and add the appropriate dependencies. (See here for details.)

Filament Core currently depends on the following external artifacts (in Gradle dependency format):

org.meta-jb:meta-jb-util:0.18.1

com.google.collections:google-collections:1.0

Gradle or Maven will download those automatically.

In-memory Example

Filament comes with an in-memory implementation of its underlying persistence framework. This allows demonstration of the graph component without creating database tables or worrying about database connections. The in-memory version will mostly behave like a real JDBC-based version. There may be some subtle differences.

The edge type above is the string "Demo". In the DefaultGraph implementation, this edge type can be any object that can be converted to and from a string as defined by the org.progeeks.util.Inspector class in Meta-jb Utils.

Every graph object, both Nodes and Edges, is a Map of properties. The default implementation allows a value to be any object that can be converted to/from a String as mentioned above.

Note: n4 does not have any of its properties set and so produced no output for entrySet().

If the graph had extended further from n2, n3, etc. then the traverser would have picked those up too as long as the edges were pointing out and the edge type was "Demo".

More control is provided through the steps() method that allows iterating over a set of TraversalSteps. This provides depth and visit count information as well as the number of children that will be traversed after visting a particular step.