LiteGraph
LiteGraph copied to clipboard
Lightweight graph database built using Sqlite
![]()
LiteGraph
LiteGraph is a lightweight graph database built using Sqlite with support for exporting to GEXF.
New in v1.0.0.1
- Initial release
- Add nodes and edges with properties for each
- Find routes between nodes using specified filters
- Export the graph to GEXF for use with Gephi (https://github.com/gephi/gephi)
Constraints
-
Node JSON must contain three properties:
- GUID - globally unique identifier, using property name as set in the
NodeGuidPropertyfield (defaultguid) - Name - name of the node, using property name as set in the
NodeNamePropertyfield (defaultname) - Type - type of the node, using property name as set in the
NodeTypePropertyfield (defaulttype)
- GUID - globally unique identifier, using property name as set in the
-
Edge JSON must contain two properties:
- GUID - globally unique identifier, using property name as set in the
EdgeGuidPropertyfield (defaultguid) - Type - type of the node, using property name as set in the
EdgeTypePropertyfield (defaulttype)
- GUID - globally unique identifier, using property name as set in the
Simple Example
Refer to the Test project for a full example.
using LiteGraph;
LiteGraphClient graph = new LiteGraphClient("litegraph.db");
// Add two people
graph.AddNode("{'guid':'joel','name':'Joel','type':'person','first':'Joel','city':'San Jose'}");
graph.AddNode("{'guid':'maria','name':'Maria','type':'person','first':'Maria','city':'San Jose'}");
// Add a relationship
// First parameter is the from GUID, second is the to GUID
graph.AddEdge("joel", "maria", "{'guid':'relationship1','type':'loves','data':'whatever else you want'}");
// Find a route
RouteFinder rf = new RouteFinder(graph);
rf.FromGuid = "joel";
rf.ToGuid = "maria";
GraphResult result = rf.Find();
// Export to GEXF
GexfWriter.Write(graph, "litegraph.gexf");
Version History
Please refer to CHANGELOG.md for version history.