ontocast.onto.util¶
derive_ontology_id(iri)
¶
Derive a short ontology handle from an absolute IRI.
Prefers rdflib conventional namespace prefixes (SKOS → skos). Falls back
to the last non-opaque path segment. Returns None instead of inventing
garbage ids (e.g. FOAF 0.1 → would-be 01).
Source code in ontocast/onto/util.py
is_rdflib_default_namespace(namespace)
¶
normalize_ontology_iri(iri)
¶
Normalize an ontology IRI for catalog lookup and alias resolution.
Strips angle brackets and trailing / or # so that
http://example.org/ont, …/ont/, and …/ont# compare equal as
lookup keys. Author namespace delimiters for prefix bindings remain the
responsibility of :func:normalize_namespace_iri.