Skip to main content

Crate ontologos_core

Crate ontologos_core 

Source
Expand description

Core data model and reasoner API for OntoLogos.

v0.4 provides an in-memory ontology representation with interned IRIs, typed entities, structured axioms, secondary indexes, and JSON v3 serialization (v2 read supported).

§Start here — load and reason

Do not use Ontology::from_file for file loading. Use ontologos_parser::load_ontology and ontologos_facade::classify for reasoning.

use ontologos_parser::load_ontology;
use ontologos_rl::rdfs::RdfsEngine;

let mut ontology = load_ontology(std::path::Path::new("ontology.owl"))?;
let report = RdfsEngine::new().materialize(&mut ontology)?;
println!("inferred {}", report.inferred_total());

OWL RL saturation: ontologos_rl::RlEngine::new(1)?.saturate(&mut ontology)?

§Builder-only (no parser)

use ontologos_core::{Error, Ontology};

fn main() -> Result<(), Error> {
    let ontology = Ontology::builder()
        .class("http://example.org/Pizza")?
        .class("http://example.org/Food")?
        .subclass_of("http://example.org/Pizza", "http://example.org/Food")?
        .build()?;
    assert_eq!(ontology.axiom_count(), 1);
    Ok(())
}

Structs§

AxiomId
Stable identifier for a stored axiom.
AxiomIndex
Secondary indexes over axioms for fast engine lookups.
AxiomStore
Storage for ontology axioms.
CeId
Interned class expression id.
ConsistencyResult
Result of an ontology consistency check.
DataLiteral
Typed literal value in a data property assertion (JSON snapshot v3).
DeId
Interned data range / literal expression id.
DirtySet
Tracks axiom edits since the last clear_dirty call.
DlStore
Pool of class/data expressions and DL axioms attached to an ontology.
EntityId
Stable identifier for an ontology entity. Opaque entity identifier (index into the entity registry).
EntityRecord
A registered ontology entity with its interned IRI and kind.
EntityRegistry
Registry mapping interned IRIs to typed entities.
InferenceTrace
Ordered list of inference steps from a reasoning run.
InternPool
Deduplicating pool of absolute IRI strings.
IriId
Stable identifier for an interned IRI string.
Limits
Resource limits for ontology JSON deserialization.
Ontology
In-memory ontology with interned IRIs, typed entities, and indexed axioms.
OntologyBuilder
Fluent builder for constructing ontologies in memory.
OntologyRevision
Monotonic ontology edit counter (incremented on every add/remove).
ParseMeta
Metadata from OWL file parsing (not serialized in JSON v2 snapshots).
ParseMetaSummary
User-facing parse metadata for CLI and Python bindings.
Reasoner
Main reasoner facade over profile-specific engines.
ReasonerBuilder
Builder for constructing a configured reasoner instance.
ReasonerConfig
Configuration options for the reasoner builder.
ResolvedRoute
Result of profile → engine resolution.
SwrlRule
Parsed DLSafe SWRL rule.
Taxonomy
Extracted class taxonomy from a classification run.
TraceStep
A single recorded inference step.

Enums§

Axiom
Supported axiom types in the 1.x reasoner.
ClassExpr
OWL class expression AST (structural).
DataExpr
Data range expression.
DetectedProfileKind
OWL 2 profile detected during Auto routing (mirrors ontologos_profile::OwlProfile).
DlAxiom
DL axiom beyond flat core Axiom enum.
EngineKind
Dispatch key for a profile-specific reasoning engine.
EntityKind
Kind of entity stored in the ontology registry.
Error
Errors produced by the core ontology model.
OwlConstruct
OWL 2 construct observed during parsing (for profile detection).
Profile
OWL profile selected for reasoning.
RoleExpr
Object property expression (atomic or inverse).
SwrlAtom
A single SWRL atom in rule body or head.
SwrlDArg
SWRL data argument: literal or variable.
SwrlIArg
SWRL individual argument: named individual or variable.
TraceConclusion
What an inference step concludes.
TracePremise
A premise referenced by an inference step.

Traits§

ReasonerSession
Profile-specific incremental reasoning state held by crate::Reasoner.

Functions§

axiom_signature
Entity signature of an axiom (classes, properties, individuals referenced).
uses_dl_entailment
Whether class/property assertion entailment should use the DL tableau path.
validate_iri
Validate that iri is an absolute IRI with an allowed scheme.
validate_snapshot_iri
Validate an IRI from an untrusted JSON snapshot (http, https, urn only).
validate_snapshot_iri_with_max_len
Validate a snapshot IRI with a custom maximum length.

Type Aliases§

Result
Result type alias using Error.