CRUD Operations
How to access and modify Nodes and Edges
The Graphiti library uses 8 core classes to add data to your graph:
Node
EpisodicNode
EntityNode
Edge
EpisodicEdge
EntityEdge
CommunityNode
CommunityEdge
The generic Node
and Edge
classes are abstract base classes, and the other 4 classes inherit from them.
Each of EpisodicNode
, EntityNode
, EpisodicEdge
, and EntityEdge
have fully supported CRUD operations.
The save method performs a find or create based on the uuid of the object, and will add or update any other data from the class to the graph. A driver must be provided to the save method. The Entity Node save method is shown below as a sample.
Graphiti also supports hard deleting nodes and edges using the delete method, which also requires a driver.
Finally, Graphiti also provides class methods to get nodes and edges by uuid. Note that because these are class methods they are called using the class rather than an instance of the class.