Library¶
Top level Functions¶
-
model- Create aGraphModel -
build- Generate aGraphRepresentationfrom aGraphModel
SDK¶
Model¶
-
The
GraphModelClass which is used to declaratively register, Edge and/or Node data supplier functions. Using theGraphModel.node()andGraphMode.edge()decorators.
Builders¶
-
graphinate.builders.NetworkxBuilder- Generates a NetworkX Graph instance. -
graphinate.builders.D3Builder- Generates a D3 Graph instance (i.e. a Dict). -
graphinate.builders.GraphQLBuilder- Generates a Strawberry GraphQL Schema instance -
graphinate.builders.MermaidBuilder- Generates a Mermaid Diagram
Modeling Concepts¶
Dependency Injection and Parameter Naming¶
When defining node generators using @model.node, you can request context from parent nodes by adding arguments to your generator function.
Strict Naming Convention:
To receive the ID of a parent node, your argument name must follow this pattern: {node_type}_id.
For example, if you have a node type user, a child node generator can request user_id.
Note: Arbitrary arguments are not currently supported. All arguments must match a registered node type followed by _id.
Examples¶
See the following examples for practical usage of this pattern:
- GitHub Repositories Example - Demonstrates a deep hierarchy (
user->repository->commit->file) using dependency injection.