LiteGraph is a lightweight graph database built using Sqlite with support for exporting to GEXF.
- 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)
-
Node JSON must contain three properties:
- GUID - globally unique identifier, using property name as set in the
NodeGuidProperty
field (defaultguid
) - Name - name of the node, using property name as set in the
NodeNameProperty
field (defaultname
) - Type - type of the node, using property name as set in the
NodeTypeProperty
field (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
EdgeGuidProperty
field (defaultguid
) - Type - type of the node, using property name as set in the
EdgeTypeProperty
field (defaulttype
)
- GUID - globally unique identifier, using property name as set in the
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");
Please refer to CHANGELOG.md
for version history.