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 v2 serialization.

§Start here — load and reason

Do not use Ontology::from_file or Reasoner::classify for file loading / reasoning.

use ontologos_parser::load_ontology;
use ontologos_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.
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.
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.
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.
Taxonomy
Extracted class taxonomy from a classification run.

Enums§

Axiom
Supported axiom types in the 1.x reasoner.
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.

Type Aliases§

Result
Result type alias using [Error].