Relation Graph

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

an interface that provides relation graph abstractions

Note

that the operations provided here are similar to the graph-walking operations provided in OboGraphInterface. The main difference is that a RG provides a more restricted and formally correct set of entailments.

entailed_incoming_relationships(curie: str, predicates: Optional[List[str]] = 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_outgoing_relationships(curie: str, predicates: Optional[List[str]] = 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