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.
- Axiom
Index - Secondary indexes over axioms for fast engine lookups.
- Axiom
Store - Storage for ontology axioms.
- CeId
- Interned class expression id.
- Consistency
Result - Result of an ontology consistency check.
- Data
Literal - Typed literal value in a data property assertion (JSON snapshot v3).
- DeId
- Interned data range / literal expression id.
- Dirty
Set - Tracks axiom edits since the last
clear_dirtycall. - DlStore
- Pool of class/data expressions and DL axioms attached to an ontology.
- Entity
Id - Stable identifier for an ontology entity. Opaque entity identifier (index into the entity registry).
- Entity
Record - A registered ontology entity with its interned IRI and kind.
- Entity
Registry - Registry mapping interned IRIs to typed entities.
- Inference
Trace - Ordered list of inference steps from a reasoning run.
- Intern
Pool - 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.
- Ontology
Builder - Fluent builder for constructing ontologies in memory.
- Ontology
Revision - Monotonic ontology edit counter (incremented on every add/remove).
- Parse
Meta - Metadata from OWL file parsing (not serialized in JSON v2 snapshots).
- Parse
Meta Summary - User-facing parse metadata for CLI and Python bindings.
- Reasoner
- Main reasoner facade over profile-specific engines.
- Reasoner
Builder - Builder for constructing a configured reasoner instance.
- Reasoner
Config - Configuration options for the reasoner builder.
- Resolved
Route - Result of profile → engine resolution.
- Swrl
Rule - Parsed DLSafe SWRL rule.
- Taxonomy
- Extracted class taxonomy from a classification run.
- Trace
Step - A single recorded inference step.
Enums§
- Axiom
- Supported axiom types in the 1.x reasoner.
- Class
Expr - OWL class expression AST (structural).
- Data
Expr - Data range expression.
- Detected
Profile Kind - OWL 2 profile detected during Auto routing (mirrors
ontologos_profile::OwlProfile). - DlAxiom
- DL axiom beyond flat core
Axiomenum. - Engine
Kind - Dispatch key for a profile-specific reasoning engine.
- Entity
Kind - 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.
- Role
Expr - Object property expression (atomic or inverse).
- Swrl
Atom - A single SWRL atom in rule body or head.
- SwrlD
Arg - SWRL data argument: literal or variable.
- SwrlI
Arg - SWRL individual argument: named individual or variable.
- Trace
Conclusion - What an inference step concludes.
- Trace
Premise - A premise referenced by an inference step.
Traits§
- Reasoner
Session - 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
iriis an absolute IRI with an allowed scheme. - validate_
snapshot_ iri - Validate an IRI from an untrusted JSON snapshot (
http,https,urnonly). - validate_
snapshot_ iri_ with_ max_ len - Validate a snapshot IRI with a custom maximum length.