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.
- fuzzy_dl_owl2/__init__.py +2 -0
- fuzzy_dl_owl2/fuzzydl/__init__.py +23 -0
- fuzzy_dl_owl2/fuzzydl/assertion/__init__.py +2 -0
- fuzzy_dl_owl2/fuzzydl/assertion/assertion.py +72 -0
- fuzzy_dl_owl2/fuzzydl/assertion/atomic_assertion.py +19 -0
- fuzzy_dl_owl2/fuzzydl/concept/__init__.py +13 -0
- fuzzy_dl_owl2/fuzzydl/concept/all_some_concept.py +85 -0
- fuzzy_dl_owl2/fuzzydl/concept/approximation_concept.py +147 -0
- fuzzy_dl_owl2/fuzzydl/concept/atomic_concept.py +91 -0
- fuzzy_dl_owl2/fuzzydl/concept/choquet_integral.py +64 -0
- fuzzy_dl_owl2/fuzzydl/concept/concept.py +230 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/__init__.py +10 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/crisp_concrete_concept.py +60 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_concrete_concept.py +63 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/triangular_fuzzy_number.py +127 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/left_concrete_concept.py +70 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/linear_concrete_concept.py +70 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/modified_concrete_concept.py +66 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/right_concrete_concept.py +70 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/trapezoidal_concrete_concept.py +96 -0
- fuzzy_dl_owl2/fuzzydl/concept/concrete/triangular_concrete_concept.py +89 -0
- fuzzy_dl_owl2/fuzzydl/concept/ext_threshold_concept.py +77 -0
- fuzzy_dl_owl2/fuzzydl/concept/has_value_concept.py +51 -0
- fuzzy_dl_owl2/fuzzydl/concept/implies_concept.py +144 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/__init__.py +6 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_concept_interface.py +17 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_concepts_interface.py +18 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_concept_interface.py +14 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_interface.py +15 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_value_interface.py +21 -0
- fuzzy_dl_owl2/fuzzydl/concept/interface/has_weighted_concepts_interface.py +29 -0
- fuzzy_dl_owl2/fuzzydl/concept/modified/__init__.py +3 -0
- fuzzy_dl_owl2/fuzzydl/concept/modified/linearly_modified_concept.py +32 -0
- fuzzy_dl_owl2/fuzzydl/concept/modified/modified_concept.py +59 -0
- fuzzy_dl_owl2/fuzzydl/concept/modified/triangularly_modified_concept.py +33 -0
- fuzzy_dl_owl2/fuzzydl/concept/negated_nominal.py +42 -0
- fuzzy_dl_owl2/fuzzydl/concept/operator_concept.py +707 -0
- fuzzy_dl_owl2/fuzzydl/concept/owa_concept.py +57 -0
- fuzzy_dl_owl2/fuzzydl/concept/qowa_concept.py +62 -0
- fuzzy_dl_owl2/fuzzydl/concept/quasi_sugeno_integral.py +46 -0
- fuzzy_dl_owl2/fuzzydl/concept/self_concept.py +45 -0
- fuzzy_dl_owl2/fuzzydl/concept/string_concept.py +35 -0
- fuzzy_dl_owl2/fuzzydl/concept/sugeno_integral.py +83 -0
- fuzzy_dl_owl2/fuzzydl/concept/threshold_concept.py +81 -0
- fuzzy_dl_owl2/fuzzydl/concept/truth_concept.py +83 -0
- fuzzy_dl_owl2/fuzzydl/concept/value_concept.py +67 -0
- fuzzy_dl_owl2/fuzzydl/concept/weighted_concept.py +55 -0
- fuzzy_dl_owl2/fuzzydl/concept/weighted_max_concept.py +63 -0
- fuzzy_dl_owl2/fuzzydl/concept/weighted_min_concept.py +57 -0
- fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_concept.py +62 -0
- fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_zero_concept.py +62 -0
- fuzzy_dl_owl2/fuzzydl/concept_equivalence.py +20 -0
- fuzzy_dl_owl2/fuzzydl/concrete_feature.py +94 -0
- fuzzy_dl_owl2/fuzzydl/degree/__init__.py +4 -0
- fuzzy_dl_owl2/fuzzydl/degree/degree.py +79 -0
- fuzzy_dl_owl2/fuzzydl/degree/degree_expression.py +57 -0
- fuzzy_dl_owl2/fuzzydl/degree/degree_numeric.py +57 -0
- fuzzy_dl_owl2/fuzzydl/degree/degree_variable.py +54 -0
- fuzzy_dl_owl2/fuzzydl/domain_axiom.py +8 -0
- fuzzy_dl_owl2/fuzzydl/exception/__init__.py +2 -0
- fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py +4 -0
- fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py +4 -0
- fuzzy_dl_owl2/fuzzydl/feature_function.py +148 -0
- fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +920 -0
- fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2_java.py +953 -0
- fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py +82 -0
- fuzzy_dl_owl2/fuzzydl/individual/__init__.py +3 -0
- fuzzy_dl_owl2/fuzzydl/individual/created_individual.py +219 -0
- fuzzy_dl_owl2/fuzzydl/individual/individual.py +113 -0
- fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py +37 -0
- fuzzy_dl_owl2/fuzzydl/knowledge_base.py +9037 -0
- fuzzy_dl_owl2/fuzzydl/label.py +32 -0
- fuzzy_dl_owl2/fuzzydl/milp/__init__.py +7 -0
- fuzzy_dl_owl2/fuzzydl/milp/expression.py +186 -0
- fuzzy_dl_owl2/fuzzydl/milp/inequation.py +55 -0
- fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +787 -0
- fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py +151 -0
- fuzzy_dl_owl2/fuzzydl/milp/solution.py +45 -0
- fuzzy_dl_owl2/fuzzydl/milp/term.py +76 -0
- fuzzy_dl_owl2/fuzzydl/milp/variable.py +89 -0
- fuzzy_dl_owl2/fuzzydl/modifier/__init__.py +3 -0
- fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py +76 -0
- fuzzy_dl_owl2/fuzzydl/modifier/modifier.py +39 -0
- fuzzy_dl_owl2/fuzzydl/modifier/triangular_modifier.py +76 -0
- fuzzy_dl_owl2/fuzzydl/parser/ParserConstants.py +406 -0
- fuzzy_dl_owl2/fuzzydl/parser/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzydl/parser/dl_parser.py +2029 -0
- fuzzy_dl_owl2/fuzzydl/parser/ebnf.lark +290 -0
- fuzzy_dl_owl2/fuzzydl/parser/larkx.py +70 -0
- fuzzy_dl_owl2/fuzzydl/primitive_concept_definition.py +81 -0
- fuzzy_dl_owl2/fuzzydl/query/__init__.py +14 -0
- fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +50 -0
- fuzzy_dl_owl2/fuzzydl/query/bnp_query.py +22 -0
- fuzzy_dl_owl2/fuzzydl/query/defuzzify/__init__.py +4 -0
- fuzzy_dl_owl2/fuzzydl/query/defuzzify/defuzzify_query.py +76 -0
- fuzzy_dl_owl2/fuzzydl/query/defuzzify/lom_defuzzify_query.py +19 -0
- fuzzy_dl_owl2/fuzzydl/query/defuzzify/mom_defuzzify_query.py +88 -0
- fuzzy_dl_owl2/fuzzydl/query/defuzzify/som_defuzzify_query.py +20 -0
- fuzzy_dl_owl2/fuzzydl/query/instance_query.py +19 -0
- fuzzy_dl_owl2/fuzzydl/query/kb_satisfiable_query.py +32 -0
- fuzzy_dl_owl2/fuzzydl/query/max/__init__.py +5 -0
- fuzzy_dl_owl2/fuzzydl/query/max/max_instance_query.py +45 -0
- fuzzy_dl_owl2/fuzzydl/query/max/max_query.py +31 -0
- fuzzy_dl_owl2/fuzzydl/query/max/max_related_query.py +45 -0
- fuzzy_dl_owl2/fuzzydl/query/max/max_satisfiable_query.py +73 -0
- fuzzy_dl_owl2/fuzzydl/query/max/max_subsumes_query.py +64 -0
- fuzzy_dl_owl2/fuzzydl/query/min/__init__.py +5 -0
- fuzzy_dl_owl2/fuzzydl/query/min/min_instance_query.py +50 -0
- fuzzy_dl_owl2/fuzzydl/query/min/min_query.py +31 -0
- fuzzy_dl_owl2/fuzzydl/query/min/min_related_query.py +57 -0
- fuzzy_dl_owl2/fuzzydl/query/min/min_satisfiable_query.py +80 -0
- fuzzy_dl_owl2/fuzzydl/query/min/min_subsumes_query.py +65 -0
- fuzzy_dl_owl2/fuzzydl/query/query.py +38 -0
- fuzzy_dl_owl2/fuzzydl/query/related_query.py +15 -0
- fuzzy_dl_owl2/fuzzydl/query/satisfiable_query.py +37 -0
- fuzzy_dl_owl2/fuzzydl/query/subsumption_query.py +20 -0
- fuzzy_dl_owl2/fuzzydl/range_axiom.py +7 -0
- fuzzy_dl_owl2/fuzzydl/relation.py +47 -0
- fuzzy_dl_owl2/fuzzydl/restriction/__init__.py +2 -0
- fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py +16 -0
- fuzzy_dl_owl2/fuzzydl/restriction/restriction.py +34 -0
- fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py +10 -0
- fuzzy_dl_owl2/fuzzydl/util/__init__.py +3 -0
- fuzzy_dl_owl2/fuzzydl/util/config_reader.py +56 -0
- fuzzy_dl_owl2/fuzzydl/util/constants.py +424 -0
- fuzzy_dl_owl2/fuzzydl/util/util.py +73 -0
- fuzzy_dl_owl2/fuzzyowl2/__init__.py +5 -0
- fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +1513 -0
- fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_java.py +1409 -0
- fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py +917 -0
- fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl_java.py +956 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py +0 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/concept_definition.py +14 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_datatype.py +22 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_modifier.py +4 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_nominal_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_property.py +5 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/left_shoulder_function.py +17 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py +17 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py +13 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py +17 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +15 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py +10 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/quasi_sugeno_concept.py +21 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/right_shoulder_function.py +17 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/sugeno_concept.py +21 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/trapezoidal_function.py +25 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_function.py +21 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_modifer.py +21 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_concept.py +19 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py +15 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py +15 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py +15 -0
- fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py +15 -0
- fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +491 -0
- fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzyowl2/util/constants.py +112 -0
- fuzzy_dl_owl2-1.0.0.dist-info/LICENSE +427 -0
- fuzzy_dl_owl2-1.0.0.dist-info/METADATA +299 -0
- fuzzy_dl_owl2-1.0.0.dist-info/RECORD +167 -0
- 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,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,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,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 *
|