diff --git a/_modules/owlapy/class_expression/nary_boolean_expression.html b/_modules/owlapy/class_expression/nary_boolean_expression.html index 8c05695..35c7f02 100644 --- a/_modules/owlapy/class_expression/nary_boolean_expression.html +++ b/_modules/owlapy/class_expression/nary_boolean_expression.html @@ -100,8 +100,11 @@

Source code for owlapy.class_expression.nary_boolean_expression

Args: operands: Class expressions. """ + # TODO: CD: Replace tuple with set self._operands = tuple(operands) + assert len(self._operands)>1, "OWLNaryBooleanClassExpression requires at least one operand." +
[docs] def operands(self) -> Iterable[OWLClassExpression]: @@ -119,8 +122,9 @@

Source code for owlapy.class_expression.nary_boolean_expression

[docs] def __eq__(self, other): if type(other) is type(self): - return self._operands == other._operands - return NotImplemented
+ return {i for i in self._operands} == { j for j in other.operands()} + else: + return False
diff --git a/_modules/owlapy/class_expression/restriction.html b/_modules/owlapy/class_expression/restriction.html index 8a28631..05ab71f 100644 --- a/_modules/owlapy/class_expression/restriction.html +++ b/_modules/owlapy/class_expression/restriction.html @@ -284,7 +284,7 @@

Source code for owlapy.class_expression.restriction

__slots__ = () _property: OWLObjectPropertyExpression - + # @TODO: CD: property shows the in-built function @abstractmethod def __init__(self, cardinality: int, property: OWLObjectPropertyExpression, filler: OWLClassExpression): super().__init__(cardinality, filler) @@ -311,8 +311,8 @@

Source code for owlapy.class_expression.restriction

return self._property == other._property \ and self._cardinality == other._cardinality \ and self._filler == other._filler - return NotImplemented
- + else: + return False
[docs] @@ -466,7 +466,7 @@

Source code for owlapy.class_expression.restriction

individuals that are instances of CE. (https://www.w3.org/TR/owl2-syntax/#Universal_Quantification)""" __slots__ = '_property', '_filler' type_index: Final = 3006 - + # @TODO: CD: property shows the in-built function def __init__(self, property: OWLObjectPropertyExpression, filler: OWLClassExpression): super().__init__(filler) self._property = property @@ -482,7 +482,8 @@

Source code for owlapy.class_expression.restriction

def __eq__(self, other): if type(other) is type(self): return self._filler == other._filler and self._property == other._property - return NotImplemented
+ else: + return False
@@ -535,7 +536,8 @@

Source code for owlapy.class_expression.restriction

def __eq__(self, other): if type(other) is type(self): return self._property == other._property - return NotImplemented
+ else: + return False
@@ -565,7 +567,7 @@

Source code for owlapy.class_expression.restriction

_property: OWLObjectPropertyExpression _v: OWLIndividual - + # @TODO: CD: property shows the in-built function def __init__(self, property: OWLObjectPropertyExpression, individual: OWLIndividual): """ Args: @@ -667,7 +669,8 @@

Source code for owlapy.class_expression.restriction

def __eq__(self, other): if type(other) is type(self): return self._values == other._values - return NotImplemented
+ else: + return False
@@ -694,9 +697,7 @@

Source code for owlapy.class_expression.restriction

def is_data_restriction(self) -> bool: # documented in parent return True
- - - pass
+
@@ -712,7 +713,7 @@

Source code for owlapy.class_expression.restriction

def __init__(self, filler: OWLDataRange): assert isinstance(filler, OWLDataRange), "filler must be an OWLDataRange" self._filler = filler - + # @TODO:CD: define it as @property
[docs] def get_filler(self) -> OWLDataRange: @@ -731,7 +732,7 @@

Source code for owlapy.class_expression.restriction

__slots__ = () _property: OWLDataPropertyExpression - + # @TODO: CD: property shows the in-built function @abstractmethod def __init__(self, cardinality: int, property: OWLDataPropertyExpression, filler: OWLDataRange): assert isinstance(filler, OWLDataRange), "filler must be an OWLDataRange" @@ -781,7 +782,7 @@

Source code for owlapy.class_expression.restriction

__slots__ = '_cardinality', '_filler', '_property' type_index: Final = 3015 - + # @TODO: CD: property shows the in-built function def __init__(self, cardinality: int, property: OWLDataPropertyExpression, filler: OWLDataRange): """ Args: @@ -807,7 +808,7 @@

Source code for owlapy.class_expression.restriction

__slots__ = '_cardinality', '_filler', '_property' type_index: Final = 3017 - + # @TODO: CD: property shows the in-built function def __init__(self, cardinality: int, property: OWLDataPropertyExpression, filler: OWLDataRange): """ Args: @@ -833,7 +834,7 @@

Source code for owlapy.class_expression.restriction

__slots__ = '_cardinality', '_filler', '_property' type_index: Final = 3016 - + # @TODO: CD: property shows the in-built function def __init__(self, cardinality: int, property: OWLDataPropertyExpression, filler: OWLDataRange): """ Args: @@ -875,7 +876,7 @@

Source code for owlapy.class_expression.restriction

type_index: Final = 3012 _property: OWLDataPropertyExpression - + # @TODO: CD: property shows the in-built function def __init__(self, property: OWLDataPropertyExpression, filler: OWLDataRange): """Gets an OWLDataSomeValuesFrom restriction. @@ -900,8 +901,8 @@

Source code for owlapy.class_expression.restriction

def __eq__(self, other): if type(other) is type(self): return self._filler == other._filler and self._property == other._property - return NotImplemented
- + else: + return False
[docs] @@ -933,7 +934,7 @@

Source code for owlapy.class_expression.restriction

type_index: Final = 3013 _property: OWLDataPropertyExpression - + # @TODO:CD:property shows the in-built function def __init__(self, property: OWLDataPropertyExpression, filler: OWLDataRange): """Gets an OWLDataAllValuesFrom restriction. @@ -958,7 +959,8 @@

Source code for owlapy.class_expression.restriction

def __eq__(self, other): if type(other) is type(self): return self._filler == other._filler and self._property == other._property - return NotImplemented
+ else: + return False
@@ -985,11 +987,13 @@

Source code for owlapy.class_expression.restriction

(https://www.w3.org/TR/owl2-syntax/#Literal_Value_Restriction) """ __slots__ = '_property' + # @TODO:CD:What is _v? even if it is inherited from somewhere, we should add it into docstring. + # @TODO:CD: We should also name the class attributes in a more meaningful manner. type_index: Final = 3014 _property: OWLDataPropertyExpression - + # @TODO: CD: property shows the in-built function def __init__(self, property: OWLDataPropertyExpression, value: OWLLiteral): """Gets an OWLDataHasValue restriction. @@ -1059,7 +1063,7 @@

Source code for owlapy.class_expression.restriction

for _ in values: assert isinstance(_, OWLLiteral) self._values = tuple(values) - + # TODO:CD: define it as @property as the name of the class method does not correspond to an action
[docs] def values(self) -> Iterable[OWLLiteral]: @@ -1088,8 +1092,9 @@

Source code for owlapy.class_expression.restriction

[docs] def __eq__(self, other): if type(other) is type(self): - return self._values == other._values - return NotImplemented
+ return {i for i in self._values} == {j for j in other._values} + else: + return False
diff --git a/owlapy.pdf b/owlapy.pdf index 510c8c1..9112437 100644 Binary files a/owlapy.pdf and b/owlapy.pdf differ