owlapy.model.OWLOntologyManager

class owlapy.model.OWLOntologyManager[source]

Bases: object

An OWLOntologyManager manages a set of ontologies. It is the main point for creating, loading and accessing ontologies.

Methods

add_axiom

A convenience method that adds a single axiom to an ontology.

apply_change

A convenience method that applies just one change to an ontology.

create_ontology

Creates a new (empty) ontology that that has the specified ontology IRI (and no version IRI).

load_ontology

Loads an ontology that is assumed to have the specified ontology IRI as its IRI or version IRI.

remove_axiom

A convenience method that removes a single axiom from an ontology.

save_ontology

Saves the specified ontology, using the specified document IRI to determine where/how the ontology should be saved.

abstract add_axiom(ontology: owlapy.model.OWLOntology, axiom: owlapy.model.OWLAxiom)[source]

A convenience method that adds a single axiom to an ontology.

Parameters:
  • ontology – The ontology to add the axiom to.

  • axiom – The axiom to be added

abstract apply_change(change: owlapy.model.OWLOntologyChange)[source]

A convenience method that applies just one change to an ontology. When this method is used through an OWLOntologyManager implementation, the instance used should be the one that the ontology returns through the get_owl_ontology_manager() call.

Parameters:

change – The change to be applied

Raises:

ChangeApplied.UNSUCCESSFULLY – if the change was not applied successfully.

abstract create_ontology(iri: owlapy.model.IRI)owlapy.model.OWLOntology[source]

Creates a new (empty) ontology that that has the specified ontology IRI (and no version IRI).

Parameters:

iri – The IRI of the ontology to be created.

Returns:

The newly created ontology, or if an ontology with the specified IRI already exists then this existing ontology will be returned.

abstract load_ontology(iri: owlapy.model.IRI)owlapy.model.OWLOntology[source]

Loads an ontology that is assumed to have the specified ontology IRI as its IRI or version IRI. The ontology IRI will be mapped to an ontology document IRI.

Parameters:

iri – The IRI that identifies the ontology. It is expected that the ontology will also have this IRI (although the OWL API should tolerated situations where this is not the case).

Returns:

The OWLOntology representation of the ontology that was loaded.

abstract remove_axiom(ontology: owlapy.model.OWLOntology, axiom: owlapy.model.OWLAxiom)[source]

A convenience method that removes a single axiom from an ontology.

Parameters:
  • ontology – The ontology to remove the axiom from.

  • axiom – The axiom to be removed

abstract save_ontology(ontology: owlapy.model.OWLOntology, document_iri: owlapy.model.IRI)[source]

Saves the specified ontology, using the specified document IRI to determine where/how the ontology should be saved.

Parameters:
  • ontology – The ontology to be saved.

  • document_iri – The document IRI where the ontology should be saved to