ToolUp.Graph.Projection 0.22.0

Prefix Reserved
dotnet add package ToolUp.Graph.Projection --version 0.22.0
                    
NuGet\Install-Package ToolUp.Graph.Projection -Version 0.22.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ToolUp.Graph.Projection" Version="0.22.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ToolUp.Graph.Projection" Version="0.22.0" />
                    
Directory.Packages.props
<PackageReference Include="ToolUp.Graph.Projection" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ToolUp.Graph.Projection --version 0.22.0
                    
#r "nuget: ToolUp.Graph.Projection, 0.22.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ToolUp.Graph.Projection@0.22.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ToolUp.Graph.Projection&version=0.22.0
                    
Install as a Cake Addin
#tool nuget:?package=ToolUp.Graph.Projection&version=0.22.0
                    
Install as a Cake Tool

ToolUp.Graph.Projection

The entity→graph projection bridge. It projects your IEntityStore records — and their declared relationship edges — into an IGraphStore as a derived read-model, so a consumer who models their domain as entities + relationships gets graph-traversal queries for free without maintaining two parallel data models by hand.

IEntityStore stays the system of record; the graph is a queryable projection derived from it. You write entities; the graph is kept in sync.

It is opt-in and additive (GP 13). A deployment that does not compose it pays nothing, and its entity store behaves exactly as before.

What projects

  • Each entity → a node. Node label = the entity Type; NodeId = entity:{Type}:{Id} (deterministic — re-projecting yields the same id); properties = the record fields, mapped to graph PropertyValues. Mapping honours the graph substrate's precision floor: integers → PInt (int64), reals and decimalPFloat (float), timestamps → PDateTime.
  • Each declared relationship → an edge. A Phase-19c relationship whose foreign key lives on the entity (an Outgoing foreign-key cardinality) projects one directed edge: label = the relationship name, From = the declaring entity, To = the foreign-key target. Incoming inverse views are projected from the entity that carries the key; ManyToMany join-resolved edges are out of scope.

The mapping is a pure function (EntityProjection.projectEntity), shared by both the sync and rebuild paths so they never drift.

Keeping in sync

  • Incremental — the bridge subscribes to the entity-store lifecycle signal (EntityCreated / EntityUpdated / EntityDeleted): create / update upserts the node + edges; delete removes the node + incident edges. Deterministic ids make a re-apply a no-op. Sync failures surface as retryable data, never a throw, and a lastProjectedVersion per entity makes a missed signal reconcilable.
  • RebuildRebuildProjection(scopeId) reconciles the whole scope: upsert every present entity, remove orphaned nodes whose source entity is gone. Returns a ProjectionReport (counts) and is idempotent (a no-op over an unchanged store). Use it to bootstrap over an existing entity store and to heal drift.

Composition

open ToolUp.Graph.Projection

let app =
    ServerApp.create "my-app"
    |> ServerApp.withEntityStore
    |> ServerApp.withEntity bookRegistration
    |> ServerApp.withEntity authorRegistration
    |> ServerApp.withEntityGraphProjection   // opt in (requires an IGraphStore)

// Wire the bridge from a ServiceConfig extension (applied after the base
// stores + audit log are registered). No-op when not opted in.
let enrollments =
    [ ProjectedEntityType.ofRegistration bookRegistration
      ProjectedEntityType.ofRegistration authorRegistration ]

let addProjection (services: IServiceCollection) =
    EntityGraphProjectionCompose.wire services app.Config enrollments
    services

The bridge references IEntityStore (a server-tier type), so — like a graph engine companion — the deployment wires it; the SDK core does not reference it back. Server-only: it ships a DLL, not fable/ source.

Not in scope

Reverse graph→entity projection; transactional entity+graph atomicity; custom projection (computed / filtered / multi-entity-to-one-node mappings). The default mapping is field-for-field + declared-relationship- for-edge.

License

Apache-2.0. Part of the ToolUp Platform SDK.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.22.0 39 8/27/2026
0.21.0 47 8/26/2026
0.20.1 88 8/20/2026
0.20.0 109 8/19/2026