The Person class extends BaseVertex. In addition to the placement of the common methods and attributes the Base Vertex is identified as a persistent capable class inside Infinite Graph.
The same is done for Edges by extending BaseEdge.
A GraphFactory provides a factory for creating new databases and subsequently retrieving them.
In order to access the database for reading and or writing a transaction class is required:
Adding Vertices and Edges to the Graph Database is done with the following example:
The direct retrieval of a Vertex from the database can be accomplished by using an index interface which is one of the many indexing techniques provided:
The navigate engine is used to find a Vertex within a infinite amount of Vertexes and Edge possibilities by using customizable qualifiers on the path and on the result:
This result qualifier will only filter out the path only if the end of the path is Bellatrix Lestrange.
The pathQualifier sends resulting paths to resultQualifier; The resultQualifier sends resulting paths to the ResultHandler.
The instantiation of the result qualifier and the result handler is done as:
They are then passed into navigate() as part of the initialization of the navigator:
To start the navigator, the method navigator.start() is used:
At the end of the sample, it deletes the database from the system. If you want to take a look of the database struct with Assist, comment out this line. At a later time you can delete the database by running oodeletefd SampleGraph.boot in the Sample directory.
Execute runSample.bat in the sample directory. It will compile and run the sample.
Result: