Skip to main content

document_for_entity

Function document_for_entity 

Source
pub fn document_for_entity<'a>(
    documents: &'a [OntologyDocument],
    entity: &Entity,
) -> Option<&'a OntologyDocument>
Expand description

Find the document that owns an entity.

Preference order:

  1. Exact entity.ontology_id == doc.id
  2. Normalized ontology IRI equality with doc.base_iri
  3. Longest doc.base_iri that is a string prefix of entity.iri (nested-base fallback)