LevelUp.Strategos.Ontology
3.0.0
dotnet add package LevelUp.Strategos.Ontology --version 3.0.0
NuGet\Install-Package LevelUp.Strategos.Ontology -Version 3.0.0
<PackageReference Include="LevelUp.Strategos.Ontology" Version="3.0.0" />
<PackageVersion Include="LevelUp.Strategos.Ontology" Version="3.0.0" />
<PackageReference Include="LevelUp.Strategos.Ontology" />
paket add LevelUp.Strategos.Ontology --version 3.0.0
#r "nuget: LevelUp.Strategos.Ontology, 3.0.0"
#:package LevelUp.Strategos.Ontology@3.0.0
#addin nuget:?package=LevelUp.Strategos.Ontology&version=3.0.0
#tool nuget:?package=LevelUp.Strategos.Ontology&version=3.0.0
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 facts = new ActionFacts(
properties:
[
KeyValuePair.Create(
"Status",
PredicateLiteral.Enum("PositionStatus", "Active")),
]);
var candidates = query.GetCandidateActions("trading", "Position", facts);
// Structured constraint report with failure reasons
var report = query.GetActionConstraintReport("trading", "Position", facts);
// 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: Roslyn AONT diagnostics catch authoring and contract 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 - Typed action contracts: Closed hard/soft predicates, explicit guarantees, exact sequential composition proofs, and tri-state runtime discovery
- 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
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 |
|---|---|---|
| 3.0.0 | 137 | 9/11/2026 |
| 3.0.0-rc.1 | 94 | 9/10/2026 |
| 2.10.0 | 209 | 8/7/2026 |
| 2.9.1 | 1,414 | 6/23/2026 |
| 2.9.0 | 246 | 6/19/2026 |
| 2.8.0 | 467 | 5/25/2026 |
| 2.7.0 | 213 | 5/24/2026 |
| 2.6.0 | 228 | 5/17/2026 |
| 2.5.0 | 147 | 5/16/2026 |
| 2.4.2 | 176 | 4/13/2026 |
| 2.4.1 | 273 | 4/10/2026 |
| 2.4.0 | 140 | 4/7/2026 |
| 2.3.0 | 162 | 4/5/2026 |
| 2.2.1 | 170 | 3/15/2026 |
| 2.2.0 | 194 | 3/3/2026 |