owlapy.owl_hierarchy
Classes representing hierarchy in OWL.
Classes
Representation of an abstract hierarchy which can be used for classes or properties. |
|
Representation of a class hierarchy. |
|
Representation of an objet property hierarchy. |
|
Representation of a data property hierarchy. |
Module Contents
- class owlapy.owl_hierarchy.AbstractHierarchy(factory: Type[_S], hierarchy_down: Iterable[Tuple[_S, Iterable[_S]]])[source]
- class owlapy.owl_hierarchy.AbstractHierarchy(factory: Type[_S], reasoner: owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner)
Bases:
Generic
[_S
]Representation of an abstract hierarchy which can be used for classes or properties.
- Parameters:
hierarchy_down – A downwards hierarchy given as a mapping of Entities to sub-entities.
reasoner – Alternatively, a reasoner whose root_ontology is queried for entities.
- __slots__ = ('_Type', '_ent_set', '_parents_map', '_parents_map_trans', '_children_map',...
- classmethod get_top_entity() _S [source]
- Abstractmethod:
The most general entity in this hierarchy, which contains all the entities.
- classmethod get_bottom_entity() _S [source]
- Abstractmethod:
The most specific entity in this hierarchy, which contains none of the entities.
- static restrict(hierarchy: _U, *, remove: Iterable[_S] = None, allow: Iterable[_S] = None) _U [source]
Restrict a given hierarchy to a set of allowed/removed entities.
- Parameters:
hierarchy – An existing Entity hierarchy to restrict.
remove – Set of entities which should be ignored.
allow – Set of entities which should be used.
- Returns:
The restricted hierarchy.
- restrict_and_copy(*, remove: Iterable[_S] = None, allow: Iterable[_S] = None) _U [source]
Restrict this hierarchy.
See restrict for more info.
- parents(entity: _S, direct: bool = True) Iterable[_S] [source]
Parents of an entity.
- Parameters:
entity – Entity for which to query parent entities.
direct – False to return transitive parents.
- Returns:
Super-entities.
- class owlapy.owl_hierarchy.ClassHierarchy(hierarchy_down: Iterable[Tuple[owlapy.class_expression.OWLClass, Iterable[owlapy.class_expression.OWLClass]]])[source]
- class owlapy.owl_hierarchy.ClassHierarchy(reasoner: owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner)
Bases:
AbstractHierarchy
[owlapy.class_expression.OWLClass
]Representation of a class hierarchy.
- Parameters:
hierarchy_down – A downwards hierarchy given as a mapping of Class to sub-classes.
reasoner – Alternatively, a reasoner whose root_ontology is queried for classes and sub-classes.
- classmethod get_top_entity() owlapy.class_expression.OWLClass [source]
The most general entity in this hierarchy, which contains all the entities.
- classmethod get_bottom_entity() owlapy.class_expression.OWLClass [source]
The most specific entity in this hierarchy, which contains none of the entities.
- sub_classes(entity: owlapy.class_expression.OWLClass, direct: bool = True) Iterable[owlapy.class_expression.OWLClass] [source]
- super_classes(entity: owlapy.class_expression.OWLClass, direct: bool = True) Iterable[owlapy.class_expression.OWLClass] [source]
- is_subclass_of(subclass: owlapy.class_expression.OWLClass, superclass: owlapy.class_expression.OWLClass) bool [source]
- class owlapy.owl_hierarchy.ObjectPropertyHierarchy(hierarchy_down: Iterable[Tuple[owlapy.owl_property.OWLObjectProperty, Iterable[owlapy.owl_property.OWLObjectProperty]]])[source]
- class owlapy.owl_hierarchy.ObjectPropertyHierarchy(reasoner: owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner)
Bases:
AbstractHierarchy
[owlapy.owl_property.OWLObjectProperty
]Representation of an objet property hierarchy.
- classmethod get_top_entity() owlapy.owl_property.OWLObjectProperty [source]
The most general entity in this hierarchy, which contains all the entities.
- classmethod get_bottom_entity() owlapy.owl_property.OWLObjectProperty [source]
The most specific entity in this hierarchy, which contains none of the entities.
- sub_object_properties(entity: owlapy.owl_property.OWLObjectProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- super_object_properties(entity: owlapy.owl_property.OWLObjectProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- more_general_roles(role: owlapy.owl_property.OWLObjectProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- more_special_roles(role: owlapy.owl_property.OWLObjectProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- is_sub_property_of(sub_property: owlapy.owl_property.OWLObjectProperty, super_property: owlapy.owl_property.OWLObjectProperty) bool [source]
- most_general_roles() Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- most_special_roles() Iterable[owlapy.owl_property.OWLObjectProperty] [source]
- class owlapy.owl_hierarchy.DatatypePropertyHierarchy(hierarchy_down: Iterable[Tuple[owlapy.owl_property.OWLDataProperty, Iterable[owlapy.owl_property.OWLDataProperty]]])[source]
- class owlapy.owl_hierarchy.DatatypePropertyHierarchy(reasoner: owlapy.abstracts.abstract_owl_reasoner.AbstractOWLReasoner)
Bases:
AbstractHierarchy
[owlapy.owl_property.OWLDataProperty
]Representation of a data property hierarchy.
- classmethod get_top_entity() owlapy.owl_property.OWLDataProperty [source]
The most general entity in this hierarchy, which contains all the entities.
- classmethod get_bottom_entity() owlapy.owl_property.OWLDataProperty [source]
The most specific entity in this hierarchy, which contains none of the entities.
- sub_data_properties(entity: owlapy.owl_property.OWLDataProperty, direct: bool = True)[source]
- super_data_properties(entity: owlapy.owl_property.OWLDataProperty, direct: bool = True)[source]
- more_general_roles(role: owlapy.owl_property.OWLDataProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLDataProperty] [source]
- more_special_roles(role: owlapy.owl_property.OWLDataProperty, direct: bool = True) Iterable[owlapy.owl_property.OWLDataProperty] [source]
- is_sub_property_of(sub_property: owlapy.owl_property.OWLDataProperty, super_property: owlapy.owl_property.OWLDataProperty) bool [source]
- most_general_roles() Iterable[owlapy.owl_property.OWLDataProperty] [source]
- most_special_roles() Iterable[owlapy.owl_property.OWLDataProperty] [source]