owlapy.model.OWLOntologyID

class owlapy.model.OWLOntologyID(ontology_iri: Optional[owlapy.model.IRI] = None, version_iri: Optional[owlapy.model.IRI] = None)[source]

Bases: object

An object that identifies an ontology. Since OWL 2, ontologies do not have to have an ontology IRI, or if they have an ontology IRI then they can optionally also have a version IRI. Instances of this OWLOntologyID class bundle identifying information of an ontology together. If an ontology doesn’t have an ontology IRI then we say that it is “anonymous”.

Constructs an ontology identifier specifying the ontology IRI and version IRI.

Parameters:
  • ontology_iri – The ontology IRI (optional)

  • version_iri – The version IRI (must be None if no ontology_iri is provided)

Methods

get_default_document_iri

Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID.

get_ontology_iri

Gets the ontology IRI.

get_version_iri

Gets the version IRI.

is_anonymous

get_default_document_iri()Optional[owlapy.model.IRI][source]

Gets the IRI which is used as a default for the document that contain a representation of an ontology with this ID. This will be the version IRI if there is an ontology IRI and version IRI, else it will be the ontology IRI if there is an ontology IRI but no version IRI, else it will be None if there is no ontology IRI. See Ontology Documents in the OWL 2 Structural Specification.

Returns:

the IRI that can be used as a default for an ontology document, or None.

get_ontology_iri()Optional[owlapy.model.IRI][source]

Gets the ontology IRI.

Returns:

Ontology IRI. If the ontology is anonymous, it will return None

get_version_iri()Optional[owlapy.model.IRI][source]

Gets the version IRI.

Returns:

Version IRI or None

is_anonymous()bool[source]