fuzzy-dl-owl2 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. fuzzy_dl_owl2/__init__.py +2 -0
  2. fuzzy_dl_owl2/fuzzydl/__init__.py +23 -0
  3. fuzzy_dl_owl2/fuzzydl/assertion/__init__.py +2 -0
  4. fuzzy_dl_owl2/fuzzydl/assertion/assertion.py +72 -0
  5. fuzzy_dl_owl2/fuzzydl/assertion/atomic_assertion.py +19 -0
  6. fuzzy_dl_owl2/fuzzydl/concept/__init__.py +13 -0
  7. fuzzy_dl_owl2/fuzzydl/concept/all_some_concept.py +85 -0
  8. fuzzy_dl_owl2/fuzzydl/concept/approximation_concept.py +147 -0
  9. fuzzy_dl_owl2/fuzzydl/concept/atomic_concept.py +91 -0
  10. fuzzy_dl_owl2/fuzzydl/concept/choquet_integral.py +64 -0
  11. fuzzy_dl_owl2/fuzzydl/concept/concept.py +230 -0
  12. fuzzy_dl_owl2/fuzzydl/concept/concrete/__init__.py +10 -0
  13. fuzzy_dl_owl2/fuzzydl/concept/concrete/crisp_concrete_concept.py +60 -0
  14. fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_concrete_concept.py +63 -0
  15. fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/__init__.py +1 -0
  16. fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/triangular_fuzzy_number.py +127 -0
  17. fuzzy_dl_owl2/fuzzydl/concept/concrete/left_concrete_concept.py +70 -0
  18. fuzzy_dl_owl2/fuzzydl/concept/concrete/linear_concrete_concept.py +70 -0
  19. fuzzy_dl_owl2/fuzzydl/concept/concrete/modified_concrete_concept.py +66 -0
  20. fuzzy_dl_owl2/fuzzydl/concept/concrete/right_concrete_concept.py +70 -0
  21. fuzzy_dl_owl2/fuzzydl/concept/concrete/trapezoidal_concrete_concept.py +96 -0
  22. fuzzy_dl_owl2/fuzzydl/concept/concrete/triangular_concrete_concept.py +89 -0
  23. fuzzy_dl_owl2/fuzzydl/concept/ext_threshold_concept.py +77 -0
  24. fuzzy_dl_owl2/fuzzydl/concept/has_value_concept.py +51 -0
  25. fuzzy_dl_owl2/fuzzydl/concept/implies_concept.py +144 -0
  26. fuzzy_dl_owl2/fuzzydl/concept/interface/__init__.py +6 -0
  27. fuzzy_dl_owl2/fuzzydl/concept/interface/has_concept_interface.py +17 -0
  28. fuzzy_dl_owl2/fuzzydl/concept/interface/has_concepts_interface.py +18 -0
  29. fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_concept_interface.py +14 -0
  30. fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_interface.py +15 -0
  31. fuzzy_dl_owl2/fuzzydl/concept/interface/has_value_interface.py +21 -0
  32. fuzzy_dl_owl2/fuzzydl/concept/interface/has_weighted_concepts_interface.py +29 -0
  33. fuzzy_dl_owl2/fuzzydl/concept/modified/__init__.py +3 -0
  34. fuzzy_dl_owl2/fuzzydl/concept/modified/linearly_modified_concept.py +32 -0
  35. fuzzy_dl_owl2/fuzzydl/concept/modified/modified_concept.py +59 -0
  36. fuzzy_dl_owl2/fuzzydl/concept/modified/triangularly_modified_concept.py +33 -0
  37. fuzzy_dl_owl2/fuzzydl/concept/negated_nominal.py +42 -0
  38. fuzzy_dl_owl2/fuzzydl/concept/operator_concept.py +707 -0
  39. fuzzy_dl_owl2/fuzzydl/concept/owa_concept.py +57 -0
  40. fuzzy_dl_owl2/fuzzydl/concept/qowa_concept.py +62 -0
  41. fuzzy_dl_owl2/fuzzydl/concept/quasi_sugeno_integral.py +46 -0
  42. fuzzy_dl_owl2/fuzzydl/concept/self_concept.py +45 -0
  43. fuzzy_dl_owl2/fuzzydl/concept/string_concept.py +35 -0
  44. fuzzy_dl_owl2/fuzzydl/concept/sugeno_integral.py +83 -0
  45. fuzzy_dl_owl2/fuzzydl/concept/threshold_concept.py +81 -0
  46. fuzzy_dl_owl2/fuzzydl/concept/truth_concept.py +83 -0
  47. fuzzy_dl_owl2/fuzzydl/concept/value_concept.py +67 -0
  48. fuzzy_dl_owl2/fuzzydl/concept/weighted_concept.py +55 -0
  49. fuzzy_dl_owl2/fuzzydl/concept/weighted_max_concept.py +63 -0
  50. fuzzy_dl_owl2/fuzzydl/concept/weighted_min_concept.py +57 -0
  51. fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_concept.py +62 -0
  52. fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_zero_concept.py +62 -0
  53. fuzzy_dl_owl2/fuzzydl/concept_equivalence.py +20 -0
  54. fuzzy_dl_owl2/fuzzydl/concrete_feature.py +94 -0
  55. fuzzy_dl_owl2/fuzzydl/degree/__init__.py +4 -0
  56. fuzzy_dl_owl2/fuzzydl/degree/degree.py +79 -0
  57. fuzzy_dl_owl2/fuzzydl/degree/degree_expression.py +57 -0
  58. fuzzy_dl_owl2/fuzzydl/degree/degree_numeric.py +57 -0
  59. fuzzy_dl_owl2/fuzzydl/degree/degree_variable.py +54 -0
  60. fuzzy_dl_owl2/fuzzydl/domain_axiom.py +8 -0
  61. fuzzy_dl_owl2/fuzzydl/exception/__init__.py +2 -0
  62. fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py +4 -0
  63. fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py +4 -0
  64. fuzzy_dl_owl2/fuzzydl/feature_function.py +148 -0
  65. fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +920 -0
  66. fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2_java.py +953 -0
  67. fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py +82 -0
  68. fuzzy_dl_owl2/fuzzydl/individual/__init__.py +3 -0
  69. fuzzy_dl_owl2/fuzzydl/individual/created_individual.py +219 -0
  70. fuzzy_dl_owl2/fuzzydl/individual/individual.py +113 -0
  71. fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py +37 -0
  72. fuzzy_dl_owl2/fuzzydl/knowledge_base.py +9037 -0
  73. fuzzy_dl_owl2/fuzzydl/label.py +32 -0
  74. fuzzy_dl_owl2/fuzzydl/milp/__init__.py +7 -0
  75. fuzzy_dl_owl2/fuzzydl/milp/expression.py +186 -0
  76. fuzzy_dl_owl2/fuzzydl/milp/inequation.py +55 -0
  77. fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +787 -0
  78. fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py +151 -0
  79. fuzzy_dl_owl2/fuzzydl/milp/solution.py +45 -0
  80. fuzzy_dl_owl2/fuzzydl/milp/term.py +76 -0
  81. fuzzy_dl_owl2/fuzzydl/milp/variable.py +89 -0
  82. fuzzy_dl_owl2/fuzzydl/modifier/__init__.py +3 -0
  83. fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py +76 -0
  84. fuzzy_dl_owl2/fuzzydl/modifier/modifier.py +39 -0
  85. fuzzy_dl_owl2/fuzzydl/modifier/triangular_modifier.py +76 -0
  86. fuzzy_dl_owl2/fuzzydl/parser/ParserConstants.py +406 -0
  87. fuzzy_dl_owl2/fuzzydl/parser/__init__.py +1 -0
  88. fuzzy_dl_owl2/fuzzydl/parser/dl_parser.py +2029 -0
  89. fuzzy_dl_owl2/fuzzydl/parser/ebnf.lark +290 -0
  90. fuzzy_dl_owl2/fuzzydl/parser/larkx.py +70 -0
  91. fuzzy_dl_owl2/fuzzydl/primitive_concept_definition.py +81 -0
  92. fuzzy_dl_owl2/fuzzydl/query/__init__.py +14 -0
  93. fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +50 -0
  94. fuzzy_dl_owl2/fuzzydl/query/bnp_query.py +22 -0
  95. fuzzy_dl_owl2/fuzzydl/query/defuzzify/__init__.py +4 -0
  96. fuzzy_dl_owl2/fuzzydl/query/defuzzify/defuzzify_query.py +76 -0
  97. fuzzy_dl_owl2/fuzzydl/query/defuzzify/lom_defuzzify_query.py +19 -0
  98. fuzzy_dl_owl2/fuzzydl/query/defuzzify/mom_defuzzify_query.py +88 -0
  99. fuzzy_dl_owl2/fuzzydl/query/defuzzify/som_defuzzify_query.py +20 -0
  100. fuzzy_dl_owl2/fuzzydl/query/instance_query.py +19 -0
  101. fuzzy_dl_owl2/fuzzydl/query/kb_satisfiable_query.py +32 -0
  102. fuzzy_dl_owl2/fuzzydl/query/max/__init__.py +5 -0
  103. fuzzy_dl_owl2/fuzzydl/query/max/max_instance_query.py +45 -0
  104. fuzzy_dl_owl2/fuzzydl/query/max/max_query.py +31 -0
  105. fuzzy_dl_owl2/fuzzydl/query/max/max_related_query.py +45 -0
  106. fuzzy_dl_owl2/fuzzydl/query/max/max_satisfiable_query.py +73 -0
  107. fuzzy_dl_owl2/fuzzydl/query/max/max_subsumes_query.py +64 -0
  108. fuzzy_dl_owl2/fuzzydl/query/min/__init__.py +5 -0
  109. fuzzy_dl_owl2/fuzzydl/query/min/min_instance_query.py +50 -0
  110. fuzzy_dl_owl2/fuzzydl/query/min/min_query.py +31 -0
  111. fuzzy_dl_owl2/fuzzydl/query/min/min_related_query.py +57 -0
  112. fuzzy_dl_owl2/fuzzydl/query/min/min_satisfiable_query.py +80 -0
  113. fuzzy_dl_owl2/fuzzydl/query/min/min_subsumes_query.py +65 -0
  114. fuzzy_dl_owl2/fuzzydl/query/query.py +38 -0
  115. fuzzy_dl_owl2/fuzzydl/query/related_query.py +15 -0
  116. fuzzy_dl_owl2/fuzzydl/query/satisfiable_query.py +37 -0
  117. fuzzy_dl_owl2/fuzzydl/query/subsumption_query.py +20 -0
  118. fuzzy_dl_owl2/fuzzydl/range_axiom.py +7 -0
  119. fuzzy_dl_owl2/fuzzydl/relation.py +47 -0
  120. fuzzy_dl_owl2/fuzzydl/restriction/__init__.py +2 -0
  121. fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py +16 -0
  122. fuzzy_dl_owl2/fuzzydl/restriction/restriction.py +34 -0
  123. fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py +10 -0
  124. fuzzy_dl_owl2/fuzzydl/util/__init__.py +3 -0
  125. fuzzy_dl_owl2/fuzzydl/util/config_reader.py +56 -0
  126. fuzzy_dl_owl2/fuzzydl/util/constants.py +424 -0
  127. fuzzy_dl_owl2/fuzzydl/util/util.py +73 -0
  128. fuzzy_dl_owl2/fuzzyowl2/__init__.py +5 -0
  129. fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +1513 -0
  130. fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_java.py +1409 -0
  131. fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py +917 -0
  132. fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl_java.py +956 -0
  133. fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py +0 -0
  134. fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py +19 -0
  135. fuzzy_dl_owl2/fuzzyowl2/owl_types/concept_definition.py +14 -0
  136. fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_datatype.py +22 -0
  137. fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_modifier.py +4 -0
  138. fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_nominal_concept.py +19 -0
  139. fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_property.py +5 -0
  140. fuzzy_dl_owl2/fuzzyowl2/owl_types/left_shoulder_function.py +17 -0
  141. fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py +17 -0
  142. fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py +13 -0
  143. fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py +19 -0
  144. fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py +17 -0
  145. fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +15 -0
  146. fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py +19 -0
  147. fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py +10 -0
  148. fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py +19 -0
  149. fuzzy_dl_owl2/fuzzyowl2/owl_types/quasi_sugeno_concept.py +21 -0
  150. fuzzy_dl_owl2/fuzzyowl2/owl_types/right_shoulder_function.py +17 -0
  151. fuzzy_dl_owl2/fuzzyowl2/owl_types/sugeno_concept.py +21 -0
  152. fuzzy_dl_owl2/fuzzyowl2/owl_types/trapezoidal_function.py +25 -0
  153. fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_function.py +21 -0
  154. fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_modifer.py +21 -0
  155. fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_concept.py +19 -0
  156. fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py +15 -0
  157. fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py +15 -0
  158. fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py +15 -0
  159. fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py +15 -0
  160. fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +1 -0
  161. fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +491 -0
  162. fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +1 -0
  163. fuzzy_dl_owl2/fuzzyowl2/util/constants.py +112 -0
  164. fuzzy_dl_owl2-1.0.0.dist-info/LICENSE +427 -0
  165. fuzzy_dl_owl2-1.0.0.dist-info/METADATA +299 -0
  166. fuzzy_dl_owl2-1.0.0.dist-info/RECORD +167 -0
  167. fuzzy_dl_owl2-1.0.0.dist-info/WHEEL +4 -0
