LevelUp.Strategos.Ontology 2.8.0

dotnet add package LevelUp.Strategos.Ontology --version 2.8.0
                    
NuGet\Install-Package LevelUp.Strategos.Ontology -Version 2.8.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="LevelUp.Strategos.Ontology" Version="2.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LevelUp.Strategos.Ontology" Version="2.8.0" />
                    
Directory.Packages.props
<PackageReference Include="LevelUp.Strategos.Ontology" />
                    
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 LevelUp.Strategos.Ontology --version 2.8.0
                    
#r "nuget: LevelUp.Strategos.Ontology, 2.8.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 LevelUp.Strategos.Ontology@2.8.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=LevelUp.Strategos.Ontology&version=2.8.0
                    
Install as a Cake Addin
#tool nuget:?package=LevelUp.Strategos.Ontology&version=2.8.0
                    
Install as a Cake Tool

Strategos.Ontology

Type-safe ontology definition layer for domain modeling. Map your existing C# types into a unified semantic graph of Object Types, Properties, Links, Actions, Events, and Interfaces — validated at compile time, queryable at runtime.

Installation

dotnet add package LevelUp.Strategos.Ontology
dotnet add package LevelUp.Strategos.Ontology.Generators

Quick Start

using Strategos.Ontology;

public class TradingOntology : DomainOntology
{
    public override string DomainName => "trading";

    protected override void Define(IOntologyBuilder builder)
    {
        builder.Object<Position>(obj =>
        {
            obj.Key(p => p.Id);
            obj.Kind(ObjectKind.Entity);
            obj.Property(p => p.Symbol).Required();
            obj.Property(p => p.UnrealizedPnL).Computed()
               .DerivedFrom(p => p.Quantity, p => p.AverageCost);

            obj.HasMany<TradeOrder>("Orders").Inverse("Position");

            obj.Action("ExecuteTrade")
               .Requires(p => p.Status == PositionStatus.Active)
               .RequiresSoft(p => p.UnrealizedPnL > -10000)
               .Modifies(p => p.Quantity)
               .CreatesLinked<TradeOrder>("Orders");

            obj.Lifecycle<PositionStatus>(p => p.Status, lc =>
            {
                lc.State(PositionStatus.Pending).Initial();
                lc.State(PositionStatus.Active);
                lc.State(PositionStatus.Closed).Terminal();
                lc.Transition(PositionStatus.Pending, PositionStatus.Active)
                  .TriggeredByAction("Activate");
            });
        });
    }
}

Registration

services.AddOntology(options =>
{
    options.AddDomain<TradingOntology>();
    options.UseObjectSetProvider<MyObjectSetProvider>();
    options.UseActionDispatcher<MyActionDispatcher>();
});

Runtime Queries

Inject IOntologyQuery to query the ontology at runtime:

// Which actions are valid given current state?
var actions = query.GetValidActions("Position", knownProperties);

// Structured constraint report with failure reasons
var report = query.GetActionConstraintReport("Position", knownProperties);

// What would ExecuteTrade affect?
var effects = query.TracePostconditions("Position", "ExecuteTrade");

// Derivation impact analysis
var affected = query.GetAffectedProperties("Position", "Quantity");

Features

  • Fluent DSL: Expression-tree-based builder for type-safe ontology definitions
  • Compile-Time Validation: 35 Roslyn diagnostics (AONT001-AONT035) catch errors at build time
  • Object Types: Map existing C# types with keys, properties, links, actions, events
  • IS-A Hierarchy: IsA<TParent>() for type subsumption and inheritance queries
  • Preconditions: Hard (blocking) and soft (advisory) constraints on actions
  • Lifecycle: State machine declarations with action/event-triggered transitions
  • Derivation Chains: Transitive property dependency tracking across domains
  • Interfaces: Polymorphic queries across domain boundaries
  • Extension Points: Controlled cross-domain link attachment
  • Inverse Links: Bidirectional traversal with symmetry validation

Documentation

License

MIT

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 (5)

Showing the top 5 NuGet packages that depend on LevelUp.Strategos.Ontology:

Package Downloads
LevelUp.Strategos.Ontology.MCP

MCP tool surface for Strategos ontology. Exposes ontology exploration, querying, and action dispatch as MCP tools for AI agent integration.

LevelUp.Strategos.Ontology.Npgsql

PostgreSQL pgvector-backed object set provider for Strategos.Ontology.

LevelUp.Strategos.Ontology.Embeddings

OpenAI-compatible embedding provider for Strategos.Ontology vector search.

LevelUp.Valkyrie.MonoGame.Agent

Package Description

LevelUp.Valkyrie.Knowledge

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.8.0 192 5/25/2026
2.7.0 177 5/24/2026
2.6.0 201 5/17/2026
2.5.0 122 5/16/2026
2.4.2 148 4/13/2026
2.4.1 249 4/10/2026
2.4.0 122 4/7/2026
2.3.0 140 4/5/2026
2.2.1 146 3/15/2026
2.2.0 172 3/3/2026