LevelUp.Strategos.Ontology.Npgsql
4.0.0
dotnet add package LevelUp.Strategos.Ontology.Npgsql --version 4.0.0
NuGet\Install-Package LevelUp.Strategos.Ontology.Npgsql -Version 4.0.0
<PackageReference Include="LevelUp.Strategos.Ontology.Npgsql" Version="4.0.0" />
<PackageVersion Include="LevelUp.Strategos.Ontology.Npgsql" Version="4.0.0" />
<PackageReference Include="LevelUp.Strategos.Ontology.Npgsql" />
paket add LevelUp.Strategos.Ontology.Npgsql --version 4.0.0
#r "nuget: LevelUp.Strategos.Ontology.Npgsql, 4.0.0"
#:package LevelUp.Strategos.Ontology.Npgsql@4.0.0
#addin nuget:?package=LevelUp.Strategos.Ontology.Npgsql&version=4.0.0
#tool nuget:?package=LevelUp.Strategos.Ontology.Npgsql&version=4.0.0
Strategos.Ontology.Npgsql
A PostgreSQL object-set provider for Strategos.Ontology, backed by pgvector. It runs ontology queries and traversals as SQL.
The in-memory provider and this provider answer the same queries. Move from one to the other without a change to the query code.
Requirements
- PostgreSQL 13 or later.
- The
vectorextension, for similarity search.
Installation
dotnet add package LevelUp.Strategos.Ontology.Npgsql
Register the provider
services.AddPgVectorObjectSets(options =>
{
options.ConnectionString = configuration.GetConnectionString("Ontology")!;
options.Schema = "ontology";
options.AutoCreateSchema = true;
options.IndexType = PgVectorIndexType.Hnsw;
});
The call registers three services: the provider, IObjectSetProvider and IObjectSetWriter.
Options
| Option | Default | Purpose |
|---|---|---|
ConnectionString |
(none) | The PostgreSQL connection string. Required. |
Schema |
public |
The schema that holds the ontology tables |
AutoCreateSchema |
false |
Creates the schema and the tables at start-up |
IndexType |
IvfFlat |
The vector index type. Hnsw is the other value. |
IterativeScan |
(none) | Iterative-scan settings for a filtered similarity query |
Set AutoCreateSchema in development only. In production, apply the schema through the migration process.
Generated identifiers
PostgreSQL truncates an identifier at 63 bytes. A long descriptor name or role name can therefore collide with another one, or can name a table that does not exist.
This provider sends every table name, endpoint column and index name through one truncate-and-hash function. The data-definition statements and the data-manipulation statements therefore derive the same identifier from the same logical name. A name within the limit is unchanged.
Related packages
LevelUp.Strategos.Ontology— the descriptor model and the query surface.LevelUp.Strategos.Ontology.Embeddings— an embedding provider for similarity search.
Scoped ontology actions
Register PostgresScopedOntologyActionDispatcher as
IScopedOntologyActionDispatcher for a PostgreSQL-backed scoped action host.
Bind IPostgresScopedOntologyActionBinder to the application's domain store
and provide the data source that owns the target and grant records. The binder
uses the supplied transaction to verify the exact tenant, actor, grant, action
and target. Hold the grant lock and the target write lock until the transaction ends. Return
the existing ontology action pipeline with its facts, relation reads and
writes bound to that transaction. The dispatcher reuses the authenticated
actor identity, intersects its claims with current grants, and commits after
the action succeeds. A denied or failed action rolls back.
| 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
- LevelUp.Strategos.Ontology (>= 4.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.8)
- Microsoft.Extensions.Options (>= 10.0.8)
- Npgsql (>= 10.0.3)
- Pgvector (>= 0.3.2)
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 |
|---|---|---|
| 4.0.0 | 35 | 12/5/2026 |
| 3.0.0 | 1,156 | 9/11/2026 |
| 3.0.0-rc.1 | 100 | 9/10/2026 |
| 2.10.0 | 159 | 8/7/2026 |
| 2.9.1 | 1,467 | 6/23/2026 |
| 2.9.0 | 228 | 6/19/2026 |
| 2.8.0 | 429 | 5/25/2026 |
| 2.7.0 | 170 | 5/24/2026 |
| 2.6.0 | 140 | 5/17/2026 |
| 2.5.0 | 146 | 5/16/2026 |
| 2.4.2 | 147 | 4/13/2026 |
| 2.4.1 | 268 | 4/10/2026 |
| 2.4.0 | 152 | 4/7/2026 |
| 2.3.0 | 164 | 4/5/2026 |
| 2.2.1 | 195 | 3/15/2026 |
| 2.2.0 | 196 | 3/3/2026 |