owlapy.owl_ontology
OWL Ontology
Attributes
Classes
An object that identifies an ontology. Since OWL 2, ontologies do not have to have an ontology IRI, or if they |
|
Represents an OWL 2 Ontology in the OWL 2 specification. |
|
Represents an OWL 2 Ontology in the OWL 2 specification. |
|
Represents an OWL 2 Ontology in the OWL 2 specification. |
|
Map owlready2 classes to owlapy model classes. |
|
Represents an OWL 2 Ontology in the OWL 2 specification. |
Functions
|
Module Contents
- owlapy.owl_ontology.logger
- owlapy.owl_ontology.owlready2
- owlapy.owl_ontology.AllDifferent
- class owlapy.owl_ontology.OWLOntologyID(ontology_iri: owlapy.iri.IRI | None = None, version_iri: owlapy.iri.IRI | None = None)[source]
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”.
- __slots__ = ('_ontology_iri', '_version_iri')
- get_ontology_iri() owlapy.iri.IRI | None[source]
Gets the ontology IRI.
- Returns:
Ontology IRI. If the ontology is anonymous, it will return None.
- get_version_iri() owlapy.iri.IRI | None[source]
Gets the version IRI.
- Returns:
Version IRI or None.
- get_default_document_iri() owlapy.iri.IRI | None[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.
- class owlapy.owl_ontology.Ontology(ontology_iri: owlapy.iri.IRI | str, load: bool = True, world_store=None)[source]
Bases:
owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntologyRepresents an OWL 2 Ontology in the OWL 2 specification.
An OWLOntology consists of a possibly empty set of OWLAxioms and a possibly empty set of OWLAnnotations. An ontology can have an ontology IRI which can be used to identify the ontology. If it has an ontology IRI then it may also have an ontology version IRI. Since OWL 2, an ontology need not have an ontology IRI. (See the OWL 2 Structural Specification).
- __slots__ = ('_iri', '_world', '_onto', 'is_modified')
- is_modified: bool
- classes_in_signature() Iterable[owlapy.class_expression.OWLClass][source]
Gets the classes in the signature of this object.
- Returns:
Classes in the signature of this object.
- data_properties_in_signature() Iterable[owlapy.owl_property.OWLDataProperty][source]
Get the data properties that are in the signature of this object.
- Returns:
Data properties that are in the signature of this object.
- object_properties_in_signature() Iterable[owlapy.owl_property.OWLObjectProperty][source]
A convenience method that obtains the object properties that are in the signature of this object.
- Returns:
Object properties that are in the signature of this object.
- properties_in_signature() Iterable[owlapy.owl_property.OWLProperty][source]
- individuals_in_signature() Iterable[owlapy.owl_individual.OWLNamedIndividual][source]
A convenience method that obtains the individuals that are in the signature of this object.
- Returns:
Individuals that are in the signature of this object.
- get_abox_axioms() Iterable[source]
Get all ABox (assertional) axioms: class assertions, object- and data-property assertions.
- get_tbox_axioms() Iterable[source]
Get all TBox (schema-level) axioms: class declarations, SubClassOf, EquivalentClasses and DisjointClasses axioms.
- get_abox_axioms_between_individuals() Iterable[source]
Get all object-property assertion axioms, i.e. triples between two individuals.
- get_abox_axioms_between_individuals_and_classes() Iterable[source]
Get all class assertion axioms, i.e. triples of the form individual rdf:type Class.
- equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom][source]
Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.
- Parameters:
c – The class for which the EquivalentClasses axioms should be retrieved.
- Returns:
EquivalentClasses axioms contained in this ontology.
- general_class_axioms() Iterable[owlapy.owl_axiom.OWLClassAxiom][source]
- Get the general class axioms of this ontology. This includes SubClass axioms with a complex class expression
as the sub class and EquivalentClass axioms and DisjointClass axioms with only complex class expressions.
- Returns:
General class axioms contained in this ontology.
- get_ontology_id() OWLOntologyID[source]
Gets the OWLOntologyID belonging to this object.
- Returns:
The OWLOntologyID.
- data_property_domain_axioms(pe: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom][source]
Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- data_property_range_axioms(pe: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom][source]
Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_domain_axioms(pe: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom][source]
Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_range_axioms(pe: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom][source]
Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- add_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Add the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- remove_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Removes the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- save(path: str | owlapy.iri.IRI = None, inplace: bool = False, document_format: str | None = None)[source]
Save the ontology to a file, optionally in a different serialisation format.
owlready2 natively supports
"rdfxml"and"ntriples". Any other format is handled by loading the RDF/XML output into rdflib and re-serialising there.owlready2-native formats:
rdflib-backed formats – saved as RDF/XML first, then converted:
Format string(s)
Serialisation
"turtle"/"ttl"Turtle
"json-ld"/"jsonld"JSON-LD
"nt11"N-Triples 1.1
"n3"Notation3
"trig"TriG
"trix"TriX
"nquads"/"nq"N-Quads
- Parameters:
path – File path where the ontology will be saved.
inplace – If
True, overwrite the file the ontology was loaded from.document_format – Desired serialisation format (see tables above). Defaults to
"rdfxml"when not specified.
- Raises:
ValueError – If an unsupported format string is provided.
- class owlapy.owl_ontology.SyncOntology(path: owlapy.iri.IRI | str, load: bool = True)[source]
Bases:
owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntologyRepresents an OWL 2 Ontology in the OWL 2 specification.
An OWLOntology consists of a possibly empty set of OWLAxioms and a possibly empty set of OWLAnnotations. An ontology can have an ontology IRI which can be used to identify the ontology. If it has an ontology IRI then it may also have an ontology version IRI. Since OWL 2, an ontology need not have an ontology IRI. (See the OWL 2 Structural Specification).
- owlapi_manager
- path
- load = True
- mapper
- classes_in_signature() Iterable[owlapy.class_expression.OWLClass][source]
Gets the classes in the signature of this object.
- Returns:
Classes in the signature of this object.
- data_properties_in_signature() Iterable[owlapy.owl_property.OWLDataProperty][source]
Get the data properties that are in the signature of this object.
- Returns:
Data properties that are in the signature of this object.
- object_properties_in_signature() Iterable[owlapy.owl_property.OWLObjectProperty][source]
A convenience method that obtains the object properties that are in the signature of this object.
- Returns:
Object properties that are in the signature of this object.
- individuals_in_signature() Iterable[owlapy.owl_individual.OWLNamedIndividual][source]
A convenience method that obtains the individuals that are in the signature of this object.
- Returns:
Individuals that are in the signature of this object.
- equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom][source]
Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.
- Parameters:
c – The class for which the EquivalentClasses axioms should be retrieved.
- Returns:
EquivalentClasses axioms contained in this ontology.
- general_class_axioms() Iterable[owlapy.owl_axiom.OWLClassAxiom][source]
- Get the general class axioms of this ontology. This includes SubClass axioms with a complex class expression
as the sub class and EquivalentClass axioms and DisjointClass axioms with only complex class expressions.
- Returns:
General class axioms contained in this ontology.
- data_property_domain_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom][source]
Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- data_property_range_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom][source]
Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_domain_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom][source]
Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_range_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom][source]
Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- get_signature(include_imports_closure: bool = True)[source]
Gets the entities that are in the signature of this ontology.
- Parameters:
include_imports_closure – Whether to include/exclude imports from searches.
- Returns:
Entities in signature.
- get_abox_axioms(include_imports_closure: bool = True) Iterable[owlapy.owl_axiom.OWLAxiom][source]
Get all ABox axioms.
- Parameters:
include_imports_closure – Whether to include/exclude imports from searches.
- Returns:
ABox axioms.
- get_rbox_axioms(include_imports_closure: bool = True) Iterable[owlapy.owl_axiom.OWLAxiom][source]
Get all RBox axioms. :param include_imports_closure: Whether to include/exclude imports from searches.
- Returns:
RBox axioms.
- get_tbox_axioms(include_imports_closure: bool = True) Iterable[owlapy.owl_axiom.OWLAxiom][source]
Get all TBox axioms.
- Parameters:
include_imports_closure – Whether to include/exclude imports from searches.
- Returns:
TBox axioms.
- get_dl_expressivity() str[source]
Compute the DL expressivity name of this ontology, e.g. “ALCHN(D)”.
- get_prefixes() Dict[str, str][source]
Get the prefix -> namespace IRI mappings currently registered for this ontology.
These prefixes are honoured by
save()both for the OWL API–backed formats that support them (RDF/XML, OWL/XML, Turtle, Functional Syntax, Manchester Syntax) and for the rdflib-backed formats (Turtle, N3, TriG, JSON-LD).- Returns:
Mapping of prefix name (without a trailing colon) to namespace IRI.
- set_prefix(prefix: str, namespace: str) None[source]
Declare or update a prefix -> namespace IRI mapping for this ontology.
- Parameters:
prefix – Short prefix name, e.g.
"foaf"(no trailing colon).namespace – Namespace IRI the prefix expands to, e.g.
"http://xmlns.com/foaf/0.1/".
- Raises:
ValueError – If the ontology’s current document format does not support prefixes (e.g. LaTeX, DL Syntax, KRSS2, OBO).
- remove_prefix(prefix: str) None[source]
Remove a previously declared prefix mapping, if present.
- Parameters:
prefix – Short prefix name to remove (no trailing colon).
- Raises:
ValueError – If the ontology’s current document format does not support prefixes (e.g. LaTeX, DL Syntax, KRSS2, OBO).
- get_ontology_id() OWLOntologyID[source]
Gets the OWLOntologyID belonging to this object.
- Returns:
The OWLOntologyID.
- add_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Add the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- remove_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Removes the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- save(path: str = None, document_iri: owlapy.iri.IRI | None = None, document_format: str | None = None)[source]
Save the ontology to a file, optionally specifying the output format.
OWL API–backed formats (case-insensitive):
rdflib-backed formats – the ontology is first saved as RDF/XML by OWL API to a temporary file, loaded by rdflib, re-serialised in the requested format, then the temporary file is deleted:
Format string(s)
Serialisation
"turtle2"Turtle (rdflib)
"json-ld"/"jsonld"JSON-LD
"ntriples"/"nt"N-Triples
"nt11"N-Triples 1.1
"n3"Notation3
"trig"TriG
"trix"TriX
"nquads"/"nq"N-Quads
If document_format is
Nonethe ontology’s current format is kept.- Parameters:
path – File path where the ontology will be saved.
document_iri – Reserved for future use; must be
None.document_format – Desired serialisation format (see tables above).
- Raises:
ValueError – If an unsupported format string is provided.
- class owlapy.owl_ontology.RDFLibOntology(path: str | owlapy.iri.IRI, load: bool = True)[source]
Bases:
owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntologyRepresents an OWL 2 Ontology in the OWL 2 specification.
An OWLOntology consists of a possibly empty set of OWLAxioms and a possibly empty set of OWLAnnotations. An ontology can have an ontology IRI which can be used to identify the ontology. If it has an ontology IRI then it may also have an ontology version IRI. Since OWL 2, an ontology need not have an ontology IRI. (See the OWL 2 Structural Specification).
- is_modified = False
- get_tbox_axioms() Iterable[owlapy.owl_axiom.OWLAxiom][source]
Get all TBox (schema-level) axioms this loader can represent: class declarations, SubClassOf, EquivalentClasses and DisjointClasses axioms between named classes.
Predicates this loader doesn’t understand as TBox structure (e.g. rdfs:label, rdfs:comment, or any other annotation on a class) are silently skipped rather than raising – they aren’t TBox axioms, and virtually every real-world ontology has them.
- get_abox_axioms() Iterable[source]
Get all ABox (assertional) axioms this loader can represent: class assertions, object-property assertions, and data-property assertions for every named individual.
Unlike earlier versions of this method, a class-assertion target does not need to be independently declared rdf:type owl:Class (OWL doesn’t require that for i rdf:type C to be valid), and an object-property target does not need to be independently declared rdf:type owl:NamedIndividual – neither omission is an error, so neither raises anymore.
- classes_in_signature() Iterable[owlapy.class_expression.OWLClass][source]
Gets the classes in the signature of this object.
- Returns:
Classes in the signature of this object.
- data_properties_in_signature() Iterable[owlapy.owl_property.OWLDataProperty][source]
Get the data properties that are in the signature of this object.
- Returns:
Data properties that are in the signature of this object.
- object_properties_in_signature() Iterable[owlapy.owl_property.OWLObjectProperty][source]
A convenience method that obtains the object properties that are in the signature of this object.
- Returns:
Object properties that are in the signature of this object.
- properties_in_signature() Iterable[owlapy.owl_property.OWLProperty][source]
- individuals_in_signature() Iterable[owlapy.owl_individual.OWLNamedIndividual][source]
A convenience method that obtains the individuals that are in the signature of this object.
- Returns:
Individuals that are in the signature of this object.
- get_abox_axioms_between_individuals() Iterable[owlapy.owl_axiom.OWLObjectPropertyAssertionAxiom][source]
- get_abox_axioms_between_individuals_and_classes() Iterable[owlapy.owl_axiom.OWLClassAssertionAxiom][source]
- equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom][source]
Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.
- Parameters:
c – The class for which the EquivalentClasses axioms should be retrieved.
- Returns:
EquivalentClasses axioms contained in this ontology.
- abstractmethod general_class_axioms() Iterable[owlapy.owl_axiom.OWLClassAxiom][source]
- Get the general class axioms of this ontology. This includes SubClass axioms with a complex class expression
as the sub class and EquivalentClass axioms and DisjointClass axioms with only complex class expressions.
- Returns:
General class axioms contained in this ontology.
- data_property_domain_axioms(pe: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom][source]
Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- data_property_range_axioms(pe: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom][source]
Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_domain_axioms(pe: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom][source]
Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- object_property_range_axioms(pe: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom][source]
Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- add_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Add the given axiom(s) to this ontology, translating them into rdflib triples.
Only axioms between/on named entities are supported (matching the read API’s scope – see get_tbox_axioms()/get_abox_axioms()); axioms involving complex class/property expressions raise NotImplementedError. Adding an axiom that references an entity not yet declared in this ontology (e.g. an OWLSubClassOfAxiom between two classes that were never independently declared owl:Class) implicitly declares those entities too, so the axiom stays visible to get_tbox_axioms()/classes_in_signature()/etc. immediately afterwards.
- remove_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Remove the given axiom(s) from this ontology.
Removing an axiom only removes the triple(s) it directly represents – it does not cascade-remove entity declarations that other axioms might still depend on. Use remove_axiom(OWLDeclarationAxiom(entity)) explicitly to un-declare an entity.
- save(path: str | owlapy.iri.IRI = None, inplace: bool = False, document_format: str | None = None)[source]
Save this ontology to a file via rdflib’s own serializer.
- Parameters:
path – Destination file path. Required unless inplace is True.
inplace – If True, overwrite the file this ontology was loaded from (or, for a blank ontology created with load=False, the IRI it was constructed with – which must itself be a valid filesystem path for that to work).
document_format – Serialization format. Accepts rdflib’s own format names (“xml”, “turtle”, “n3”, “nt”, “nt11”, “trig”, “trix”, “nquads”, “json-ld”) plus the OWL-API-style aliases Ontology/SyncOntology’s save() accept (“rdfxml”, “ttl”, “ntriples”, “jsonld”). Defaults to RDF/XML when omitted.
- Raises:
ValueError – If an unsupported format string is provided.
- get_ontology_id() OWLOntologyID[source]
Gets the OWLOntologyID belonging to this object.
- Returns:
The OWLOntologyID.
- owlapy.owl_ontology.OWLREADY2_FACET_KEYS
- class owlapy.owl_ontology.ToOwlready2(world: owlready2)[source]
- __slots__ = '_world'
- abstractmethod map_object(o: owlapy.owl_object.OWLObject)[source]
Map owlapy object classes.
- abstractmethod map_concept(o: owlapy.class_expression.OWLClassExpression) owlready2 | owlready2[source]
Map owlapy concept classes.
- abstractmethod map_datarange(p: owlapy.owl_data_ranges.OWLDataRange) owlready2 | type[source]
Map owlapy data range classes.
- class owlapy.owl_ontology.FromOwlready2[source]
Map owlready2 classes to owlapy model classes.
- __slots__ = ()
- abstractmethod map_concept(c: owlready2 | owlready2) owlapy.class_expression.OWLClassExpression[source]
Map concept classes.
- abstractmethod map_datarange(p: owlready2) owlapy.owl_data_ranges.OWLDataRange[source]
Map data range classes.
- class owlapy.owl_ontology.NeuralOntology(path_neural_embedding: str, train_if_not_exists: bool = False, training_params: Dict[str, Any] | str | None = None, batch_size: int = 1024, device: str = 'gpu', gamma: float = 0.5)[source]
Bases:
owlapy.abstracts.abstract_owl_ontology.AbstractOWLOntologyRepresents an OWL 2 Ontology in the OWL 2 specification.
An OWLOntology consists of a possibly empty set of OWLAxioms and a possibly empty set of OWLAnnotations. An ontology can have an ontology IRI which can be used to identify the ontology. If it has an ontology IRI then it may also have an ontology version IRI. Since OWL 2, an ontology need not have an ontology IRI. (See the OWL 2 Structural Specification).
- STR_IRI_TYPE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
- STR_IRI_OWL_CLASS = 'http://www.w3.org/2002/07/owl#Class'
- STR_IRI_OBJECT_PROPERTY = 'http://www.w3.org/2002/07/owl#ObjectProperty'
- STR_IRI_DATA_PROPERTY = 'http://www.w3.org/2002/07/owl#DatatypeProperty'
- gamma = 0.5
- batch_size = 1024
- predict(h: List[str] = None, r: List[str] = None, t: List[str] = None) List[Tuple[str, float]][source]
- classes_in_signature() List[owlapy.class_expression.OWLClass][source]
Gets the classes in the signature of this object.
- Returns:
Classes in the signature of this object.
- individuals_in_signature() List[owlapy.owl_individual.OWLNamedIndividual][source]
A convenience method that obtains the individuals that are in the signature of this object.
- Returns:
Individuals that are in the signature of this object.
- data_properties_in_signature() List[owlapy.owl_property.OWLDataProperty][source]
Get the data properties that are in the signature of this object.
- Returns:
Data properties that are in the signature of this object.
- object_properties_in_signature() List[owlapy.owl_property.OWLObjectProperty][source]
A convenience method that obtains the object properties that are in the signature of this object.
- Returns:
Object properties that are in the signature of this object.
- abstractmethod equivalent_classes_axioms(c: owlapy.class_expression.OWLClass) Iterable[owlapy.owl_axiom.OWLEquivalentClassesAxiom][source]
Gets all of the equivalent axioms in this ontology that contain the specified class as an operand.
- Parameters:
c – The class for which the EquivalentClasses axioms should be retrieved.
- Returns:
EquivalentClasses axioms contained in this ontology.
- abstractmethod general_class_axioms() Iterable[owlapy.owl_axiom.OWLClassAxiom][source]
- Get the general class axioms of this ontology. This includes SubClass axioms with a complex class expression
as the sub class and EquivalentClass axioms and DisjointClass axioms with only complex class expressions.
- Returns:
General class axioms contained in this ontology.
- abstractmethod data_property_domain_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyDomainAxiom][source]
Gets the OWLDataPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- abstractmethod data_property_range_axioms(property: owlapy.owl_property.OWLDataProperty) Iterable[owlapy.owl_axiom.OWLDataPropertyRangeAxiom][source]
Gets the OWLDataPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- abstractmethod object_property_domain_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyDomainAxiom][source]
Gets the OWLObjectPropertyDomainAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.
- abstractmethod get_ontology_id() owlapy.abstracts.abstract_owl_ontology._OI[source]
Gets the OWLOntologyID belonging to this object.
- Returns:
The OWLOntologyID.
- abstractmethod add_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Add the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- abstractmethod remove_axiom(axiom: owlapy.owl_axiom.OWLAxiom | Iterable[owlapy.owl_axiom.OWLAxiom])[source]
Removes the specified axiom/axioms to the ontology.
- Parameters:
axiom – Can be a single axiom or a collection of axioms.
- Returns:
Nothing.
- abstractmethod save(document_iri: owlapy.iri.IRI | None = None)[source]
Saves this ontology, using its IRI to determine where/how the ontology should be saved.
- Parameters:
document_iri – Whether you want to save in a different location.
- abstractmethod object_property_range_axioms(property: owlapy.owl_property.OWLObjectProperty) Iterable[owlapy.owl_axiom.OWLObjectPropertyRangeAxiom][source]
Gets the OWLObjectPropertyRangeAxiom objects where the property is equal to the specified property.
- Parameters:
property – The property which is equal to the property of the retrieved axioms.
- Returns:
The axioms matching the search.