Skip to main content

Crate ontologos_parser

Crate ontologos_parser 

Source
Expand description

OWL and RDF syntax parsers for OntoLogos.

v0.2 loads OWL/XML, RDF/XML, Turtle, and OWL Functional Syntax into ontologos_core::Ontology via load_ontology.

§Example

use ontologos_parser::load_ontology;

let ontology = load_ontology(std::path::Path::new("ontology.owl"))?;
println!("axioms: {}", ontology.axiom_count());

See load guide.

Structs§

ParseLimits
Resource limits for OWL file parsing.

Enums§

Error
Errors returned by the OWL/RDF parser.
Format
Supported ontology serialization formats.

Functions§

detect_format
Detect the most likely format from a file path and optional content sniffing.
detect_format_from_bytes
Detect format from file content bytes.
detect_functional_from_bytes
Detect OWL Functional Syntax from a file header.
detect_turtle_from_bytes
Sniff the first bytes of a file for Turtle @prefix or PREFIX declarations.
expand_xml_entities
Expand <!ENTITY ...> declarations in RDF/XML prolog with an output size cap.
expand_xml_entities_with_limit
Expand entities with an output size cap for untrusted RDF/XML.
load_ofn_from_str
Parse OWL Functional Syntax from an in-memory document (no temp file).
load_ofn_from_str_with_limits
Parse OWL Functional Syntax from an in-memory document with custom limits.
load_ofn_with_incremental
Load an OFN ontology and append axioms from a second OFN fragment (same prefixes/IRIs).
load_ofn_with_incremental_and_limits
Load and merge OFN documents with path validation and parse limits.
load_ontology
Load an ontology from a validated file path (trusted local file; merges owl:imports).
load_ontology_in
Load an ontology constrained to stay under base (untrusted uploads).
load_ontology_lenient
Load an ontology without failing on skipped axioms or incompatible declarations.
load_ontology_lenient_in
Lenient sandboxed load for untrusted uploads that may skip axioms with warnings.
load_ontology_with_limits
Load an ontology with custom ParseLimits.
load_ontology_with_limits_and_base
Load an ontology with custom limits and optional sandbox base directory.
read_horned_owl_from_reader
Parse ontology bytes from an already-open reader (single-fd load path).
sniff_file_header
Read up to max bytes from path for format sniffing.
validate_load_path
Resolve and validate a path before loading an ontology file.
validate_loaded_ontology
Full validation including blank-node assertion and graph cycle checks.
validate_loaded_ontology_light
Lightweight validation run after every successful load.

Type Aliases§

Result
Result type alias for parser operations.