class oaklib.interfaces.subsetter_interface.SubsetterInterface(resource: Optional[oaklib.resource.OntologyResource] = None, strict: bool = False)[source]

an interface that provides subsetting operations

a challenge here is what a subset operation should produce:

  • an ontology object (committing to a specific object model)

  • an ontology interface

  • a reference to an ontology

extract_subset_ontology(seed_curies: List[str], strategy: Optional[oaklib.interfaces.subsetter_interface.SubsetStrategy] = None) oaklib.interfaces.basic_ontology_interface.BasicOntologyInterface[source]

Extracts an ontology subset using a seed list of curies

EXPERIMENTAL: this method may be removed in future

  • seed_curies

  • strategy


gap_fill_relationships(seed_curies: List[str], predicates: Optional[List[str]] = None) Iterator[Tuple[str, str, str]][source]

Given a term subset as a list of curies, find all non-redundant relationships connecting them

This assumes relation-graph entailed edges, so currently only implemented for ubergraph and sqlite

First the subset of all entailed edges conforming to the predicate profile connecting any pair of terms in the subset is selected

Then naive transitive reduction on a per predicate basis is performed. This may yield edges that are formally redundant, but these are still assumed to be useful for the user

  • seed_curies

  • predicates – if specified, only consider relationships using these predicates