fuzzy-dl-owl2 1.0.5__py3-none-any.whl → 1.0.7__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/fuzzydl/feature_function.py +9 -3
- fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +204 -66
- fuzzy_dl_owl2/fuzzydl/knowledge_base.py +13 -5
- fuzzy_dl_owl2/fuzzydl/milp/expression.py +13 -2
- fuzzy_dl_owl2/fuzzydl/milp/inequation.py +12 -0
- fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +694 -54
- fuzzy_dl_owl2/fuzzydl/milp/term.py +4 -1
- fuzzy_dl_owl2/fuzzydl/util/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzydl/util/config_reader.py +44 -2
- fuzzy_dl_owl2/fuzzydl/util/constants.py +5 -6
- fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +25 -17
- fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +7 -1
- fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +2 -1
- fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +7 -7
- fuzzy_dl_owl2/fuzzyowl2/parser/owl2_xml_parser.py +226 -0
- fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +1 -0
- fuzzy_dl_owl2/fuzzyowl2/util/constants.py +138 -52
- fuzzy_dl_owl2/fuzzyowl2/util/fuzzy_xml.py +107 -0
- {fuzzy_dl_owl2-1.0.5.dist-info → fuzzy_dl_owl2-1.0.7.dist-info}/METADATA +72 -4
- {fuzzy_dl_owl2-1.0.5.dist-info → fuzzy_dl_owl2-1.0.7.dist-info}/RECORD +22 -20
- {fuzzy_dl_owl2-1.0.5.dist-info → fuzzy_dl_owl2-1.0.7.dist-info}/LICENSE +0 -0
- {fuzzy_dl_owl2-1.0.5.dist-info → fuzzy_dl_owl2-1.0.7.dist-info}/WHEEL +0 -0
|
@@ -26,63 +26,149 @@ class ConceptType(enum.StrEnum):
|
|
|
26
26
|
return self.name
|
|
27
27
|
|
|
28
28
|
|
|
29
|
+
# class FuzzyOWL2Keyword(enum.Enum):
|
|
30
|
+
# OPEN_TAG = pp.Word("<")
|
|
31
|
+
# CLOSE_TAG = pp.Word(">")
|
|
32
|
+
# SINGLE_CLOSE_TAG = pp.Word("/>")
|
|
33
|
+
# SLASH = pp.Word("/")
|
|
34
|
+
# ONTOLOGY = pp.CaselessKeyword("ontology")
|
|
35
|
+
# FUZZY_OWL_2 = pp.CaselessKeyword("fuzzyOwl2")
|
|
36
|
+
# FUZZY_LABEL = pp.CaselessKeyword("fuzzyLabel")
|
|
37
|
+
# FUZZY_TYPE = pp.CaselessKeyword("fuzzytype")
|
|
38
|
+
# FUZZY_LOGIC = pp.CaselessKeyword("FuzzyLogic")
|
|
39
|
+
# TYPE = pp.CaselessKeyword("type")
|
|
40
|
+
# LOGIC = pp.CaselessKeyword("logic")
|
|
41
|
+
# DATATYPE = pp.CaselessKeyword("datatype")
|
|
42
|
+
# CONCEPT = pp.CaselessKeyword("concept")
|
|
43
|
+
# ROLE = pp.CaselessKeyword("role")
|
|
44
|
+
# AXIOM = pp.CaselessKeyword("axiom")
|
|
45
|
+
# DEGREE_DEF = pp.CaselessKeyword("degree")
|
|
46
|
+
# DEGREE_VALUE = pp.CaselessKeyword("value")
|
|
47
|
+
# MODIFIED = pp.CaselessKeyword("modified")
|
|
48
|
+
# WEIGHTED = pp.CaselessKeyword("weighted")
|
|
49
|
+
# NOMINAL = pp.CaselessKeyword("nominal")
|
|
50
|
+
# INDIVIDUAL = pp.CaselessKeyword("individual")
|
|
51
|
+
# WEIGHTED_MAXIMUM = pp.CaselessKeyword("weightedMaximum")
|
|
52
|
+
# WEIGHTED_MINIMUM = pp.CaselessKeyword("weightedMinimum")
|
|
53
|
+
# WEIGHTED_SUM = pp.CaselessKeyword("weightedSum")
|
|
54
|
+
# WEIGHTED_SUMZERO = pp.CaselessKeyword("weightedSumZero")
|
|
55
|
+
# OWA = pp.CaselessKeyword("owa")
|
|
56
|
+
# Q_OWA = pp.CaselessKeyword("qowa")
|
|
57
|
+
# CHOQUET = pp.CaselessKeyword("choquet")
|
|
58
|
+
# SUGENO = pp.CaselessKeyword("sugeno")
|
|
59
|
+
# QUASI_SUGENO = pp.CaselessKeyword("quasisugeno")
|
|
60
|
+
# MODIFIER = pp.CaselessKeyword("modifier")
|
|
61
|
+
# BASE = pp.CaselessKeyword("base")
|
|
62
|
+
# CONCEPT_NAMES = pp.CaselessKeyword("names")
|
|
63
|
+
# NAME = pp.CaselessKeyword("name")
|
|
64
|
+
# WEIGHT = pp.CaselessKeyword("weight")
|
|
65
|
+
# WEIGHTS = pp.CaselessKeyword("weights")
|
|
66
|
+
# QUANTIFIER = pp.CaselessKeyword("quantifier")
|
|
67
|
+
# CRISP = pp.CaselessKeyword("crisp")
|
|
68
|
+
# LEFT_SHOULDER = pp.CaselessKeyword("leftshoulder")
|
|
69
|
+
# RIGHT_SHOULDER = pp.CaselessKeyword("rightshoulder")
|
|
70
|
+
# TRIANGULAR = pp.CaselessKeyword("triangular")
|
|
71
|
+
# TRAPEZOIDAL = pp.CaselessKeyword("trapezoidal")
|
|
72
|
+
# LINEAR = pp.CaselessKeyword("linear")
|
|
73
|
+
# A = pp.CaselessKeyword("a")
|
|
74
|
+
# B = pp.CaselessKeyword("b")
|
|
75
|
+
# C = pp.CaselessKeyword("c")
|
|
76
|
+
# D = pp.CaselessKeyword("d")
|
|
77
|
+
# LUKASIEWICZ = pp.CaselessKeyword("lukasiewicz")
|
|
78
|
+
# GOEDEL = pp.CaselessKeyword("goedel")
|
|
79
|
+
# ZADEH = pp.CaselessKeyword("zadeh")
|
|
80
|
+
# PRODUCT = pp.CaselessKeyword("product")
|
|
81
|
+
# EQUAL = pp.Word("=")
|
|
82
|
+
# LES = pp.CaselessKeyword("les")
|
|
83
|
+
# LEQ = pp.CaselessKeyword("leq")
|
|
84
|
+
# GEQ = pp.CaselessKeyword("geq")
|
|
85
|
+
# GRE = pp.CaselessKeyword("gre")
|
|
86
|
+
|
|
87
|
+
# def get_name(self) -> str:
|
|
88
|
+
# return re.sub(r"[\"\']+", "", self.value.name.lower())
|
|
89
|
+
|
|
90
|
+
# def get_value(self) -> typing.Union[pp.CaselessKeyword, pp.Word]:
|
|
91
|
+
# return self.value
|
|
92
|
+
|
|
93
|
+
# def get_str_value(self) -> str:
|
|
94
|
+
# return str(self.value).replace('"', "").replace("'", "")
|
|
95
|
+
|
|
96
|
+
# def get_tag_name(self) -> str:
|
|
97
|
+
# return self.get_str_value().capitalize()
|
|
98
|
+
|
|
99
|
+
# def __eq__(self, value: object) -> bool:
|
|
100
|
+
# if isinstance(value, str):
|
|
101
|
+
# return self.get_name() == value.lower()
|
|
102
|
+
# elif isinstance(value, pp.CaselessKeyword):
|
|
103
|
+
# return self.get_name() == value.name.lower()
|
|
104
|
+
# elif isinstance(value, FuzzyOWL2Keyword):
|
|
105
|
+
# return self.get_name() == value.get_name()
|
|
106
|
+
# raise NotImplementedError
|
|
107
|
+
|
|
108
|
+
# def __repr__(self) -> str:
|
|
109
|
+
# return self.name
|
|
110
|
+
|
|
111
|
+
# def __str__(self) -> str:
|
|
112
|
+
# return self.name
|
|
113
|
+
|
|
114
|
+
|
|
29
115
|
class FuzzyOWL2Keyword(enum.Enum):
|
|
30
116
|
OPEN_TAG = pp.Word("<")
|
|
31
117
|
CLOSE_TAG = pp.Word(">")
|
|
32
118
|
SINGLE_CLOSE_TAG = pp.Word("/>")
|
|
33
119
|
SLASH = pp.Word("/")
|
|
34
|
-
ONTOLOGY = pp.
|
|
35
|
-
FUZZY_OWL_2 = pp.
|
|
36
|
-
FUZZY_LABEL = pp.
|
|
37
|
-
FUZZY_TYPE = pp.
|
|
38
|
-
FUZZY_LOGIC = pp.
|
|
39
|
-
TYPE = pp.
|
|
40
|
-
LOGIC = pp.
|
|
41
|
-
DATATYPE = pp.
|
|
42
|
-
CONCEPT = pp.
|
|
43
|
-
ROLE = pp.
|
|
44
|
-
AXIOM = pp.
|
|
45
|
-
DEGREE_DEF = pp.
|
|
46
|
-
DEGREE_VALUE = pp.
|
|
47
|
-
MODIFIED = pp.
|
|
48
|
-
WEIGHTED = pp.
|
|
49
|
-
NOMINAL = pp.
|
|
50
|
-
INDIVIDUAL = pp.
|
|
51
|
-
WEIGHTED_MAXIMUM = pp.
|
|
52
|
-
WEIGHTED_MINIMUM = pp.
|
|
53
|
-
WEIGHTED_SUM = pp.
|
|
54
|
-
WEIGHTED_SUMZERO = pp.
|
|
55
|
-
OWA = pp.
|
|
56
|
-
Q_OWA = pp.
|
|
57
|
-
CHOQUET = pp.
|
|
58
|
-
SUGENO = pp.
|
|
59
|
-
QUASI_SUGENO = pp.
|
|
60
|
-
MODIFIER = pp.
|
|
61
|
-
BASE = pp.
|
|
62
|
-
CONCEPT_NAMES = pp.
|
|
63
|
-
NAME = pp.
|
|
64
|
-
WEIGHT = pp.
|
|
65
|
-
WEIGHTS = pp.
|
|
66
|
-
QUANTIFIER = pp.
|
|
67
|
-
CRISP = pp.
|
|
68
|
-
LEFT_SHOULDER = pp.
|
|
69
|
-
RIGHT_SHOULDER = pp.
|
|
70
|
-
TRIANGULAR = pp.
|
|
71
|
-
TRAPEZOIDAL = pp.
|
|
72
|
-
LINEAR = pp.
|
|
73
|
-
A = pp.
|
|
74
|
-
B = pp.
|
|
75
|
-
C = pp.
|
|
76
|
-
D = pp.
|
|
77
|
-
LUKASIEWICZ = pp.
|
|
78
|
-
GOEDEL = pp.
|
|
79
|
-
ZADEH = pp.
|
|
80
|
-
PRODUCT = pp.
|
|
120
|
+
ONTOLOGY = pp.Keyword("ontology")
|
|
121
|
+
FUZZY_OWL_2 = pp.Keyword("fuzzyOwl2")
|
|
122
|
+
FUZZY_LABEL = pp.Keyword("fuzzyLabel")
|
|
123
|
+
FUZZY_TYPE = pp.Keyword("fuzzyType")
|
|
124
|
+
FUZZY_LOGIC = pp.Keyword("FuzzyLogic")
|
|
125
|
+
TYPE = pp.Keyword("type")
|
|
126
|
+
LOGIC = pp.Keyword("logic")
|
|
127
|
+
DATATYPE = pp.Keyword("datatype")
|
|
128
|
+
CONCEPT = pp.Keyword("concept")
|
|
129
|
+
ROLE = pp.Keyword("role")
|
|
130
|
+
AXIOM = pp.Keyword("axiom")
|
|
131
|
+
DEGREE_DEF = pp.Keyword("degree")
|
|
132
|
+
DEGREE_VALUE = pp.Keyword("value")
|
|
133
|
+
MODIFIED = pp.Keyword("modified")
|
|
134
|
+
WEIGHTED = pp.Keyword("weighted")
|
|
135
|
+
NOMINAL = pp.Keyword("nominal")
|
|
136
|
+
INDIVIDUAL = pp.Keyword("individual")
|
|
137
|
+
WEIGHTED_MAXIMUM = pp.Keyword("weightedMaximum")
|
|
138
|
+
WEIGHTED_MINIMUM = pp.Keyword("weightedMinimum")
|
|
139
|
+
WEIGHTED_SUM = pp.Keyword("weightedSum")
|
|
140
|
+
WEIGHTED_SUMZERO = pp.Keyword("weightedSumZero")
|
|
141
|
+
OWA = pp.Keyword("owa")
|
|
142
|
+
Q_OWA = pp.Keyword("qowa")
|
|
143
|
+
CHOQUET = pp.Keyword("choquet")
|
|
144
|
+
SUGENO = pp.Keyword("sugeno")
|
|
145
|
+
QUASI_SUGENO = pp.Keyword("quasisugeno")
|
|
146
|
+
MODIFIER = pp.Keyword("modifier")
|
|
147
|
+
BASE = pp.Keyword("base")
|
|
148
|
+
CONCEPT_NAMES = pp.Keyword("names")
|
|
149
|
+
NAME = pp.Keyword("name")
|
|
150
|
+
WEIGHT = pp.Keyword("weight")
|
|
151
|
+
WEIGHTS = pp.Keyword("weights")
|
|
152
|
+
QUANTIFIER = pp.Keyword("quantifier")
|
|
153
|
+
CRISP = pp.Keyword("crisp")
|
|
154
|
+
LEFT_SHOULDER = pp.Keyword("leftshoulder")
|
|
155
|
+
RIGHT_SHOULDER = pp.Keyword("rightshoulder")
|
|
156
|
+
TRIANGULAR = pp.Keyword("triangular")
|
|
157
|
+
TRAPEZOIDAL = pp.Keyword("trapezoidal")
|
|
158
|
+
LINEAR = pp.Keyword("linear")
|
|
159
|
+
A = pp.Keyword("a")
|
|
160
|
+
B = pp.Keyword("b")
|
|
161
|
+
C = pp.Keyword("c")
|
|
162
|
+
D = pp.Keyword("d")
|
|
163
|
+
LUKASIEWICZ = pp.Keyword("lukasiewicz")
|
|
164
|
+
GOEDEL = pp.Keyword("goedel")
|
|
165
|
+
ZADEH = pp.Keyword("zadeh")
|
|
166
|
+
PRODUCT = pp.Keyword("product")
|
|
81
167
|
EQUAL = pp.Word("=")
|
|
82
|
-
LES = pp.
|
|
83
|
-
LEQ = pp.
|
|
84
|
-
GEQ = pp.
|
|
85
|
-
GRE = pp.
|
|
168
|
+
LES = pp.Keyword("les")
|
|
169
|
+
LEQ = pp.Keyword("leq")
|
|
170
|
+
GEQ = pp.Keyword("geq")
|
|
171
|
+
GRE = pp.Keyword("gre")
|
|
86
172
|
|
|
87
173
|
def get_name(self) -> str:
|
|
88
174
|
return re.sub(r"[\"\']+", "", self.value.name.lower())
|
|
@@ -99,7 +185,7 @@ class FuzzyOWL2Keyword(enum.Enum):
|
|
|
99
185
|
def __eq__(self, value: object) -> bool:
|
|
100
186
|
if isinstance(value, str):
|
|
101
187
|
return self.get_name() == value.lower()
|
|
102
|
-
elif isinstance(value, pp.
|
|
188
|
+
elif isinstance(value, pp.Keyword):
|
|
103
189
|
return self.get_name() == value.name.lower()
|
|
104
190
|
elif isinstance(value, FuzzyOWL2Keyword):
|
|
105
191
|
return self.get_name() == value.get_name()
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
import typing
|
|
5
|
+
from xml.dom import minidom
|
|
6
|
+
from xml.etree.ElementTree import Element, tostring
|
|
7
|
+
|
|
8
|
+
from fuzzy_dl_owl2.fuzzyowl2.util.constants import FuzzyOWL2Keyword
|
|
9
|
+
from pyowl2.abstracts.class_expression import OWLClassExpression
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FuzzyXML(object):
|
|
13
|
+
|
|
14
|
+
@staticmethod
|
|
15
|
+
def build_main_xml(fuzzy_type: str) -> Element:
|
|
16
|
+
return Element(
|
|
17
|
+
FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value(),
|
|
18
|
+
attrib={FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value(): fuzzy_type},
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
@staticmethod
|
|
22
|
+
def build_logic_xml(logic: str, attrib: dict[str, str] = dict()) -> Element:
|
|
23
|
+
full_attrib = {FuzzyOWL2Keyword.LOGIC.get_str_value(): logic}
|
|
24
|
+
if attrib:
|
|
25
|
+
full_attrib.update(attrib)
|
|
26
|
+
return Element(
|
|
27
|
+
FuzzyOWL2Keyword.FUZZY_LOGIC.get_tag_name(),
|
|
28
|
+
attrib=full_attrib,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def build_datatype_xml(
|
|
33
|
+
datatype_type: str, attrib: dict[str, str] = dict()
|
|
34
|
+
) -> Element:
|
|
35
|
+
full_attrib = {FuzzyOWL2Keyword.TYPE.get_str_value(): datatype_type}
|
|
36
|
+
if attrib:
|
|
37
|
+
full_attrib.update(attrib)
|
|
38
|
+
return Element(
|
|
39
|
+
FuzzyOWL2Keyword.DATATYPE.get_tag_name(),
|
|
40
|
+
attrib=full_attrib,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
@staticmethod
|
|
44
|
+
def build_modifier_xml(
|
|
45
|
+
modifier_type: str, attrib: dict[str, str] = dict()
|
|
46
|
+
) -> Element:
|
|
47
|
+
full_attrib = {FuzzyOWL2Keyword.TYPE.get_str_value(): modifier_type}
|
|
48
|
+
if attrib:
|
|
49
|
+
full_attrib.update(attrib)
|
|
50
|
+
return Element(
|
|
51
|
+
FuzzyOWL2Keyword.MODIFIER.get_tag_name(),
|
|
52
|
+
attrib=full_attrib,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
@staticmethod
|
|
56
|
+
def build_degree_xml(
|
|
57
|
+
value: typing.Union[int, float], attrib: dict[str, str] = dict()
|
|
58
|
+
) -> Element:
|
|
59
|
+
full_attrib = {FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value(): str(value)}
|
|
60
|
+
if attrib:
|
|
61
|
+
full_attrib.update(attrib)
|
|
62
|
+
return Element(
|
|
63
|
+
FuzzyOWL2Keyword.DEGREE_DEF.get_tag_name(),
|
|
64
|
+
attrib=full_attrib,
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
@staticmethod
|
|
68
|
+
def build_concept_xml(
|
|
69
|
+
concept_type: str, attrib: dict[str, str] = dict()
|
|
70
|
+
) -> Element:
|
|
71
|
+
full_attrib = {FuzzyOWL2Keyword.TYPE.get_str_value(): concept_type}
|
|
72
|
+
if attrib:
|
|
73
|
+
full_attrib.update(attrib)
|
|
74
|
+
return Element(
|
|
75
|
+
FuzzyOWL2Keyword.CONCEPT.get_tag_name(),
|
|
76
|
+
attrib=full_attrib,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
@staticmethod
|
|
80
|
+
def build_weights_xml(weights: list[float]) -> Element:
|
|
81
|
+
element = Element(FuzzyOWL2Keyword.WEIGHTS.get_tag_name())
|
|
82
|
+
for w in weights:
|
|
83
|
+
curr = Element(FuzzyOWL2Keyword.WEIGHT.get_tag_name())
|
|
84
|
+
curr.text = str(w)
|
|
85
|
+
element.append(curr)
|
|
86
|
+
return element
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def build_names_xml(concepts: list[OWLClassExpression]) -> Element:
|
|
90
|
+
element = Element(FuzzyOWL2Keyword.CONCEPT_NAMES.get_tag_name())
|
|
91
|
+
for c in concepts:
|
|
92
|
+
curr = Element(FuzzyOWL2Keyword.NAME.get_tag_name())
|
|
93
|
+
curr.text = str(c)
|
|
94
|
+
element.append(curr)
|
|
95
|
+
return element
|
|
96
|
+
|
|
97
|
+
@staticmethod
|
|
98
|
+
def to_str(element: Element) -> str:
|
|
99
|
+
return re.sub(
|
|
100
|
+
"\n+",
|
|
101
|
+
"\n",
|
|
102
|
+
"\n".join(
|
|
103
|
+
minidom.parseString(tostring(element, encoding="unicode", method="xml"))
|
|
104
|
+
.toprettyxml()
|
|
105
|
+
.split("\n")[1:]
|
|
106
|
+
),
|
|
107
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: fuzzy-dl-owl2
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7
|
|
4
4
|
Summary: A python porting of the Fuzzy Description Language (see https://www.umbertostraccia.it/cs/software/fuzzyDL/fuzzyDL.html) and the Fuzzy OWL 2 framework (see https://www.umbertostraccia.it/cs/software/FuzzyOWL/index.html).
|
|
5
5
|
License: CC-BY-SA-4.0
|
|
6
6
|
Author: Giuseppe Filippone
|
|
@@ -11,12 +11,12 @@ Classifier: Programming Language :: Python :: 3
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.13
|
|
14
|
-
Requires-Dist: gurobipy (>=12.0.0,<13.0.0)
|
|
15
14
|
Requires-Dist: networkx (>=3.3,<4.0)
|
|
16
15
|
Requires-Dist: owlready2 (>=0.47,<0.48)
|
|
17
16
|
Requires-Dist: pyowl2 (>=1.0.2,<2.0.0)
|
|
18
17
|
Requires-Dist: pyparsing (>=3.2.3,<4.0.0)
|
|
19
18
|
Requires-Dist: rdflib (>=7.1.4,<8.0.0)
|
|
19
|
+
Requires-Dist: setuptools (>=80.8.0,<81.0.0)
|
|
20
20
|
Requires-Dist: sortedcontainers (>=2.4.0,<3.0.0)
|
|
21
21
|
Requires-Dist: trycast (>=1.2.0,<2.0.0)
|
|
22
22
|
Project-URL: Repository, https://github.com/giuseppefilippone/fuzzy_dl_owl2
|
|
@@ -78,17 +78,85 @@ The file `CONFIG.ini` is structured as follows:
|
|
|
78
78
|
```text
|
|
79
79
|
[DEFAULT]
|
|
80
80
|
debugPrint = False
|
|
81
|
-
relaxMilp = False
|
|
82
81
|
epsilon = 0.001
|
|
83
82
|
maxIndividuals = -1
|
|
83
|
+
owlAnnotationLabel = fuzzyLabel
|
|
84
|
+
milpProvider = mip
|
|
84
85
|
```
|
|
85
86
|
|
|
86
87
|
| Configuration Variable | Description |
|
|
87
88
|
|----------------------|-----------------------------------|
|
|
88
89
|
| debugPrint | Enable/disable debugging |
|
|
89
|
-
| relaxMilp | Enable/disable MILP constraint relaxation. Important: The solution may be wrong by enabling this flag |
|
|
90
90
|
| epsilon | Define the precision of the solution. For instance, epsilon = 0.001 means that the solution will be calculated with an accuracy to the third decimal place |
|
|
91
91
|
| maxIndividuals | Define the maximal number of individuals to handle. The value -1 indicate that there is no maximum |
|
|
92
|
+
| owlAnnotationLabel | Define the Annotation label used to build the Fuzzy OWL 2 RDF/XML ontology |
|
|
93
|
+
| milpProvider | Define the MILP provider used by the reasoner. The supported providers are listed below. |
|
|
94
|
+
|
|
95
|
+
Supported MILP Providers:
|
|
96
|
+
| Provider | milpProvider |
|
|
97
|
+
|--------------|----------------------|
|
|
98
|
+
| Gurobi | gurobi |
|
|
99
|
+
| CPLEX | pulp_cplex |
|
|
100
|
+
| CBC | pulp |
|
|
101
|
+
| GLPK | pulp_glpk |
|
|
102
|
+
| HiGHS | pulp_highs |
|
|
103
|
+
| MIP | mip |
|
|
104
|
+
|
|
105
|
+
⸻
|
|
106
|
+
|
|
107
|
+
# MILP Provider Usage and Configuration
|
|
108
|
+
|
|
109
|
+
## GUROBI
|
|
110
|
+
|
|
111
|
+
- Install [gurobipy](https://pypi.org/project/gurobipy/):
|
|
112
|
+
```python
|
|
113
|
+
pip install gurobipy==12.0.0
|
|
114
|
+
```
|
|
115
|
+
- Download the GUROBI license from their [website](https://www.gurobi.com/solutions/licensing/).
|
|
116
|
+
- Add Gurobi to the PATH
|
|
117
|
+
|
|
118
|
+
## MIP
|
|
119
|
+
|
|
120
|
+
- Install python [MIP](https://www.python-mip.com/):
|
|
121
|
+
```python
|
|
122
|
+
pip install mip==1.16rc0
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## GLPK
|
|
126
|
+
|
|
127
|
+
- Install [GLPK](https://www.gnu.org/software/glpk/) v5.0 and [GMP](https://gmplib.org/) v6.3.0
|
|
128
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
129
|
+
```python
|
|
130
|
+
pip install pulp==3.2.1
|
|
131
|
+
```
|
|
132
|
+
- Add GLPK to the PATH
|
|
133
|
+
|
|
134
|
+
## CBC
|
|
135
|
+
|
|
136
|
+
- Install [CBC](https://github.com/coin-or/Cbc)
|
|
137
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
138
|
+
```python
|
|
139
|
+
pip install pulp==3.2.1
|
|
140
|
+
```
|
|
141
|
+
- Add CBC to the PATH
|
|
142
|
+
|
|
143
|
+
## CPLEX
|
|
144
|
+
|
|
145
|
+
- Install [CPLEX](https://www.ibm.com/it-it/products/ilog-cplex-optimization-studio) v22.11
|
|
146
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
147
|
+
```python
|
|
148
|
+
pip install pulp==3.2.1
|
|
149
|
+
```
|
|
150
|
+
- Add CPLEX to the PATH
|
|
151
|
+
|
|
152
|
+
## HiGHS
|
|
153
|
+
|
|
154
|
+
- Install [HiGHS](https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/) v1.10.0
|
|
155
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
156
|
+
```python
|
|
157
|
+
pip install pulp==3.2.1
|
|
158
|
+
```
|
|
159
|
+
- Add HiGHS to the PATH
|
|
92
160
|
|
|
93
161
|
⸻
|
|
94
162
|
|
|
@@ -61,22 +61,22 @@ fuzzy_dl_owl2/fuzzydl/domain_axiom.py,sha256=qPjeqmA7zQt6VT-bLtT82F74fiORPegQytd
|
|
|
61
61
|
fuzzy_dl_owl2/fuzzydl/exception/__init__.py,sha256=IoYY5IQoU4UYyoB-dFOVLZyDvJN20kgZVBqWkF6J30w,135
|
|
62
62
|
fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py,sha256=eH1ybBCx1QoZaf8PLCq1rC_3tiBRA-gKCwECTcUUuro,122
|
|
63
63
|
fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py,sha256=ez0RQN4KGlNRcfB7IXfPz3bM86CFLl6zo-RRTBRpa_o,129
|
|
64
|
-
fuzzy_dl_owl2/fuzzydl/feature_function.py,sha256=
|
|
65
|
-
fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py,sha256=
|
|
64
|
+
fuzzy_dl_owl2/fuzzydl/feature_function.py,sha256=Ipfd_UuKWKqCp8jdyV3Hxia0l3yj8jjNu-kOGQ7qf3Y,6525
|
|
65
|
+
fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py,sha256=VjmHtokMAE0jC9jI8WjGeiCTQ-A8YmmUH14FEVTyrDU,53111
|
|
66
66
|
fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py,sha256=Noom35WAeJosPrliGd9_gvEtcK4BthazsSuZH-cxfyU,2380
|
|
67
67
|
fuzzy_dl_owl2/fuzzydl/individual/__init__.py,sha256=zBCa24kE2nv08VgtphjLshpbGNEARUJgCdtyv9r6JGc,110
|
|
68
68
|
fuzzy_dl_owl2/fuzzydl/individual/created_individual.py,sha256=HOo_UXjPPPtm7B0a7k90kE1veuR9gOCK5hp2f_aaJnY,7653
|
|
69
69
|
fuzzy_dl_owl2/fuzzydl/individual/individual.py,sha256=FgtOmJwkPUKIOr-o8a1NqHepL-sN5fGe314e895DHYg,3846
|
|
70
70
|
fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py,sha256=C5ZG43Xy0Iz71S5IYPzaBGeT-fWIqQGpg85DPgU1NjM,1070
|
|
71
|
-
fuzzy_dl_owl2/fuzzydl/knowledge_base.py,sha256=
|
|
71
|
+
fuzzy_dl_owl2/fuzzydl/knowledge_base.py,sha256=ve0NYDz1b2Up-ZoTzJO-JltyupMFhyy9meIzMvFIt-I,385863
|
|
72
72
|
fuzzy_dl_owl2/fuzzydl/label.py,sha256=KD39rTIlg0XhDJSVqNC6t0Pu60MVfO8xNGSjrcJFtD0,1023
|
|
73
73
|
fuzzy_dl_owl2/fuzzydl/milp/__init__.py,sha256=g2oFT2Ge8W5Li2kP2CJjpjJ1a0PRI2vDoDdzYDsEtDY,246
|
|
74
|
-
fuzzy_dl_owl2/fuzzydl/milp/expression.py,sha256=
|
|
75
|
-
fuzzy_dl_owl2/fuzzydl/milp/inequation.py,sha256=
|
|
76
|
-
fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py,sha256=
|
|
74
|
+
fuzzy_dl_owl2/fuzzydl/milp/expression.py,sha256=HTCSk_EGTO7ATIQuV65mKa06eY433PVs_8jyw4kbELg,6596
|
|
75
|
+
fuzzy_dl_owl2/fuzzydl/milp/inequation.py,sha256=4agNmrrT8K1uEnm553nD8OPwVY4l4rF3Dxw-_PBj5lw,2040
|
|
76
|
+
fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py,sha256=aghOzlFqkZUK53lIPXIeDbwgt2E6cCy805bN35DGq0E,58324
|
|
77
77
|
fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py,sha256=7y-lfhoERoE8qNSMr0cq_-Ezo46BGsNszp44YSVWA2A,5754
|
|
78
78
|
fuzzy_dl_owl2/fuzzydl/milp/solution.py,sha256=suoE1F2XORwzP4pNm-6Ivf6eK5Z98KFxFUdarh1CjQk,1210
|
|
79
|
-
fuzzy_dl_owl2/fuzzydl/milp/term.py,sha256=
|
|
79
|
+
fuzzy_dl_owl2/fuzzydl/milp/term.py,sha256=JIRO3rrMz1e6I3g0tElFbwXyOxtiy8L7Wh6EisQfSuM,2294
|
|
80
80
|
fuzzy_dl_owl2/fuzzydl/milp/variable.py,sha256=_qqLZpOkXCaeyguQQWLIQvTPzyPaMNSpPIAL4T0A9C8,2725
|
|
81
81
|
fuzzy_dl_owl2/fuzzydl/modifier/__init__.py,sha256=mgJml-9PVs566EYpwBxfmmiw8oPXiSgJRUyIX9hiSNA,126
|
|
82
82
|
fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py,sha256=Rn6q4ytIdTiCI-TRZIK5qjWSA4K3q78fYSrYxlQklVc,2022
|
|
@@ -117,13 +117,13 @@ fuzzy_dl_owl2/fuzzydl/restriction/__init__.py,sha256=rpjzuQK3xxYYA3WeXFDdIK9tXbU
|
|
|
117
117
|
fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py,sha256=DL-50TlD289OXVEEh_tK9Cu0ceP0ANmH-Q3k0oRe5ok,554
|
|
118
118
|
fuzzy_dl_owl2/fuzzydl/restriction/restriction.py,sha256=SyeFvaJeKcTe750eAbLoAVYkWTK_UjdqWr2Lw8OF1S0,948
|
|
119
119
|
fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py,sha256=1J5dtlVbiascxHBwAJ7uc97IHnJke9RWqxq5rgrrkoA,282
|
|
120
|
-
fuzzy_dl_owl2/fuzzydl/util/__init__.py,sha256=
|
|
121
|
-
fuzzy_dl_owl2/fuzzydl/util/config_reader.py,sha256=
|
|
122
|
-
fuzzy_dl_owl2/fuzzydl/util/constants.py,sha256=
|
|
120
|
+
fuzzy_dl_owl2/fuzzydl/util/__init__.py,sha256=3GufSMUuWGISGukXM5T5ZGA0BC1WX-5eLFSuttVYueU,109
|
|
121
|
+
fuzzy_dl_owl2/fuzzydl/util/config_reader.py,sha256=dh2Xa1sYVlKavbkKShHkxzA0ieLoQOV1JmzkOvIIVMI,3174
|
|
122
|
+
fuzzy_dl_owl2/fuzzydl/util/constants.py,sha256=tZKlMOZlZD9iKgaLv8NIId5WK04JuFg6FuXyA7zEe8E,12815
|
|
123
123
|
fuzzy_dl_owl2/fuzzydl/util/util.py,sha256=5COC79TAJz8fNrRzXLbNpAT9rLd_0KrRI1OU-hob3oU,1903
|
|
124
124
|
fuzzy_dl_owl2/fuzzydl/util/utils.py,sha256=TPVLEL9NJXgReuxEIOTEOVYqojSymg_-kyrLETXnYdo,2344
|
|
125
125
|
fuzzy_dl_owl2/fuzzyowl2/__init__.py,sha256=C44P0-Sn35FQdVMqYLzeDWa5qPmokbcs8GPiD_zQaSg,153
|
|
126
|
-
fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py,sha256=
|
|
126
|
+
fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py,sha256=TYnSLXK-oR7jsOEFR46WryA0gKVBLbBI0_3Cd-dHUuU,71691
|
|
127
127
|
fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py,sha256=egspxTzY4kNvhsQLP0AAaqJgFUqyO6VJuXLLOej06PA,36994
|
|
128
128
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
129
129
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py,sha256=ymnyNfvkvWA3y2UMXyPviD0U98vJ6jrX6zddj09SUoI,671
|
|
@@ -137,7 +137,7 @@ fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py,sha256=3MZR09E0AhUTEHQZY_RU
|
|
|
137
137
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py,sha256=CIm4rlSuvcI9dqLscASFHexjHKcJ06Wg3fZy__tw7H4,340
|
|
138
138
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py,sha256=JdjSemKb-mnVtVQhHnk_OAU8cvB3YRRmmEF0DLrtdXk,555
|
|
139
139
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py,sha256=3_GFKWMU4YrPrMC7bhEm7GDUKtCko8H5wx2dpGdXGZc,428
|
|
140
|
-
fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py,sha256=
|
|
140
|
+
fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py,sha256=d94ZQRWJ_BoH0lvM_XuwexeAlQGDZDB6Lq0WaO9acaQ,545
|
|
141
141
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py,sha256=rQNp8zSQ-tQYwcJsc3sCVhG1chtZ7Ev1MumSBOPbOwI,659
|
|
142
142
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py,sha256=5NZd22GcaPQKCrIZwCGzPgx1M5h41A3tH9qKI_m2WVc,268
|
|
143
143
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py,sha256=yfErtkNIWWW-QUgA4T6F7tL-sCPC0GXYYkR2xT8LHKk,598
|
|
@@ -152,11 +152,13 @@ fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py,sha256=NEIshfx9h4XyvfO
|
|
|
152
152
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py,sha256=_sEao87lwH2fKspVR_NrpilFwuI6g25E1mNDI55dtYk,510
|
|
153
153
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py,sha256=TrX3-M-LrG-5XgEo6LY8JESZpYwcaIX4rOCU8wfWE4k,510
|
|
154
154
|
fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py,sha256=OJW8-ZJXvYTFHrqC8hpVBTY6SwLCTTIe72MSAO3H7hk,524
|
|
155
|
-
fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py,sha256=
|
|
156
|
-
fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py,sha256=
|
|
157
|
-
fuzzy_dl_owl2/fuzzyowl2/
|
|
158
|
-
fuzzy_dl_owl2/fuzzyowl2/util/
|
|
159
|
-
fuzzy_dl_owl2
|
|
160
|
-
fuzzy_dl_owl2
|
|
161
|
-
fuzzy_dl_owl2-1.0.
|
|
162
|
-
fuzzy_dl_owl2-1.0.
|
|
155
|
+
fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py,sha256=HjRhpobpAAB569symjAAoN98RVIqo0P6KtsVLDxC3Ok,60
|
|
156
|
+
fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py,sha256=6rwMT_dGaaaKZQRotGiidbwqCOpLuPkyXaHXGQ5CV1k,20068
|
|
157
|
+
fuzzy_dl_owl2/fuzzyowl2/parser/owl2_xml_parser.py,sha256=qbx6SsrYUdDOn1-qClq-0ECIZ24MKPJCeAuvl6rwk_s,11234
|
|
158
|
+
fuzzy_dl_owl2/fuzzyowl2/util/__init__.py,sha256=4qG4CwkdYoT0vh3uX9N8DlmXh4QfKimVUqR4h2DR8Gg,50
|
|
159
|
+
fuzzy_dl_owl2/fuzzyowl2/util/constants.py,sha256=Oev5Q-H4mhmdvV3nrp0fZKZx8jpo9beXjJwm0dfDUSc,6970
|
|
160
|
+
fuzzy_dl_owl2/fuzzyowl2/util/fuzzy_xml.py,sha256=iYAodtBkZYt3cOvMBA0VEMOU87ljb-06_aUfH14gvwE,3416
|
|
161
|
+
fuzzy_dl_owl2-1.0.7.dist-info/LICENSE,sha256=er4Z7Ju3OzYUG5mbhh0krYVegIuv4PgehMzihVb2wpc,20131
|
|
162
|
+
fuzzy_dl_owl2-1.0.7.dist-info/METADATA,sha256=NM2tQrq1p7MNs5PbRMBl4ECC1qYG1EC-eqmWjTGHyNk,14681
|
|
163
|
+
fuzzy_dl_owl2-1.0.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
164
|
+
fuzzy_dl_owl2-1.0.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|