owlapy.class_expression

OWL Class Expressions https://www.w3.org/TR/owl2-syntax/#Class_Expressions ClassExpression :=

owl_class.py: Class nary_boolean_expression.py: ObjectIntersectionOf, ObjectUnionOf class_expression.py: ObjectComplementOf

restriction.py: ObjectOneOf, ObjectSomeValuesFrom, ObjectAllValuesFrom, ObjectHasValue,ObjectHasSelf, ObjectMinCardinality, ObjectMaxCardinality, ObjectExactCardinality, DataSomeValuesFrom, DataAllValuesFrom, DataHasValue, DataMinCardinality, DataMaxCardinality, DataExactCardinality

Submodules

Package Contents

Classes

OWLClassExpression

OWL Class expressions represent sets of individuals by formally specifying conditions on the individuals' properties;

OWLAnonymousClassExpression

A Class Expression which is not a named Class.

OWLBooleanClassExpression

Represent an anonymous boolean class expression.

OWLObjectComplementOf

Represents an ObjectComplementOf class expression in the OWL 2 Specification.

OWLClass

An OWL 2 named Class. Classes can be understood as sets of individuals.

OWLNaryBooleanClassExpression

OWLNaryBooleanClassExpression.

OWLObjectUnionOf

A union class expression ObjectUnionOf( CE1 ... CEn ) contains all individuals that are instances

OWLObjectIntersectionOf

An intersection class expression ObjectIntersectionOf( CE1 ... CEn ) contains all individuals that are instances

OWLRestriction

Represents an Object Property Restriction or Data Property Restriction in the OWL 2 specification.

OWLQuantifiedRestriction

Represents a quantified restriction.

OWLQuantifiedObjectRestriction

Represents a quantified object restriction.

OWLObjectRestriction

Represents an Object Property Restriction in the OWL 2 specification.

OWLHasValueRestriction

Represent a HasValue restriction in the OWL 2

OWLDataRestriction

Represents a Data Property Restriction.

OWLCardinalityRestriction

Base interface for owl min and max cardinality restriction.

OWLObjectCardinalityRestriction

Represents Object Property Cardinality Restrictions in the OWL 2 specification.

OWLObjectHasSelf

A self-restriction ObjectHasSelf( OPE ) consists of an object property expression OPE,

OWLDataOneOf

An enumeration of literals DataOneOf( lt1 ... ltn ) contains exactly the explicitly specified literals lti with

OWLQuantifiedDataRestriction

Represents a quantified data restriction.

OWLDataCardinalityRestriction

Represents Data Property Cardinality Restrictions.

OWLObjectSomeValuesFrom

An existential class expression ObjectSomeValuesFrom( OPE CE ) consists of an object property expression OPE and

OWLObjectAllValuesFrom

A universal class expression ObjectAllValuesFrom( OPE CE ) consists of an object property expression OPE and a

OWLObjectHasValue

A has-value class expression ObjectHasValue( OPE a ) consists of an object property expression OPE and an

OWLDatatypeRestriction

A datatype restriction DatatypeRestriction( DT F1 lt1 ... Fn ltn ) consists of a unary datatype DT and n pairs

OWLFacet

Enumerations for OWL facets.

OWLFacetRestriction

A facet restriction is used to restrict a particular datatype.

OWLObjectMinCardinality

A minimum cardinality expression ObjectMinCardinality( n OPE CE ) consists of a nonnegative integer n, an object

OWLObjectMaxCardinality

A maximum cardinality expression ObjectMaxCardinality( n OPE CE ) consists of a nonnegative integer n, an object

OWLObjectExactCardinality

An exact cardinality expression ObjectExactCardinality( n OPE CE ) consists of a nonnegative integer n, an object

OWLDataSomeValuesFrom

An existential class expression DataSomeValuesFrom( DPE1 ... DPEn DR ) consists of n data property expressions

OWLDataAllValuesFrom

A universal class expression DataAllValuesFrom( DPE1 ... DPEn DR ) consists of n data property expressions DPEi,

OWLDataHasValue

A has-value class expression DataHasValue( DPE lt ) consists of a data property expression DPE and a literal lt,