File without changes
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class ChoquetConcept(ConceptDefinition):
6
+
7
+ def __init__(self, weights: list[float], concepts: list[str]) -> None:
8
+ super().__init__(ConceptType.CHOQUET)
9
+ self._weights: list[float] = weights
10
+ self._concepts: list[str] = concepts
11
+
12
+ def get_weights(self) -> list[float]:
13
+ return self._weights
14
+
15
+ def get_concepts(self) -> list[str]:
16
+ return self._concepts
17
+
18
+ def __str__(self) -> str:
19
+ return f"(choquet ({' '.join(map(str, self._weights))}) ({' '.join(self._concepts)}))"
@@ -0,0 +1,14 @@
1
+ import abc
2
+
3
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
4
+
5
+
6
+ class ConceptDefinition(abc.ABC):
7
+ def __init__(self, type: ConceptType) -> None:
8
+ self._type: ConceptType = type
9
+
10
+ def get_type(self) -> ConceptType:
11
+ return self._type
12
+
13
+ def __repr__(self) -> str:
14
+ return str(self)
@@ -0,0 +1,22 @@
1
+ import abc
2
+
3
+ class FuzzyDatatype(abc.ABC):
4
+
5
+ def __init__(self) -> None:
6
+ self._k1: float = 0.0
7
+ self._k2: float = 0.0
8
+
9
+ def get_min_value(self) -> float:
10
+ return self._k1
11
+
12
+ def get_max_value(self) -> float:
13
+ return self._k2
14
+
15
+ def set_min_value(self, min: float) -> None:
16
+ self._k1 = min
17
+
18
+ def set_max_value(self, max: float) -> None:
19
+ self._k2 = max
20
+
21
+ def __repr__(self) -> str:
22
+ return str(self)
@@ -0,0 +1,4 @@
1
+ import abc
2
+
3
+ class FuzzyModifier(abc.ABC):
4
+ pass
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class FuzzyNominalConcept(ConceptDefinition):
6
+
7
+ def __init__(self, n: float, i: str) -> None:
8
+ super().__init__(ConceptType.FUZZY_NOMINAL)
9
+ self._n: float = n
10
+ self._i: str = i
11
+
12
+ def get_degree(self) -> float:
13
+ return self._n
14
+
15
+ def get_individual(self) -> str:
16
+ return self._i
17
+
18
+ def __str__(self) -> str:
19
+ return f"({self.get_degree()}, {self.get_individual()})"
@@ -0,0 +1,5 @@
1
+ import abc
2
+
3
+
4
+ class FuzzyProperty(abc.ABC):
5
+ pass
@@ -0,0 +1,17 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class LeftShoulderFunction(FuzzyDatatype):
5
+ def __init__(self, a: float, b: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+
10
+ def get_a(self) -> float:
11
+ return self._a
12
+
13
+ def get_b(self) -> float:
14
+ return self._b
15
+
16
+ def __str__(self) -> str:
17
+ return f"left-shoulder({self._k1}, {self._k2}, {self._a}, {self._b})"
@@ -0,0 +1,17 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class LinearFunction(FuzzyDatatype):
5
+ def __init__(self, a: float, b: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+
10
+ def get_a(self) -> float:
11
+ return self._a
12
+
13
+ def get_b(self) -> float:
14
+ return self._b
15
+
16
+ def __str__(self) -> str:
17
+ return f"linear({self._k1}, {self._k2}, {self._a}, {self._b})"
@@ -0,0 +1,13 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_modifier import FuzzyModifier
2
+
3
+
4
+ class LinearModifier(FuzzyModifier):
5
+ def __init__(self, c: float) -> None:
6
+ super().__init__()
7
+ self._c: float = c
8
+
9
+ def get_c(self) -> float:
10
+ return self._c
11
+
12
+ def __str__(self) -> str:
13
+ return f"linear-modifier({self._c})"
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class ModifiedConcept(ConceptDefinition):
6
+
7
+ def __init__(self, mod: str, c: str) -> None:
8
+ super().__init__(ConceptType.MODIFIED_CONCEPT)
9
+ self._mod: str = mod
10
+ self._c: str = c
11
+
12
+ def get_fuzzy_modifier(self) -> str:
13
+ return self._mod
14
+
15
+ def get_fuzzy_concept(self) -> str:
16
+ return self._c
17
+
18
+ def __str__(self) -> str:
19
+ return f"({self._mod}, {self._c})"
@@ -0,0 +1,17 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class ModifiedFunction(FuzzyDatatype):
5
+ def __init__(self, mod: str, d: str) -> None:
6
+ super().__init__()
7
+ self._mod: str = mod
8
+ self._d: str = d
9
+
10
+ def get_mod(self) -> str:
11
+ return self._mod
12
+
13
+ def get_d(self) -> str:
14
+ return self._d
15
+
16
+ def __str__(self) -> str:
17
+ return f"({self._mod}, {self._d})"
@@ -0,0 +1,15 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_property import FuzzyProperty
2
+
3
+
4
+ class ModifiedProperty(FuzzyProperty):
5
+
6
+ def __init__(self, mod: str, prop: str) -> None:
7
+ super.__init__()
8
+ self._mod: str = mod
9
+ self._prop: str = prop
10
+
11
+ def get_fuzzy_modifier(self) -> str:
12
+ return self._mod
13
+
14
+ def get_property(self) -> str:
15
+ return self._prop
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class OwaConcept(ConceptDefinition):
6
+
7
+ def __init__(self, weights: list[float], concepts: list[str]) -> None:
8
+ super().__init__(ConceptType.OWA)
9
+ self._weights: list[float] = weights
10
+ self._concepts: list[str] = concepts
11
+
12
+ def get_weights(self) -> list[float]:
13
+ return self._weights
14
+
15
+ def get_concepts(self) -> list[str]:
16
+ return self._concepts
17
+
18
+ def __str__(self) -> str:
19
+ return f"(owa ({' '.join(map(str, self._weights))}) ({' '.join(self._concepts)}))"
@@ -0,0 +1,10 @@
1
+ class PropertyDefinition:
2
+ def __init__(self, mod: str, prop: str) -> None:
3
+ self._mod: str = mod
4
+ self._prop: str = prop
5
+
6
+ def get_fuzzy_modifier(self) -> str:
7
+ return self._mod
8
+
9
+ def get_property(self) -> str:
10
+ return self._prop
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class QowaConcept(ConceptDefinition):
6
+
7
+ def __init__(self, q: str, concepts: list[str]) -> None:
8
+ super().__init__(ConceptType.QUANTIFIED_OWA)
9
+ self._q: str = q
10
+ self._concepts: list[str] = concepts
11
+
12
+ def get_quantifier(self) -> str:
13
+ return self._q
14
+
15
+ def get_concepts(self) -> list[str]:
16
+ return self._concepts
17
+
18
+ def __str__(self) -> str:
19
+ return f"(q-owa {self._q} {' '.join(self._concepts)})"
@@ -0,0 +1,21 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class QsugenoConcept(ConceptDefinition):
6
+
7
+ def __init__(self, weights: list[float], concepts: list[str]) -> None:
8
+ super().__init__(ConceptType.QUASI_SUGENO)
9
+ self._weights: list[float] = weights
10
+ self._concepts: list[str] = concepts
11
+
12
+ def get_weights(self) -> list[float]:
13
+ return self._weights
14
+
15
+ def get_concepts(self) -> list[str]:
16
+ return self._concepts
17
+
18
+ def __str__(self) -> str:
19
+ return (
20
+ f"(q-sugeno ({' '.join(map(str, self._weights))}) ({' '.join(self._concepts)}))"
21
+ )
@@ -0,0 +1,17 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class RightShoulderFunction(FuzzyDatatype):
5
+ def __init__(self, a: float, b: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+
10
+ def get_a(self) -> float:
11
+ return self._a
12
+
13
+ def get_b(self) -> float:
14
+ return self._b
15
+
16
+ def __str__(self) -> str:
17
+ return f"right-shoulder({self._k1}, {self._k2}, {self._a}, {self._b})"
@@ -0,0 +1,21 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class SugenoConcept(ConceptDefinition):
6
+
7
+ def __init__(self, weights: list[float], concepts: list[str]) -> None:
8
+ super().__init__(ConceptType.SUGENO)
9
+ self._weights: list[float] = weights
10
+ self._concepts: list[str] = concepts
11
+
12
+ def get_weights(self) -> list[float]:
13
+ return self._weights
14
+
15
+ def get_concepts(self) -> list[str]:
16
+ return self._concepts
17
+
18
+ def __str__(self) -> str:
19
+ return (
20
+ f"(sugeno ({' '.join(map(str, self._weights))}) ({' '.join(self._concepts)}))"
21
+ )
@@ -0,0 +1,25 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class TrapezoidalFunction(FuzzyDatatype):
5
+ def __init__(self, a: float, b: float, c: float, d: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+ self._c: float = c
10
+ self._d: float = d
11
+
12
+ def get_a(self) -> float:
13
+ return self._a
14
+
15
+ def get_b(self) -> float:
16
+ return self._b
17
+
18
+ def get_c(self) -> float:
19
+ return self._c
20
+
21
+ def get_d(self) -> float:
22
+ return self._d
23
+
24
+ def __str__(self) -> str:
25
+ return f"trapezoidal({self._k1}, {self._k2}, {self._a}, {self._b}, {self._c}, {self._d})"
@@ -0,0 +1,21 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_datatype import FuzzyDatatype
2
+
3
+
4
+ class TriangularFunction(FuzzyDatatype):
5
+ def __init__(self, a: float, b: float, c: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+ self._c: float = c
10
+
11
+ def get_a(self) -> float:
12
+ return self._a
13
+
14
+ def get_b(self) -> float:
15
+ return self._b
16
+
17
+ def get_c(self) -> float:
18
+ return self._c
19
+
20
+ def __str__(self) -> str:
21
+ return f"triangular({self._k1}, {self._k2}, {self._a}, {self._b}, {self._c})"
@@ -0,0 +1,21 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.fuzzy_modifier import FuzzyModifier
2
+
3
+
4
+ class TriangularModifier(FuzzyModifier):
5
+ def __init__(self, a: float, b: float, c: float) -> None:
6
+ super().__init__()
7
+ self._a: float = a
8
+ self._b: float = b
9
+ self._c: float = c
10
+
11
+ def get_a(self) -> float:
12
+ return self._a
13
+
14
+ def get_b(self) -> float:
15
+ return self._b
16
+
17
+ def get_c(self) -> float:
18
+ return self._c
19
+
20
+ def __str__(self) -> str:
21
+ return f"triangular-modifier({self._a}, {self._b}, {self._c})"
@@ -0,0 +1,19 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class WeightedConcept(ConceptDefinition):
6
+
7
+ def __init__(self, n: float, c: str) -> None:
8
+ super().__init__(ConceptType.WEIGHTED_CONCEPT)
9
+ self._n: float = n
10
+ self._c: str = c
11
+
12
+ def get_number(self) -> float:
13
+ return self._n
14
+
15
+ def get_fuzzy_concept(self) -> str:
16
+ return self._c
17
+
18
+ def __str__(self) -> str:
19
+ return f"({self._n} {self._c})"
@@ -0,0 +1,15 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class WeightedMaxConcept(ConceptDefinition):
6
+
7
+ def __init__(self, wc: list[ConceptDefinition]) -> None:
8
+ super().__init__(ConceptType.WEIGHTED_MAX)
9
+ self._wc: list[ConceptDefinition] = wc
10
+
11
+ def get_weighted_concepts(self) -> list[ConceptDefinition]:
12
+ return self._wc
13
+
14
+ def __str__(self) -> str:
15
+ return f"(w-max {self._wc})"
@@ -0,0 +1,15 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class WeightedMinConcept(ConceptDefinition):
6
+
7
+ def __init__(self, wc: list[ConceptDefinition]) -> None:
8
+ super().__init__(ConceptType.WEIGHTED_MIN)
9
+ self._wc: list[ConceptDefinition] = wc
10
+
11
+ def get_weighted_concepts(self) -> list[ConceptDefinition]:
12
+ return self._wc
13
+
14
+ def __str__(self) -> str:
15
+ return f"(w-min {self._wc})"
@@ -0,0 +1,15 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class WeightedSumConcept(ConceptDefinition):
6
+
7
+ def __init__(self, wc: list[ConceptDefinition]) -> None:
8
+ super().__init__(ConceptType.WEIGHTED_SUM)
9
+ self._wc: list[ConceptDefinition] = wc
10
+
11
+ def get_weighted_concepts(self) -> list[ConceptDefinition]:
12
+ return self._wc
13
+
14
+ def __str__(self) -> str:
15
+ return f"(w-sum {self._wc})"
@@ -0,0 +1,15 @@
1
+ from fuzzy_dl_owl2.fuzzyowl2.owl_types.concept_definition import ConceptDefinition
2
+ from fuzzy_dl_owl2.fuzzyowl2.util.constants import ConceptType
3
+
4
+
5
+ class WeightedSumZeroConcept(ConceptDefinition):
6
+
7
+ def __init__(self, wc: list[ConceptDefinition]) -> None:
8
+ super().__init__(ConceptType.WEIGHTED_SUM_ZERO)
9
+ self._wc: list[ConceptDefinition] = wc
10
+
11
+ def get_weighted_concepts(self) -> list[ConceptDefinition]:
12
+ return self._wc
13
+
14
+ def __str__(self) -> str:
15
+ return f"(w-sum-zero {self._wc})"
@@ -0,0 +1 @@
1
+ from .owl2_parser import *