fuzzy-dl-owl2 1.0.5__tar.gz → 1.0.7__tar.gz
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-1.0.5 → fuzzy_dl_owl2-1.0.7}/PKG-INFO +72 -4
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/README.md +70 -2
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/feature_function.py +9 -3
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +204 -66
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/knowledge_base.py +13 -5
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/expression.py +13 -2
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/inequation.py +12 -0
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +1428 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/term.py +4 -1
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/__init__.py +1 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/config_reader.py +44 -2
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/constants.py +5 -6
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +25 -17
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +7 -1
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +2 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +7 -7
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_xml_parser.py +226 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +1 -0
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzyowl2/util/constants.py +198 -0
- fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzyowl2/util/fuzzy_xml.py +107 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/pyproject.toml +2 -2
- fuzzy_dl_owl2-1.0.5/fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +0 -788
- fuzzy_dl_owl2-1.0.5/fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +0 -1
- fuzzy_dl_owl2-1.0.5/fuzzy_dl_owl2/fuzzyowl2/util/constants.py +0 -112
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/LICENSE +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/assertion.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/assertion/atomic_assertion.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/all_some_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/approximation_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/atomic_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/choquet_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/crisp_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/triangular_fuzzy_number.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/left_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/linear_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/modified_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/right_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/trapezoidal_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/concrete/triangular_concrete_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/ext_threshold_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/has_value_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/implies_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concept_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concepts_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_concept_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_value_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_weighted_concepts_interface.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/linearly_modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/modified/triangularly_modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/negated_nominal.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/operator_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/owa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/qowa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/quasi_sugeno_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/self_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/string_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/sugeno_integral.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/threshold_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/truth_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/value_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_max_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_min_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_zero_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concept_equivalence.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/concrete_feature.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_expression.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_numeric.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/degree/degree_variable.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/domain_axiom.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/created_individual.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/individual.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/label.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/solution.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/milp/variable.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/modifier/triangular_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/parser/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/parser/dl_parser.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/primitive_concept_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/bnp_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/lom_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/mom_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/som_defuzzify_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/kb_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/max/max_subsumes_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_instance_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/min/min_subsumes_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/related_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/satisfiable_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/query/subsumption_query.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/range_axiom.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/relation.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/restriction/restriction.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/util.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzydl/util/utils.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/concept_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_datatype.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_nominal_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_property.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/left_shoulder_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/quasi_sugeno_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/right_shoulder_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/sugeno_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/trapezoidal_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_function.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_modifer.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py +0 -0
- {fuzzy_dl_owl2-1.0.5 → fuzzy_dl_owl2-1.0.7}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py +0 -0
|
@@ -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
|
|
|
@@ -54,17 +54,85 @@ The file `CONFIG.ini` is structured as follows:
|
|
|
54
54
|
```text
|
|
55
55
|
[DEFAULT]
|
|
56
56
|
debugPrint = False
|
|
57
|
-
relaxMilp = False
|
|
58
57
|
epsilon = 0.001
|
|
59
58
|
maxIndividuals = -1
|
|
59
|
+
owlAnnotationLabel = fuzzyLabel
|
|
60
|
+
milpProvider = mip
|
|
60
61
|
```
|
|
61
62
|
|
|
62
63
|
| Configuration Variable | Description |
|
|
63
64
|
|----------------------|-----------------------------------|
|
|
64
65
|
| debugPrint | Enable/disable debugging |
|
|
65
|
-
| relaxMilp | Enable/disable MILP constraint relaxation. Important: The solution may be wrong by enabling this flag |
|
|
66
66
|
| 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 |
|
|
67
67
|
| maxIndividuals | Define the maximal number of individuals to handle. The value -1 indicate that there is no maximum |
|
|
68
|
+
| owlAnnotationLabel | Define the Annotation label used to build the Fuzzy OWL 2 RDF/XML ontology |
|
|
69
|
+
| milpProvider | Define the MILP provider used by the reasoner. The supported providers are listed below. |
|
|
70
|
+
|
|
71
|
+
Supported MILP Providers:
|
|
72
|
+
| Provider | milpProvider |
|
|
73
|
+
|--------------|----------------------|
|
|
74
|
+
| Gurobi | gurobi |
|
|
75
|
+
| CPLEX | pulp_cplex |
|
|
76
|
+
| CBC | pulp |
|
|
77
|
+
| GLPK | pulp_glpk |
|
|
78
|
+
| HiGHS | pulp_highs |
|
|
79
|
+
| MIP | mip |
|
|
80
|
+
|
|
81
|
+
⸻
|
|
82
|
+
|
|
83
|
+
# MILP Provider Usage and Configuration
|
|
84
|
+
|
|
85
|
+
## GUROBI
|
|
86
|
+
|
|
87
|
+
- Install [gurobipy](https://pypi.org/project/gurobipy/):
|
|
88
|
+
```python
|
|
89
|
+
pip install gurobipy==12.0.0
|
|
90
|
+
```
|
|
91
|
+
- Download the GUROBI license from their [website](https://www.gurobi.com/solutions/licensing/).
|
|
92
|
+
- Add Gurobi to the PATH
|
|
93
|
+
|
|
94
|
+
## MIP
|
|
95
|
+
|
|
96
|
+
- Install python [MIP](https://www.python-mip.com/):
|
|
97
|
+
```python
|
|
98
|
+
pip install mip==1.16rc0
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## GLPK
|
|
102
|
+
|
|
103
|
+
- Install [GLPK](https://www.gnu.org/software/glpk/) v5.0 and [GMP](https://gmplib.org/) v6.3.0
|
|
104
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
105
|
+
```python
|
|
106
|
+
pip install pulp==3.2.1
|
|
107
|
+
```
|
|
108
|
+
- Add GLPK to the PATH
|
|
109
|
+
|
|
110
|
+
## CBC
|
|
111
|
+
|
|
112
|
+
- Install [CBC](https://github.com/coin-or/Cbc)
|
|
113
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
114
|
+
```python
|
|
115
|
+
pip install pulp==3.2.1
|
|
116
|
+
```
|
|
117
|
+
- Add CBC to the PATH
|
|
118
|
+
|
|
119
|
+
## CPLEX
|
|
120
|
+
|
|
121
|
+
- Install [CPLEX](https://www.ibm.com/it-it/products/ilog-cplex-optimization-studio) v22.11
|
|
122
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
123
|
+
```python
|
|
124
|
+
pip install pulp==3.2.1
|
|
125
|
+
```
|
|
126
|
+
- Add CPLEX to the PATH
|
|
127
|
+
|
|
128
|
+
## HiGHS
|
|
129
|
+
|
|
130
|
+
- Install [HiGHS](https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/) v1.10.0
|
|
131
|
+
- Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
|
|
132
|
+
```python
|
|
133
|
+
pip install pulp==3.2.1
|
|
134
|
+
```
|
|
135
|
+
- Add HiGHS to the PATH
|
|
68
136
|
|
|
69
137
|
⸻
|
|
70
138
|
|
|
@@ -122,26 +122,32 @@ class FeatureFunction:
|
|
|
122
122
|
self, a: Individual, milp: MILPHelper
|
|
123
123
|
) -> typing.Optional[Expression]:
|
|
124
124
|
if self.type == FeatureFunctionType.ATOMIC:
|
|
125
|
+
# Get the filler "b" for feature(a)
|
|
125
126
|
rel_set: list[Relation] = a.role_relations.get(self.feature)
|
|
127
|
+
assert len(rel_set) > 0
|
|
126
128
|
b: CreatedIndividual = typing.cast(
|
|
127
129
|
CreatedIndividual, rel_set[0].get_object_individual()
|
|
128
130
|
)
|
|
131
|
+
# Get the variable xB
|
|
129
132
|
x_b: Variable = milp.get_variable(b)
|
|
130
133
|
return Expression(Term(1.0, x_b))
|
|
131
134
|
elif self.type == FeatureFunctionType.NUMBER:
|
|
132
135
|
return Expression(self.n)
|
|
133
136
|
elif self.type == FeatureFunctionType.PRODUCT:
|
|
137
|
+
assert len(self.f) == 1
|
|
134
138
|
ex: Expression = self.f[0].to_expression(a, milp)
|
|
135
|
-
return
|
|
139
|
+
return ex * self.n
|
|
136
140
|
elif self.type == FeatureFunctionType.SUBTRACTION:
|
|
141
|
+
assert len(self.f) == 2
|
|
137
142
|
ex1: Expression = self.f[0].to_expression(a, milp)
|
|
138
143
|
ex2: Expression = self.f[1].to_expression(a, milp)
|
|
139
|
-
return
|
|
144
|
+
return ex1 - ex2
|
|
140
145
|
elif self.type == FeatureFunctionType.SUM:
|
|
146
|
+
assert len(self.f) >= 1
|
|
141
147
|
ex1: Expression = self.f[0].to_expression(a, milp)
|
|
142
148
|
for i in range(1, len(self.f)):
|
|
143
149
|
ex2: Expression = self.f[i].to_expression(a, milp)
|
|
144
|
-
ex1
|
|
150
|
+
ex1 = ex1 + ex2
|
|
145
151
|
return ex1
|
|
146
152
|
return None
|
|
147
153
|
|
|
@@ -64,6 +64,7 @@ from fuzzy_dl_owl2.fuzzydl.util import constants
|
|
|
64
64
|
from fuzzy_dl_owl2.fuzzydl.util.constants import ConceptType, ConcreteFeatureType
|
|
65
65
|
from fuzzy_dl_owl2.fuzzydl.util.util import Util
|
|
66
66
|
from fuzzy_dl_owl2.fuzzyowl2.util.constants import FuzzyOWL2Keyword
|
|
67
|
+
from fuzzy_dl_owl2.fuzzyowl2.util.fuzzy_xml import FuzzyXML
|
|
67
68
|
from pyowl2.abstracts.axiom import OWLAxiom
|
|
68
69
|
from pyowl2.abstracts.class_expression import OWLClassExpression
|
|
69
70
|
from pyowl2.abstracts.data_range import OWLDataRange
|
|
@@ -128,6 +129,8 @@ from pyowl2.individual.named_individual import OWLNamedIndividual
|
|
|
128
129
|
from pyowl2.literal.literal import OWLLiteral
|
|
129
130
|
from pyowl2.ontology import OWLOntology
|
|
130
131
|
|
|
132
|
+
from fuzzy_dl_owl2.fuzzydl.util.config_reader import ConfigReader
|
|
133
|
+
|
|
131
134
|
|
|
132
135
|
# @utils.timer_decorator
|
|
133
136
|
class FuzzydlToOwl2:
|
|
@@ -148,7 +151,7 @@ class FuzzydlToOwl2:
|
|
|
148
151
|
self.ontology_iri, OWL1_annotations=True
|
|
149
152
|
)
|
|
150
153
|
self.fuzzyLabel: OWLAnnotationProperty = OWLAnnotationProperty(
|
|
151
|
-
IRI(self.ontology_iri.namespace,
|
|
154
|
+
IRI(self.ontology_iri.namespace, ConfigReader.OWL_ANNOTATION_LABEL)
|
|
152
155
|
)
|
|
153
156
|
|
|
154
157
|
self.ontology.add_axiom(OWLDeclaration(self.fuzzyLabel))
|
|
@@ -276,11 +279,24 @@ class FuzzydlToOwl2:
|
|
|
276
279
|
c4: OWLClassExpression = self.get_new_atomic_class(str(c))
|
|
277
280
|
c3: OWLClassExpression = self.get_base(c.c1)
|
|
278
281
|
self.concepts[str(c)] = c3
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
|
|
283
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.CONCEPT.get_str_value())
|
|
284
|
+
concept_xml = FuzzyXML.build_concept_xml(
|
|
285
|
+
FuzzyOWL2Keyword.MODIFIED.get_str_value(),
|
|
286
|
+
{
|
|
287
|
+
FuzzyOWL2Keyword.MODIFIER.get_str_value(): str(
|
|
288
|
+
self.modifiers[str(c)]
|
|
289
|
+
),
|
|
290
|
+
FuzzyOWL2Keyword.BASE.get_str_value(): str(c3),
|
|
291
|
+
},
|
|
283
292
|
)
|
|
293
|
+
main_xml.append(concept_xml)
|
|
294
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
295
|
+
# annotation: str = (
|
|
296
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.CONCEPT.get_str_value()}">\n',
|
|
297
|
+
# f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{FuzzyOWL2Keyword.MODIFIED.get_str_value()}" {FuzzyOWL2Keyword.MODIFIER.get_str_value()}="{self.modifiers[str(c)]}" {FuzzyOWL2Keyword.BASE.get_str_value()}="{c3}"/>\n',
|
|
298
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>",
|
|
299
|
+
# )
|
|
284
300
|
self.add_entity_annotation(annotation, c4)
|
|
285
301
|
return c4
|
|
286
302
|
elif c_type == ConceptType.SELF:
|
|
@@ -331,11 +347,22 @@ class FuzzydlToOwl2:
|
|
|
331
347
|
c: WeightedConcept = typing.cast(WeightedConcept, c)
|
|
332
348
|
c4: OWLClassExpression = self.get_new_atomic_class(str(c))
|
|
333
349
|
c3: OWLClassExpression = self.get_base(c.c1)
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
350
|
+
|
|
351
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.CONCEPT.get_str_value())
|
|
352
|
+
concept_xml = FuzzyXML.build_concept_xml(
|
|
353
|
+
FuzzyOWL2Keyword.WEIGHTED.get_str_value(),
|
|
354
|
+
{
|
|
355
|
+
FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value(): str(c.weight),
|
|
356
|
+
FuzzyOWL2Keyword.BASE.get_str_value(): str(c3),
|
|
357
|
+
},
|
|
338
358
|
)
|
|
359
|
+
main_xml.append(concept_xml)
|
|
360
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
361
|
+
# annotation: str = (
|
|
362
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.CONCEPT.get_str_value()}">\n',
|
|
363
|
+
# f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{FuzzyOWL2Keyword.WEIGHTED.get_str_value()}" {FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value()}="{c.weight}" {FuzzyOWL2Keyword.BASE.get_str_value()}="{c3}"/>\n',
|
|
364
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>",
|
|
365
|
+
# )
|
|
339
366
|
self.add_entity_annotation(annotation, c3)
|
|
340
367
|
return c4
|
|
341
368
|
elif c_type in (
|
|
@@ -378,16 +405,33 @@ class FuzzydlToOwl2:
|
|
|
378
405
|
curr_concept: HasWeightedConceptsInterface = type_cast[c.type](c)
|
|
379
406
|
c3: OWLClassExpression = self.get_new_atomic_class(str(curr_concept))
|
|
380
407
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{type_dict[c.type]}">\n ',
|
|
384
|
-
)
|
|
408
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.CONCEPT.get_str_value())
|
|
409
|
+
concept_xml = FuzzyXML.build_concept_xml(type_dict[c.type])
|
|
385
410
|
for i in range(len(curr_concept.concepts)):
|
|
386
411
|
c5: OWLClassExpression = self.get_base(curr_concept.concepts[i])
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
412
|
+
sub_concept_xml = FuzzyXML.build_concept_xml(
|
|
413
|
+
FuzzyOWL2Keyword.WEIGHTED.get_str_value(),
|
|
414
|
+
{
|
|
415
|
+
FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value(): str(
|
|
416
|
+
curr_concept.weights[i]
|
|
417
|
+
),
|
|
418
|
+
FuzzyOWL2Keyword.BASE.get_str_value(): str(c5),
|
|
419
|
+
},
|
|
420
|
+
)
|
|
421
|
+
concept_xml.append(sub_concept_xml)
|
|
422
|
+
main_xml.append(concept_xml)
|
|
423
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
424
|
+
|
|
425
|
+
# annotation: str = (
|
|
426
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.CONCEPT.get_str_value()}">\n',
|
|
427
|
+
# f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{type_dict[c.type]}">\n ',
|
|
428
|
+
# )
|
|
429
|
+
# for i in range(len(curr_concept.concepts)):
|
|
430
|
+
# c5: OWLClassExpression = self.get_base(curr_concept.concepts[i])
|
|
431
|
+
# annotation += f'\t\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{FuzzyOWL2Keyword.WEIGHTED.get_str_value()}" {FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value()}="{curr_concept.weights[i]}" {FuzzyOWL2Keyword.BASE.get_str_value()}="{c5}" />\n'
|
|
432
|
+
# annotation: str = (
|
|
433
|
+
# f"\t</{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} >\n</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} >"
|
|
434
|
+
# )
|
|
391
435
|
self.add_entity_annotation(annotation, c3)
|
|
392
436
|
return c3
|
|
393
437
|
|
|
@@ -411,18 +455,31 @@ class FuzzydlToOwl2:
|
|
|
411
455
|
return None
|
|
412
456
|
curr_concept: HasWeightedConceptsInterface = type_cast[c.type](c)
|
|
413
457
|
c4: OWLClassExpression = self.get_new_atomic_class(str(c))
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
458
|
+
|
|
459
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.CONCEPT.get_str_value())
|
|
460
|
+
concept_xml = FuzzyXML.build_concept_xml(type_dict[c.type])
|
|
461
|
+
weights_xml = FuzzyXML.build_weights_xml(curr_concept.weights)
|
|
462
|
+
names_xml = FuzzyXML.build_names_xml(
|
|
463
|
+
[self.get_base(ci) for ci in curr_concept.concepts]
|
|
418
464
|
)
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
465
|
+
concept_xml.append(weights_xml)
|
|
466
|
+
concept_xml.append(names_xml)
|
|
467
|
+
main_xml.append(concept_xml)
|
|
468
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
469
|
+
|
|
470
|
+
# annotation: str = (
|
|
471
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.CONCEPT.get_str_value()}">\n',
|
|
472
|
+
# f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{type_dict[c.type]}">\n',
|
|
473
|
+
# f"\t\t<{FuzzyOWL2Keyword.WEIGHTS.get_tag_name()}>\n",
|
|
474
|
+
# )
|
|
475
|
+
# for d in curr_concept.weights:
|
|
476
|
+
# annotation += f"\t\t\t<{FuzzyOWL2Keyword.WEIGHT.get_tag_name()}>{d}</{FuzzyOWL2Keyword.WEIGHT.get_tag_name()}>\n"
|
|
477
|
+
# annotation += f"\t\t</{FuzzyOWL2Keyword.WEIGHTS.get_tag_name()}>\n\t\t<{FuzzyOWL2Keyword.CONCEPT_NAMES.get_tag_name()}>\n"
|
|
478
|
+
# for ci in curr_concept.concepts:
|
|
479
|
+
# c5: OWLClassExpression = self.get_base(ci)
|
|
480
|
+
# annotation += f"\t\t\t<{FuzzyOWL2Keyword.NAME.get_tag_name()}>{c5}</{FuzzyOWL2Keyword.NAME.get_tag_name()}>\n"
|
|
481
|
+
# annotation += f"\t\t</{FuzzyOWL2Keyword.CONCEPT_NAMES.get_tag_name()}>\n\t</{FuzzyOWL2Keyword.CONCEPT.get_tag_name()}>\n</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
482
|
+
|
|
426
483
|
self.add_entity_annotation(annotation, c4)
|
|
427
484
|
return c4
|
|
428
485
|
|
|
@@ -438,15 +495,27 @@ class FuzzydlToOwl2:
|
|
|
438
495
|
return None
|
|
439
496
|
curr_concept: QowaConcept = type_cast[c.type](c)
|
|
440
497
|
c4: OWLClassExpression = self.get_new_atomic_class(str(c))
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
498
|
+
|
|
499
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.CONCEPT.get_str_value())
|
|
500
|
+
concept_xml = FuzzyXML.build_concept_xml(
|
|
501
|
+
type_dict[c.type],
|
|
502
|
+
{FuzzyOWL2Keyword.QUANTIFIER.get_str_value(): str(curr_concept.quantifier)},
|
|
503
|
+
)
|
|
504
|
+
names_xml = FuzzyXML.build_names_xml(
|
|
505
|
+
[self.get_base(ci) for ci in curr_concept.concepts]
|
|
445
506
|
)
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
annotation
|
|
507
|
+
concept_xml.append(names_xml)
|
|
508
|
+
main_xml.append(concept_xml)
|
|
509
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
510
|
+
# annotation: str = (
|
|
511
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.CONCEPT.get_str_value()}">\n',
|
|
512
|
+
# f'\t<{FuzzyOWL2Keyword.CONCEPT.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{type_dict[c.type]}" {FuzzyOWL2Keyword.QUANTIFIER.get_str_value()}="{curr_concept.quantifier}">\n',
|
|
513
|
+
# f"\t\t<{FuzzyOWL2Keyword.CONCEPT_NAMES.get_tag_name()}>\n",
|
|
514
|
+
# )
|
|
515
|
+
# for ci in curr_concept.concepts:
|
|
516
|
+
# c5: OWLClassExpression = self.get_base(ci)
|
|
517
|
+
# annotation += f"\t\t\t<{FuzzyOWL2Keyword.NAME.get_tag_name()}>{c5}</{FuzzyOWL2Keyword.NAME.get_tag_name()}>\n"
|
|
518
|
+
# annotation += f"\t\t</{FuzzyOWL2Keyword.CONCEPT_NAMES.get_tag_name()}>\n\t</{FuzzyOWL2Keyword.CONCEPT.get_tag_name()}>\n</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
450
519
|
self.add_entity_annotation(annotation, c4)
|
|
451
520
|
return c4
|
|
452
521
|
|
|
@@ -549,11 +618,16 @@ class FuzzydlToOwl2:
|
|
|
549
618
|
elif isinstance(value, DegreeNumeric): # Degree object
|
|
550
619
|
n = value.get_numerical_value()
|
|
551
620
|
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
621
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.AXIOM.get_str_value())
|
|
622
|
+
degree_xml = FuzzyXML.build_degree_xml(n)
|
|
623
|
+
main_xml.append(degree_xml)
|
|
624
|
+
annotation_text: str = FuzzyXML.to_str(main_xml)
|
|
625
|
+
|
|
626
|
+
# annotation_text: str = (
|
|
627
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.AXIOM.get_str_value()}">\n'
|
|
628
|
+
# f'\t<{FuzzyOWL2Keyword.DEGREE_DEF.get_tag_name()} {FuzzyOWL2Keyword.DEGREE_VALUE.get_str_value()}="{n}"/>\n'
|
|
629
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
630
|
+
# )
|
|
557
631
|
annotation: OWLAnnotation = self.to_owl_annotation(annotation_text)
|
|
558
632
|
return set([annotation])
|
|
559
633
|
|
|
@@ -590,11 +664,17 @@ class FuzzydlToOwl2:
|
|
|
590
664
|
logic = str(constants.KNOWLEDGE_BASE_SEMANTICS)
|
|
591
665
|
|
|
592
666
|
if logic:
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
f'\t<{FuzzyOWL2Keyword.FUZZY_LOGIC.get_tag_name()} {FuzzyOWL2Keyword.LOGIC.get_str_value()}="{logic}" />\n'
|
|
596
|
-
f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
667
|
+
main_xml = FuzzyXML.build_main_xml(
|
|
668
|
+
FuzzyOWL2Keyword.ONTOLOGY.get_str_value()
|
|
597
669
|
)
|
|
670
|
+
logic_xml = FuzzyXML.build_logic_xml(logic)
|
|
671
|
+
main_xml.append(logic_xml)
|
|
672
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
673
|
+
# annotation: str = (
|
|
674
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.ONTOLOGY.get_str_value()}">\n'
|
|
675
|
+
# f'\t<{FuzzyOWL2Keyword.FUZZY_LOGIC.get_tag_name()} {FuzzyOWL2Keyword.LOGIC.get_str_value()}="{logic}" />\n'
|
|
676
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
677
|
+
# )
|
|
598
678
|
self.add_ontology_annotation(annotation)
|
|
599
679
|
|
|
600
680
|
# Process concrete concepts
|
|
@@ -813,7 +893,8 @@ class FuzzydlToOwl2:
|
|
|
813
893
|
current_datatype: OWLDatatype = OWLDatatype(self.iri(c))
|
|
814
894
|
self.datatypes[str(c)] = current_datatype
|
|
815
895
|
|
|
816
|
-
specific: str = self._get_concrete_concept_specifics(c)
|
|
896
|
+
# specific: str = self._get_concrete_concept_specifics(c)
|
|
897
|
+
specific: tuple[str, dict[str, str]] = self._get_concrete_concept_specifics(c)
|
|
817
898
|
|
|
818
899
|
int_datatype: OWLDatatype = OWLDatatype(XSD.integer)
|
|
819
900
|
greater_than: OWLDatatypeRestriction = OWLDatatypeRestriction(
|
|
@@ -843,45 +924,102 @@ class FuzzydlToOwl2:
|
|
|
843
924
|
self.ontology.add_axiom(OWLDeclaration(current_datatype))
|
|
844
925
|
self.ontology.add_axiom(definition)
|
|
845
926
|
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
927
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.DATATYPE.get_str_value())
|
|
928
|
+
datatype_xml = FuzzyXML.build_datatype_xml(specific[0], specific[1])
|
|
929
|
+
main_xml.append(datatype_xml)
|
|
930
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
931
|
+
|
|
932
|
+
# annotation: str = (
|
|
933
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.DATATYPE.get_str_value()}">\n'
|
|
934
|
+
# f'\t<{FuzzyOWL2Keyword.DATATYPE.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{specific}"/>\n'
|
|
935
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
936
|
+
# )
|
|
851
937
|
self.add_entity_annotation(annotation, current_datatype)
|
|
852
938
|
|
|
853
|
-
def _get_concrete_concept_specifics(
|
|
939
|
+
def _get_concrete_concept_specifics(
|
|
940
|
+
self, c: FuzzyConcreteConcept
|
|
941
|
+
) -> tuple[str, dict[str, str]]:
|
|
854
942
|
"""Get concrete concept specific parameters"""
|
|
855
943
|
if isinstance(c, CrispConcreteConcept):
|
|
856
|
-
return
|
|
944
|
+
return FuzzyOWL2Keyword.CRISP.get_str_value(), {
|
|
945
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(c.a),
|
|
946
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(c.b),
|
|
947
|
+
}
|
|
857
948
|
elif isinstance(c, LeftConcreteConcept):
|
|
858
|
-
return
|
|
949
|
+
return FuzzyOWL2Keyword.LEFT_SHOULDER.get_str_value(), {
|
|
950
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(c.a),
|
|
951
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(c.b),
|
|
952
|
+
}
|
|
859
953
|
elif isinstance(c, RightConcreteConcept):
|
|
860
|
-
return
|
|
954
|
+
return FuzzyOWL2Keyword.RIGHT_SHOULDER.get_str_value(), {
|
|
955
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(c.a),
|
|
956
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(c.b),
|
|
957
|
+
}
|
|
861
958
|
elif isinstance(c, TriangularConcreteConcept):
|
|
862
|
-
return
|
|
959
|
+
return FuzzyOWL2Keyword.TRIANGULAR.get_str_value(), {
|
|
960
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(c.a),
|
|
961
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(c.b),
|
|
962
|
+
FuzzyOWL2Keyword.C.get_str_value(): str(c.c),
|
|
963
|
+
}
|
|
863
964
|
elif isinstance(c, TrapezoidalConcreteConcept):
|
|
864
|
-
return
|
|
865
|
-
|
|
965
|
+
return FuzzyOWL2Keyword.TRAPEZOIDAL.get_str_value(), {
|
|
966
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(c.a),
|
|
967
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(c.b),
|
|
968
|
+
FuzzyOWL2Keyword.C.get_str_value(): str(c.c),
|
|
969
|
+
FuzzyOWL2Keyword.D.get_str_value(): str(c.d),
|
|
970
|
+
}
|
|
971
|
+
return "", dict()
|
|
972
|
+
|
|
973
|
+
# def _get_concrete_concept_specifics(self, c: FuzzyConcreteConcept) -> str:
|
|
974
|
+
# """Get concrete concept specific parameters"""
|
|
975
|
+
# if isinstance(c, CrispConcreteConcept):
|
|
976
|
+
# return f'{FuzzyOWL2Keyword.CRISP.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{c.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{c.b}'
|
|
977
|
+
# elif isinstance(c, LeftConcreteConcept):
|
|
978
|
+
# return f'{FuzzyOWL2Keyword.LEFT_SHOULDER.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{c.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{c.b}'
|
|
979
|
+
# elif isinstance(c, RightConcreteConcept):
|
|
980
|
+
# return f'{FuzzyOWL2Keyword.RIGHT_SHOULDER.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{c.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{c.b}'
|
|
981
|
+
# elif isinstance(c, TriangularConcreteConcept):
|
|
982
|
+
# return f'{FuzzyOWL2Keyword.TRIANGULAR.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{c.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{c.b}" {FuzzyOWL2Keyword.C.get_str_value()}="{c.c}'
|
|
983
|
+
# elif isinstance(c, TrapezoidalConcreteConcept):
|
|
984
|
+
# return f'{FuzzyOWL2Keyword.TRAPEZOIDAL.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{c.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{c.b}" {FuzzyOWL2Keyword.C.get_str_value()}="{c.c}" {FuzzyOWL2Keyword.D.get_str_value()}="{c.d}'
|
|
985
|
+
# return ""
|
|
866
986
|
|
|
867
987
|
def _process_modifier(self, mod: Modifier) -> None:
|
|
868
988
|
"""Process a modifier"""
|
|
869
989
|
Util.debug(f"Process modifier -> {mod}")
|
|
990
|
+
|
|
991
|
+
main_xml = FuzzyXML.build_main_xml(FuzzyOWL2Keyword.MODIFIER.get_str_value())
|
|
992
|
+
|
|
870
993
|
if isinstance(mod, LinearModifier):
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
994
|
+
modifier_xml = FuzzyXML.build_modifier_xml(
|
|
995
|
+
FuzzyOWL2Keyword.LINEAR.get_str_value(),
|
|
996
|
+
{FuzzyOWL2Keyword.C.get_str_value(): str(mod.c)},
|
|
875
997
|
)
|
|
998
|
+
# annotation: str = (
|
|
999
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.MODIFIER.get_str_value()}">\n'
|
|
1000
|
+
# f'\t<{FuzzyOWL2Keyword.MODIFIER.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{FuzzyOWL2Keyword.LINEAR.get_str_value()}" {FuzzyOWL2Keyword.C.get_str_value()}="{mod.c}"/>\n'
|
|
1001
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
1002
|
+
# )
|
|
876
1003
|
elif isinstance(mod, TriangularModifier):
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
1004
|
+
modifier_xml = FuzzyXML.build_modifier_xml(
|
|
1005
|
+
FuzzyOWL2Keyword.TRIANGULAR.get_str_value(),
|
|
1006
|
+
{
|
|
1007
|
+
FuzzyOWL2Keyword.A.get_str_value(): str(mod.a),
|
|
1008
|
+
FuzzyOWL2Keyword.B.get_str_value(): str(mod.b),
|
|
1009
|
+
FuzzyOWL2Keyword.C.get_str_value(): str(mod.c),
|
|
1010
|
+
},
|
|
881
1011
|
)
|
|
1012
|
+
# annotation: str = (
|
|
1013
|
+
# f'<{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()} {FuzzyOWL2Keyword.FUZZY_TYPE.get_str_value()}="{FuzzyOWL2Keyword.MODIFIER.get_str_value()}">\n'
|
|
1014
|
+
# f'\t<{FuzzyOWL2Keyword.MODIFIER.get_tag_name()} {FuzzyOWL2Keyword.TYPE.get_str_value()}="{FuzzyOWL2Keyword.TRIANGULAR.get_str_value()}" {FuzzyOWL2Keyword.A.get_str_value()}="{mod.a}" {FuzzyOWL2Keyword.B.get_str_value()}="{mod.b}" {FuzzyOWL2Keyword.C.get_str_value()}="{mod.c}"/>\n'
|
|
1015
|
+
# f"</{FuzzyOWL2Keyword.FUZZY_OWL_2.get_str_value()}>"
|
|
1016
|
+
# )
|
|
882
1017
|
else:
|
|
883
1018
|
raise ValueError(f"Unknown modifier type: {type(mod)}")
|
|
884
1019
|
|
|
1020
|
+
main_xml.append(modifier_xml)
|
|
1021
|
+
annotation: str = FuzzyXML.to_str(main_xml)
|
|
1022
|
+
|
|
885
1023
|
current_datatype: OWLDatatype = OWLDatatype(self.iri(mod))
|
|
886
1024
|
self.modifiers[str(mod)] = current_datatype
|
|
887
1025
|
self.ontology.add_axiom(OWLDeclaration(current_datatype))
|