Skip to main content

Graph model

Nodal treats nodes and relationships as separate first-class POCOs. A relationship can carry its own properties and can be directed or undirected.

AttributeMeaning
GraphNodeMaps a CLR type to a portable node label or vertex type.
GraphRelationMaps an edge type and its direction.
GraphKeySelects the stable domain identity.
GraphPropertyMaps a CLR property to its stored name.
GraphIgnoreExcludes application-only or calculated state.

Configuration precedence is fluent model configuration, then attributes, then conventions. Provider-only schema options belong in migrations, keeping domain types independent of Neo4j and TigerGraph.

[GraphNode("Person")]
public sealed class Person
{
[GraphKey, GraphProperty("person_id")]
public required string Id { get; init; }

[GraphProperty("display_name")]
public required string Name { get; set; }

[GraphIgnore]
public string DisplayLabel => $"{Name} ({Id})";
}