OWL Interface

class oaklib.interfaces.owl_interface.OwlInterface(resource: ~oaklib.resource.OntologyResource = None, strict: bool = False, _multilingual: bool = 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, 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, functional_writer: <module 'funowl.writers.FunctionalWriter' from '/home/runner/.cache/pypoetry/virtualenvs/oaklib-5bvmowLS-py3.9/lib/python3.9/site-packages/funowl/writers/FunctionalWriter.py'> = None)[source]

presents ontology as an OWL ontology using an OWL datamodel

We leverage the _funowl_datamodel

Currently there is one implementation, the FunOwl Adapter

In future the SqlDatabase implementation will implement this, as well as:

  • owlery

  • robot/owlapi via py4j

subclass_axioms(subclass: str | None = None, superclass: str | None = None, reasoner: ReasonerConfiguration | None = None) Iterable[SubClassOf][source]

Gets all SubClassOf axioms matching criterion

Parameters:
  • subclass – if specified, constrains to axioms where this is the subclass

  • superclass – if specified, constrains to axioms where this is the superclass

  • reasoner

Returns:

equivalence_axioms(about: str | None = None, references: str | None = None, reasoner: ReasonerConfiguration | None = None) Iterable[EquivalentClasses][source]

All EquivalentClasses axioms matching criteria

Parameters:
  • about

  • references

  • reasoner

Returns:

annotation_assertion_axioms(subject: str | None = None, property: str | None = None, value: Any | None = None) Iterable[AnnotationAssertion][source]

Filters all matching annotation axioms

Parameters:
  • subject

  • property

  • value

Returns:

disjoint_pairs(subjects: Iterable[str] | None = None) Iterable[Tuple[str, str]][source]

Gets all disjoint pairs of entities

Parameters:

subjects

Returns:

is_disjoint(subject: str, object: str) bool[source]

Checks if two entities are declared or entailed disjoint.

Parameters:
  • subject

  • object

Returns:

is_satisfiable(curie: str) bool[source]

Note: this may move to the validation interface

Parameters:

curie

Returns:

reasoner_configurations() List[ReasonerConfiguration][source]

Lists all available reasoner configurations

Returns:

axiom_is_about(axiom: Declaration | SubClassOf | EquivalentClasses | DisjointClasses | DisjointUnion | SubObjectPropertyOf | EquivalentObjectProperties | DisjointObjectProperties | InverseObjectProperties | ObjectPropertyDomain | ObjectPropertyRange | FunctionalObjectProperty | InverseFunctionalObjectProperty | ReflexiveObjectProperty | IrreflexiveObjectProperty | SymmetricObjectProperty | AsymmetricObjectProperty | TransitiveObjectProperty | SubDataPropertyOf | EquivalentDataProperties | DisjointDataProperties | DataPropertyDomain | DataPropertyRange | FunctionalDataProperty | DatatypeDefinition | HasKey | SameIndividual | DifferentIndividuals | ClassAssertion | ObjectPropertyAssertion | NegativeObjectPropertyAssertion | DataPropertyAssertion | NegativeDataPropertyAssertion | AnnotationAssertion | SubAnnotationPropertyOf | AnnotationPropertyDomain | AnnotationPropertyRange) Iterable[IRI][source]

Gives an axiom, yield all of the entity IRIs which this axiom is about

For example, a SubClassOf axiom is about the IRI in the subClassOf expression

We use a consistent definition of about as in the OWLAPI

Parameters:

axiom

Returns:

entity IRI iterator

axiom_references(axiom: Declaration | SubClassOf | EquivalentClasses | DisjointClasses | DisjointUnion | SubObjectPropertyOf | EquivalentObjectProperties | DisjointObjectProperties | InverseObjectProperties | ObjectPropertyDomain | ObjectPropertyRange | FunctionalObjectProperty | InverseFunctionalObjectProperty | ReflexiveObjectProperty | IrreflexiveObjectProperty | SymmetricObjectProperty | AsymmetricObjectProperty | TransitiveObjectProperty | SubDataPropertyOf | EquivalentDataProperties | DisjointDataProperties | DataPropertyDomain | DataPropertyRange | FunctionalDataProperty | DatatypeDefinition | HasKey | SameIndividual | DifferentIndividuals | ClassAssertion | ObjectPropertyAssertion | NegativeObjectPropertyAssertion | DataPropertyAssertion | NegativeDataPropertyAssertion | AnnotationAssertion | SubAnnotationPropertyOf | AnnotationPropertyDomain | AnnotationPropertyRange) Iterable[IRI][source]

Gives an axiom, yield all of the entity IRIs which this axiom references (i.e. entities in the signature)

Parameters:

axiom

Returns:

entity IRI iterator

property_characteristics(property: str) Iterable[str][source]

Gets all property characteristics for a given property

Parameters:

property

Returns:

transitive_object_properties() Iterable[str][source]

Gets all transitive object properties

Returns:

simple_subproperty_of_chains() Iterable[Tuple[str, List[str]]][source]

Gets all property chains of where the super property is a chain of IRIs

Returns: