Relation Graph

class oaklib.interfaces.relation_graph_interface.RelationGraphInterface(resource: ~oaklib.resource.OntologyResource | None = None, strict: bool = False, _multilingual: bool | None = None, autosave: bool = <factory>, exclude_owl_top_and_bottom: bool = <factory>, ontology_metamodel_mapper: ~oaklib.mappers.ontology_metadata_mapper.OntologyMetadataMapper | None = None, _converter: ~curies.api.Converter | None = None, auto_relax_axioms: bool | None = None, cache_lookups: bool = False, property_cache: ~oaklib.utilities.keyval_cache.KeyValCache = <factory>, _edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None, _entailed_edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None)[source]

An interface that provides relation graph abstractions.

Note

this interface is now largely subsumed into the BasicOntologyInterface

entailed_outgoing_relationships(curie: str, predicates: List[str] | None = None) Iterable[Tuple[str, str]][source]

The return relationship map is keyed by relationship type, where the values are the ‘parents’ or fillers

OWL formulation:

  • is_a: {P : SubClassOf(C P), class(P)}

  • R: {P : SubClassOf(C ObjectSomeValuesFrom( RP), class(P), property(P)}

Parameters:
  • curie – the ‘child’ term

  • predicates

Returns:

entailed_incoming_relationships(curie: str, predicates: List[str] | None = None) Iterable[Tuple[str, str]][source]

The return relationship map is keyed by relationship type, where the values are the ‘parents’ or fillers

OWL formulation:

  • is_a: {P : SubClassOf(C P), class(P)}

  • R: {P : SubClassOf(C ObjectSomeValuesFrom( RP), class(P), property(P)}

Parameters:
  • curie – the ‘child’ term

  • predicates

Returns:

entailed_relationships_between(subject: str, object: str) Iterable[str][source]

Yield the predicates of all valid relationships connecting subject and object, both direct and indirect

Parameters:
  • subject

  • object

Returns:

autosave: bool

For adapters that wrap a transactional source (e.g sqlite), this controls whether results should be auto-committed after each operation

exclude_owl_top_and_bottom: bool

Do not include owl:Thing or owl:Nothing