OWLDataMinCardinality

A minimum cardinality expression DataMinCardinality( n DPE DR ) consists of a nonnegative integer n, a data

OWLDataMaxCardinality

A maximum cardinality expression ObjectMaxCardinality( n OPE CE ) consists of a nonnegative integer n, an object

OWLDataExactCardinality

An exact cardinality expression ObjectExactCardinality( n OPE CE ) consists of a nonnegative integer n, an

OWLObjectOneOf

An enumeration of individuals ObjectOneOf( a1 ... an ) contains exactly the individuals ai with 1 ≤ i ≤ n.

OWLRDFVocabulary

Enumerations for OWL/RDF vocabulary.

Attributes

OWLThing

OWLNothing

class owlapy.class_expression.OWLClassExpression[source]

Bases: owlapy.owl_data_ranges.OWLPropertyRange

OWL Class expressions represent sets of individuals by formally specifying conditions on the individuals’ properties; individuals satisfying these conditions are said to be instances of the respective class expressions. In the structural specification of OWL 2, class expressions are represented by ClassExpression. (https://www.w3.org/TR/owl2-syntax/#Class_Expressions)

__slots__ = ()
abstract is_owl_thing() bool[source]

Determines if this expression is the built in class owl:Thing. This method does not determine if the class is equivalent to owl:Thing.

Returns:

Thing.

Return type:

True if this expression is owl

abstract is_owl_nothing() bool[source]

Determines if this expression is the built in class owl:Nothing. This method does not determine if the class is equivalent to owl:Nothing.

abstract get_object_complement_of() OWLObjectComplementOf[source]

Gets the object complement of this class expression.

Returns:

A class expression that is the complement of this class expression.

abstract get_nnf() OWLClassExpression[source]

Gets the negation normal form of the complement of this expression.

Returns:

A expression that represents the NNF of the complement of this expression.

class owlapy.class_expression.OWLAnonymousClassExpression[source]

Bases: OWLClassExpression

A Class Expression which is not a named Class.

is_owl_nothing() bool[source]

Determines if this expression is the built in class owl:Nothing. This method does not determine if the class is equivalent to owl:Nothing.

is_owl_thing() bool[source]

Determines if this expression is the built in class owl:Thing. This method does not determine if the class is equivalent to owl:Thing.

Returns:

Thing.

Return type:

True if this expression is owl

get_object_complement_of() OWLObjectComplementOf[source]

Gets the object complement of this class expression.

Returns:

A class expression that is the complement of this class expression.

get_nnf() OWLClassExpression[source]

Gets the negation normal form of the complement of this expression.

Returns:

A expression that represents the NNF of the complement of this expression.

class owlapy.class_expression.OWLBooleanClassExpression[source]

Bases: OWLAnonymousClassExpression

Represent an anonymous boolean class expression.

__slots__ = ()
class owlapy.class_expression.OWLObjectComplementOf(op: OWLClassExpression)[source]

Bases: OWLBooleanClassExpression, owlapy.meta_classes.HasOperands[OWLClassExpression]

Represents an ObjectComplementOf class expression in the OWL 2 Specification.

__slots__ = '_operand'
type_index: Final = 3003
get_operand() OWLClassExpression[source]
Returns:

The wrapped expression.

operands() Iterable[OWLClassExpression][source]

Gets the operands - e.g., the individuals in a sameAs axiom, or the classes in an equivalent classes axiom.

Returns:

The operands.

__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

class owlapy.class_expression.OWLClass(iri: owlapy.iri.IRI | str)[source]

Bases: owlapy.class_expression.class_expression.OWLClassExpression, owlapy.owl_object.OWLEntity

An OWL 2 named Class. Classes can be understood as sets of individuals. (https://www.w3.org/TR/owl2-syntax/#Classes)

property iri: owlapy.iri.IRI

Gets the IRI of this object.

Returns:

The IRI of this object.

property str

Gets the string representation of this object

Returns:

The IRI as string

property reminder: str

The reminder of the IRI

__slots__ = ('_iri', '_is_nothing', '_is_thing')
type_index: Final = 1001
is_owl_thing() bool[source]

Determines if this expression is the built in class owl:Thing. This method does not determine if the class is equivalent to owl:Thing.

Returns:

Thing.

Return type:

True if this expression is owl

is_owl_nothing() bool[source]

Determines if this expression is the built in class owl:Nothing. This method does not determine if the class is equivalent to owl:Nothing.

get_object_complement_of() owlapy.class_expression.class_expression.OWLObjectComplementOf[source]

Gets the object complement of this class expression.

Returns:

A class expression that is the complement of this class expression.

get_nnf() OWLClass[source]

Gets the negation normal form of the complement of this expression.

Returns:

A expression that represents the NNF of the complement of this expression.

class owlapy.class_expression.OWLNaryBooleanClassExpression(operands: Iterable[owlapy.class_expression.class_expression.OWLClassExpression])[source]

Bases: owlapy.class_expression.class_expression.OWLBooleanClassExpression, owlapy.meta_classes.HasOperands[owlapy.class_expression.class_expression.OWLClassExpression]

OWLNaryBooleanClassExpression.

__slots__ = ()
operands() Iterable[owlapy.class_expression.class_expression.OWLClassExpression][source]

Gets the operands - e.g., the individuals in a sameAs axiom, or the classes in an equivalent classes axiom.

Returns:

The operands.

__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

class owlapy.class_expression.OWLObjectUnionOf(operands: Iterable[owlapy.class_expression.class_expression.OWLClassExpression])[source]

Bases: OWLNaryBooleanClassExpression

A union class expression ObjectUnionOf( CE1 … CEn ) contains all individuals that are instances of at least one class expression CEi for 1 ≤ i ≤ n. (https://www.w3.org/TR/owl2-syntax/#Union_of_Class_Expressions)

__slots__ = '_operands'
type_index: Final = 3002
class owlapy.class_expression.OWLObjectIntersectionOf(operands: Iterable[owlapy.class_expression.class_expression.OWLClassExpression])[source]

Bases: OWLNaryBooleanClassExpression

An intersection class expression ObjectIntersectionOf( CE1 … CEn ) contains all individuals that are instances of all class expressions CEi for 1 ≤ i ≤ n. (https://www.w3.org/TR/owl2-syntax/#Intersection_of_Class_Expressions)

__slots__ = '_operands'
type_index: Final = 3001
class owlapy.class_expression.OWLRestriction[source]

Bases: owlapy.class_expression.class_expression.OWLAnonymousClassExpression

Represents an Object Property Restriction or Data Property Restriction in the OWL 2 specification.

__slots__ = ()
abstract get_property() owlapy.owl_property.OWLPropertyExpression[source]
Returns:

Property being restricted.

is_data_restriction() bool[source]

Determines if this is a data restriction.

Returns:

True if this is a data restriction.

is_object_restriction() bool[source]

Determines if this is an object restriction.

Returns:

True if this is an object restriction.

class owlapy.class_expression.OWLQuantifiedRestriction[source]

Bases: Generic[_T], OWLRestriction, owlapy.meta_classes.HasFiller[_T]

Represents a quantified restriction.

Parameters:

_T – value type

__slots__ = ()
class owlapy.class_expression.OWLQuantifiedObjectRestriction(filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLQuantifiedRestriction[owlapy.class_expression.class_expression.OWLClassExpression], OWLObjectRestriction

Represents a quantified object restriction.

__slots__ = ()
get_filler() owlapy.class_expression.class_expression.OWLClassExpression[source]

Gets the filler for this restriction. In the case of an object restriction this will be an individual, in the case of a data restriction this will be a constant (data value). For quantified restriction this will be a class expression or a data range.

Returns:

the value

class owlapy.class_expression.OWLObjectRestriction[source]

Bases: OWLRestriction

Represents an Object Property Restriction in the OWL 2 specification.

__slots__ = ()
is_object_restriction() bool[source]

Determines if this is an object restriction.

Returns:

True if this is an object restriction.

abstract get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLHasValueRestriction(value: _T)[source]

Bases: Generic[_T], OWLRestriction, owlapy.meta_classes.HasFiller[_T]

Represent a HasValue restriction in the OWL 2

Parameters:

_T – The value type.

__slots__ = ()
__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

get_filler() _T[source]

Gets the filler for this restriction. In the case of an object restriction this will be an individual, in the case of a data restriction this will be a constant (data value). For quantified restriction this will be a class expression or a data range.

Returns:

the value

class owlapy.class_expression.OWLDataRestriction[source]

Bases: OWLRestriction

Represents a Data Property Restriction.

__slots__ = ()
is_data_restriction() bool[source]

Determines if this is a data restriction.

Returns:

True if this is a data restriction.

class owlapy.class_expression.OWLCardinalityRestriction(cardinality: int, filler: _F)[source]

Bases: Generic[_F], OWLQuantifiedRestriction[_F], owlapy.meta_classes.HasCardinality

Base interface for owl min and max cardinality restriction.

Parameters:

_F – Type of filler.

__slots__ = ()
get_cardinality() int[source]

Gets the cardinality of a restriction.

Returns:

The cardinality. A non-negative integer.

get_filler() _F[source]

Gets the filler for this restriction. In the case of an object restriction this will be an individual, in the case of a data restriction this will be a constant (data value). For quantified restriction this will be a class expression or a data range.

Returns:

the value

class owlapy.class_expression.OWLObjectCardinalityRestriction(cardinality: int, property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLCardinalityRestriction[owlapy.class_expression.class_expression.OWLClassExpression], OWLQuantifiedObjectRestriction

Represents Object Property Cardinality Restrictions in the OWL 2 specification.

__slots__ = ()
get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

class owlapy.class_expression.OWLObjectHasSelf(property: owlapy.owl_property.OWLObjectPropertyExpression)[source]

Bases: OWLObjectRestriction

A self-restriction ObjectHasSelf( OPE ) consists of an object property expression OPE, and it contains all those individuals that are connected by OPE to themselves. (https://www.w3.org/TR/owl2-syntax/#Self-Restriction)

__slots__ = '_property'
type_index: Final = 3011
get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLDataOneOf(values: owlapy.owl_literal.OWLLiteral | Iterable[owlapy.owl_literal.OWLLiteral])[source]

Bases: owlapy.owl_data_ranges.OWLDataRange, owlapy.meta_classes.HasOperands[owlapy.owl_literal.OWLLiteral]

An enumeration of literals DataOneOf( lt1 … ltn ) contains exactly the explicitly specified literals lti with 1 ≤ i ≤ n. The resulting data range has arity one. (https://www.w3.org/TR/owl2-syntax/#Enumeration_of_Literals)

type_index: Final = 4003
values() Iterable[owlapy.owl_literal.OWLLiteral][source]

Gets the values that are in the oneOf.

Returns:

The values of this {@code DataOneOf} class expression.

operands() Iterable[owlapy.owl_literal.OWLLiteral][source]

Gets the operands - e.g., the individuals in a sameAs axiom, or the classes in an equivalent classes axiom.

Returns:

The operands.

__hash__()[source]

Return hash(self).

__eq__(other)[source]

Return self==value.

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLQuantifiedDataRestriction(filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLQuantifiedRestriction[owlapy.owl_data_ranges.OWLDataRange], OWLDataRestriction

Represents a quantified data restriction.

__slots__ = ()
get_filler() owlapy.owl_data_ranges.OWLDataRange[source]

Gets the filler for this restriction. In the case of an object restriction this will be an individual, in the case of a data restriction this will be a constant (data value). For quantified restriction this will be a class expression or a data range.

Returns:

the value

class owlapy.class_expression.OWLDataCardinalityRestriction(cardinality: int, property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLCardinalityRestriction[owlapy.owl_data_ranges.OWLDataRange], OWLQuantifiedDataRestriction, OWLDataRestriction

Represents Data Property Cardinality Restrictions.

__slots__ = ()
get_property() owlapy.owl_property.OWLDataPropertyExpression[source]
Returns:

Property being restricted.

__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

class owlapy.class_expression.OWLObjectSomeValuesFrom(property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLQuantifiedObjectRestriction

An existential class expression ObjectSomeValuesFrom( OPE CE ) consists of an object property expression OPE and a class expression CE, and it contains all those individuals that are connected by OPE to an individual that is an instance of CE.

__slots__ = ('_property', '_filler')
type_index: Final = 3005
__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLObjectAllValuesFrom(property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLQuantifiedObjectRestriction

A universal class expression ObjectAllValuesFrom( OPE CE ) consists of an object property expression OPE and a class expression CE, and it contains all those individuals that are connected by OPE only to individuals that are instances of CE. (https://www.w3.org/TR/owl2-syntax/#Universal_Quantification)

__slots__ = ('_property', '_filler')
type_index: Final = 3006
__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLObjectHasValue(property: owlapy.owl_property.OWLObjectPropertyExpression, individual: owlapy.owl_individual.OWLIndividual)[source]

Bases: OWLHasValueRestriction[owlapy.owl_individual.OWLIndividual], OWLObjectRestriction

A has-value class expression ObjectHasValue( OPE a ) consists of an object property expression OPE and an individual a, and it contains all those individuals that are connected by OPE to a. Each such class expression can be seen as a syntactic shortcut for the class expression ObjectSomeValuesFrom( OPE ObjectOneOf( a ) ). (https://www.w3.org/TR/owl2-syntax/#Individual_Value_Restriction)

__slots__ = ('_property', '_v')
type_index: Final = 3007
get_property() owlapy.owl_property.OWLObjectPropertyExpression[source]
Returns:

Property being restricted.

as_some_values_from() owlapy.class_expression.class_expression.OWLClassExpression[source]

A convenience method that obtains this restriction as an existential restriction with a nominal filler.

Returns:

The existential equivalent of this value restriction. simp(HasValue(p a)) = some(p {a}).

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLDatatypeRestriction(type_: owlapy.owl_datatype.OWLDatatype, facet_restrictions: OWLFacetRestriction | Iterable[OWLFacetRestriction])[source]

Bases: owlapy.owl_data_ranges.OWLDataRange

A datatype restriction DatatypeRestriction( DT F1 lt1 … Fn ltn ) consists of a unary datatype DT and n pairs ( Fi , lti ). The resulting data range is unary and is obtained by restricting the value space of DT according to the semantics of all ( Fi , vi ) (multiple pairs are interpreted conjunctively), where vi are the data values of the literals lti. (https://www.w3.org/TR/owl2-syntax/#Datatype_Restrictions)

__slots__ = ('_type', '_facet_restrictions')
type_index: Final = 4006
get_datatype() owlapy.owl_datatype.OWLDatatype[source]
get_facet_restrictions() Sequence[OWLFacetRestriction][source]
__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLFacet(remainder: str, symbolic_form: str, operator: Callable[[_X, _X], bool])[source]

Bases: _Vocabulary, enum.Enum

Enumerations for OWL facets.

property symbolic_form
property operator
MIN_INCLUSIVE: Final = ('minInclusive', '>=')
MIN_EXCLUSIVE: Final = ('minExclusive', '>')
MAX_INCLUSIVE: Final = ('maxInclusive', '<=')
MAX_EXCLUSIVE: Final = ('maxExclusive', '<')
LENGTH: Final = ('length', 'length')
MIN_LENGTH: Final = ('minLength', 'minLength')
MAX_LENGTH: Final = ('maxLength', 'maxLength')
PATTERN: Final = ('pattern', 'pattern')
TOTAL_DIGITS: Final = ('totalDigits', 'totalDigits')
FRACTION_DIGITS: Final = ('fractionDigits', 'fractionDigits')
static from_str(name: str) OWLFacet[source]
class owlapy.class_expression.OWLFacetRestriction(facet: owlapy.vocab.OWLFacet, literal: Literals)[source]

Bases: owlapy.owl_object.OWLObject

A facet restriction is used to restrict a particular datatype.

__slots__ = ('_facet', '_literal')
type_index: Final = 4007
get_facet() owlapy.vocab.OWLFacet[source]
get_facet_value() owlapy.owl_literal.OWLLiteral[source]
__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLObjectMinCardinality(cardinality: int, property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLObjectCardinalityRestriction

A minimum cardinality expression ObjectMinCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE to at least n different individuals that are instances of CE. (https://www.w3.org/TR/owl2-syntax/#Minimum_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3008
class owlapy.class_expression.OWLObjectMaxCardinality(cardinality: int, property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLObjectCardinalityRestriction

A maximum cardinality expression ObjectMaxCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE

to at most n different individuals that are instances of CE. (https://www.w3.org/TR/owl2-syntax/#Maximum_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3010
class owlapy.class_expression.OWLObjectExactCardinality(cardinality: int, property: owlapy.owl_property.OWLObjectPropertyExpression, filler: owlapy.class_expression.class_expression.OWLClassExpression)[source]

Bases: OWLObjectCardinalityRestriction

An exact cardinality expression ObjectExactCardinality( n OPE CE ) consists of a nonnegative integer n, an object

property expression OPE, and a class expression CE, and it contains all those individuals that are connected by to exactly n different individuals that are instances of CE.

(https://www.w3.org/TR/owl2-syntax/#Exact_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3009
as_intersection_of_min_max() owlapy.class_expression.nary_boolean_expression.OWLObjectIntersectionOf[source]

Obtains an equivalent form that is a conjunction of a min cardinality and max cardinality restriction.

Returns:

The semantically equivalent but structurally simpler form (= 1 R C) = >= 1 R C and <= 1 R C.

class owlapy.class_expression.OWLDataSomeValuesFrom(property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLQuantifiedDataRestriction

An existential class expression DataSomeValuesFrom( DPE1 … DPEn DR ) consists of n data property expressions DPEi, 1 ≤ i ≤ n, and a data range DR whose arity must be n. Such a class expression contains all those individuals that are connected by DPEi to literals lti, 1 ≤ i ≤ n, such that the tuple ( lt1 , …, ltn ) is in DR. A class expression of the form DataSomeValuesFrom( DPE DR ) can be seen as a syntactic shortcut for the class expression DataMinCardinality( 1 DPE DR ). (https://www.w3.org/TR/owl2-syntax/#Existential_Quantification_2)

__slots__ = '_property'
type_index: Final = 3012
__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

get_property() owlapy.owl_property.OWLDataPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLDataAllValuesFrom(property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLQuantifiedDataRestriction

A universal class expression DataAllValuesFrom( DPE1 … DPEn DR ) consists of n data property expressions DPEi, 1 ≤ i ≤ n, and a data range DR whose arity must be n. Such a class expression contains all those individuals that

are connected by DPEi only to literals lti, 1 ≤ i ≤ n, such that each tuple ( lt1 , …, ltn ) is in DR. A class

expression of the form DataAllValuesFrom( DPE DR ) can be seen as a syntactic shortcut for the class expression DataMaxCardinality( 0 DPE DataComplementOf( DR ) ). (https://www.w3.org/TR/owl2-syntax/#Universal_Quantification_2)

__slots__ = '_property'
type_index: Final = 3013
__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

get_property() owlapy.owl_property.OWLDataPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLDataHasValue(property: owlapy.owl_property.OWLDataPropertyExpression, value: owlapy.owl_literal.OWLLiteral)[source]

Bases: OWLHasValueRestriction[owlapy.owl_literal.OWLLiteral], OWLDataRestriction

A has-value class expression DataHasValue( DPE lt ) consists of a data property expression DPE and a literal lt, and it contains all those individuals that are connected by DPE to lt. Each such class expression can be seen as a syntactic shortcut for the class expression DataSomeValuesFrom( DPE DataOneOf( lt ) ). (https://www.w3.org/TR/owl2-syntax/#Literal_Value_Restriction)

__slots__ = '_property'
type_index: Final = 3014
__repr__()[source]

Return repr(self).

__eq__(other)[source]

Return self==value.

__hash__()[source]

Return hash(self).

as_some_values_from() owlapy.class_expression.class_expression.OWLClassExpression[source]

A convenience method that obtains this restriction as an existential restriction with a nominal filler.

Returns:

The existential equivalent of this value restriction. simp(HasValue(p a)) = some(p {a}).

get_property() owlapy.owl_property.OWLDataPropertyExpression[source]
Returns:

Property being restricted.

class owlapy.class_expression.OWLDataMinCardinality(cardinality: int, property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLDataCardinalityRestriction

A minimum cardinality expression DataMinCardinality( n DPE DR ) consists of a nonnegative integer n, a data property expression DPE, and a unary data range DR, and it contains all those individuals that are connected by DPE to at least n different literals in DR. (https://www.w3.org/TR/owl2-syntax/#Minimum_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3015
class owlapy.class_expression.OWLDataMaxCardinality(cardinality: int, property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLDataCardinalityRestriction

A maximum cardinality expression ObjectMaxCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected by OPE to at most n different individuals that are instances of CE. (https://www.w3.org/TR/owl2-syntax/#Maximum_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3017
class owlapy.class_expression.OWLDataExactCardinality(cardinality: int, property: owlapy.owl_property.OWLDataPropertyExpression, filler: owlapy.owl_data_ranges.OWLDataRange)[source]

Bases: OWLDataCardinalityRestriction

An exact cardinality expression ObjectExactCardinality( n OPE CE ) consists of a nonnegative integer n, an object property expression OPE, and a class expression CE, and it contains all those individuals that are connected

by OPE to exactly n different individuals that are instances of CE (https://www.w3.org/TR/owl2-syntax/#Exact_Cardinality)

__slots__ = ('_cardinality', '_filler', '_property')
type_index: Final = 3016
as_intersection_of_min_max() owlapy.class_expression.nary_boolean_expression.OWLObjectIntersectionOf[source]

Obtains an equivalent form that is a conjunction of a min cardinality and max cardinality restriction.

Returns:

The semantically equivalent but structurally simpler form (= 1 R D) = >= 1 R D and <= 1 R D.

class owlapy.class_expression.OWLObjectOneOf(values: owlapy.owl_individual.OWLIndividual | Iterable[owlapy.owl_individual.OWLIndividual])[source]

Bases: owlapy.class_expression.class_expression.OWLAnonymousClassExpression, owlapy.meta_classes.HasOperands[owlapy.owl_individual.OWLIndividual]

An enumeration of individuals ObjectOneOf( a1 … an ) contains exactly the individuals ai with 1 ≤ i ≤ n. (https://www.w3.org/TR/owl2-syntax/#Enumeration_of_Individuals)

__slots__ = '_values'
type_index: Final = 3004
individuals() Iterable[owlapy.owl_individual.OWLIndividual][source]

Gets the individuals that are in the oneOf. These individuals represent the exact instances (extension) of this class expression.

Returns:

The individuals that are the values of this {@code ObjectOneOf} class expression.

operands() Iterable[owlapy.owl_individual.OWLIndividual][source]

Gets the operands - e.g., the individuals in a sameAs axiom, or the classes in an equivalent classes axiom.

Returns:

The operands.

as_object_union_of() owlapy.class_expression.class_expression.OWLClassExpression[source]

Simplifies this enumeration to a union of singleton nominals.

Returns:

This enumeration in a more standard DL form. simp({a}) = {a} simp({a0, … , {an}) = unionOf({a0}, … , {an})

__hash__()[source]

Return hash(self).

__eq__(other)[source]

Return self==value.

__repr__()[source]

Return repr(self).

class owlapy.class_expression.OWLRDFVocabulary(namespace: owlapy.namespaces.Namespaces, remainder: str)[source]

Bases: _Vocabulary, enum.Enum

Enumerations for OWL/RDF vocabulary.

OWL_THING = ()
OWL_NOTHING = ()
OWL_CLASS = ()
OWL_NAMED_INDIVIDUAL = ()
OWL_TOP_OBJECT_PROPERTY = ()
OWL_BOTTOM_OBJECT_PROPERTY = ()
OWL_TOP_DATA_PROPERTY = ()
OWL_BOTTOM_DATA_PROPERTY = ()
RDFS_LITERAL = ()
owlapy.class_expression.OWLThing: Final
owlapy.class_expression.OWLNothing: Final