fuzzy-dl-owl2 1.0.7__tar.gz → 1.0.9__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.
Files changed (171) hide show
  1. fuzzy_dl_owl2-1.0.9/PKG-INFO +848 -0
  2. fuzzy_dl_owl2-1.0.9/README.md +822 -0
  3. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/__init__.py +2 -1
  4. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/assertion/assertion.py +1 -0
  5. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/assertion/atomic_assertion.py +2 -0
  6. fuzzy_dl_owl2-1.0.9/fuzzy_dl_owl2/fuzzydl/classification_node.py +64 -0
  7. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/__init__.py +2 -0
  8. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/atomic_concept.py +1 -1
  9. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/choquet_integral.py +6 -0
  10. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concept.py +8 -0
  11. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/crisp_concrete_concept.py +1 -0
  12. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_concrete_concept.py +1 -0
  13. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/triangular_fuzzy_number.py +12 -0
  14. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/left_concrete_concept.py +3 -0
  15. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/linear_concrete_concept.py +3 -0
  16. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/modified_concrete_concept.py +4 -0
  17. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/right_concrete_concept.py +2 -0
  18. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/trapezoidal_concrete_concept.py +1 -0
  19. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/triangular_concrete_concept.py +2 -0
  20. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/modified/linearly_modified_concept.py +3 -0
  21. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/modified/modified_concept.py +3 -0
  22. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/modified/triangularly_modified_concept.py +3 -0
  23. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/negated_nominal.py +3 -0
  24. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/operator_concept.py +8 -0
  25. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/qowa_concept.py +4 -0
  26. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/quasi_sugeno_integral.py +3 -0
  27. fuzzy_dl_owl2-1.0.9/fuzzy_dl_owl2/fuzzydl/concept/sigma_concept.py +71 -0
  28. fuzzy_dl_owl2-1.0.9/fuzzy_dl_owl2/fuzzydl/concept/sigma_count.py +56 -0
  29. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/sugeno_integral.py +4 -0
  30. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept_equivalence.py +5 -0
  31. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concrete_feature.py +6 -0
  32. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/domain_axiom.py +3 -0
  33. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/feature_function.py +3 -0
  34. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/fuzzydl_to_owl2.py +169 -27
  35. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/general_concept_inclusion.py +6 -0
  36. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/individual/created_individual.py +41 -2
  37. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/individual/individual.py +14 -0
  38. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/individual/representative_individual.py +9 -0
  39. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/knowledge_base.py +2033 -249
  40. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/label.py +18 -10
  41. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/expression.py +33 -23
  42. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/inequation.py +8 -0
  43. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/milp_helper.py +720 -22
  44. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/show_variables_helper.py +82 -0
  45. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/solution.py +23 -0
  46. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/variable.py +7 -0
  47. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/modifier/linear_modifier.py +3 -0
  48. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/modifier/modifier.py +21 -0
  49. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/parser/dl_parser.py +48 -7
  50. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/primitive_concept_definition.py +7 -0
  51. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/__init__.py +1 -0
  52. fuzzy_dl_owl2-1.0.9/fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +129 -0
  53. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/bnp_query.py +2 -0
  54. fuzzy_dl_owl2-1.0.9/fuzzy_dl_owl2/fuzzydl/query/classification_query.py +26 -0
  55. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/defuzzify_query.py +2 -1
  56. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/lom_defuzzify_query.py +4 -0
  57. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/mom_defuzzify_query.py +6 -2
  58. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/som_defuzzify_query.py +2 -0
  59. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/instance_query.py +5 -0
  60. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/kb_satisfiable_query.py +12 -2
  61. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/max_instance_query.py +6 -1
  62. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/max_query.py +7 -1
  63. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/max_related_query.py +6 -1
  64. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/max_satisfiable_query.py +15 -1
  65. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/max_subsumes_query.py +4 -1
  66. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/min_instance_query.py +6 -1
  67. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/min_query.py +7 -1
  68. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/min_related_query.py +5 -1
  69. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/min_satisfiable_query.py +17 -1
  70. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/min_subsumes_query.py +47 -7
  71. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/query.py +5 -2
  72. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/related_query.py +8 -1
  73. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/satisfiable_query.py +17 -0
  74. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/subsumption_query.py +5 -0
  75. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/range_axiom.py +4 -0
  76. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/relation.py +5 -0
  77. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/restriction/has_value_restriction.py +2 -0
  78. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/restriction/restriction.py +3 -0
  79. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/role_parent_with_degree.py +6 -1
  80. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/util/config_reader.py +17 -27
  81. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/util/constants.py +100 -0
  82. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/pyproject.toml +3 -2
  83. fuzzy_dl_owl2-1.0.7/PKG-INFO +0 -408
  84. fuzzy_dl_owl2-1.0.7/README.md +0 -383
  85. fuzzy_dl_owl2-1.0.7/fuzzy_dl_owl2/fuzzydl/query/all_instances_query.py +0 -50
  86. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/LICENSE +0 -0
  87. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/__init__.py +0 -0
  88. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/assertion/__init__.py +0 -0
  89. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/all_some_concept.py +0 -0
  90. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/approximation_concept.py +0 -0
  91. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/__init__.py +0 -0
  92. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/concrete/fuzzy_number/__init__.py +0 -0
  93. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/ext_threshold_concept.py +0 -0
  94. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/has_value_concept.py +0 -0
  95. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/implies_concept.py +0 -0
  96. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/__init__.py +0 -0
  97. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concept_interface.py +0 -0
  98. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_concepts_interface.py +0 -0
  99. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_concept_interface.py +0 -0
  100. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_role_interface.py +0 -0
  101. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_value_interface.py +0 -0
  102. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/interface/has_weighted_concepts_interface.py +0 -0
  103. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/modified/__init__.py +0 -0
  104. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/owa_concept.py +0 -0
  105. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/self_concept.py +0 -0
  106. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/string_concept.py +0 -0
  107. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/threshold_concept.py +0 -0
  108. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/truth_concept.py +0 -0
  109. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/value_concept.py +0 -0
  110. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/weighted_concept.py +0 -0
  111. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/weighted_max_concept.py +0 -0
  112. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/weighted_min_concept.py +0 -0
  113. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_concept.py +0 -0
  114. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/concept/weighted_sum_zero_concept.py +0 -0
  115. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/degree/__init__.py +0 -0
  116. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/degree/degree.py +0 -0
  117. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/degree/degree_expression.py +0 -0
  118. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/degree/degree_numeric.py +0 -0
  119. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/degree/degree_variable.py +0 -0
  120. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/exception/__init__.py +0 -0
  121. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/exception/fuzzy_ontology_exception.py +0 -0
  122. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/exception/inconsistent_ontology_exception.py +0 -0
  123. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/individual/__init__.py +0 -0
  124. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/__init__.py +0 -0
  125. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/milp/term.py +0 -0
  126. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/modifier/__init__.py +0 -0
  127. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/modifier/triangular_modifier.py +0 -0
  128. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/parser/__init__.py +0 -0
  129. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/defuzzify/__init__.py +0 -0
  130. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/max/__init__.py +0 -0
  131. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/query/min/__init__.py +0 -0
  132. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/restriction/__init__.py +0 -0
  133. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/util/__init__.py +0 -0
  134. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/util/util.py +0 -0
  135. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzydl/util/utils.py +0 -0
  136. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/__init__.py +0 -0
  137. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2.py +0 -0
  138. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/fuzzyowl2_to_fuzzydl.py +0 -0
  139. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/__init__.py +0 -0
  140. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/choquet_concept.py +0 -0
  141. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/concept_definition.py +0 -0
  142. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_datatype.py +0 -0
  143. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_modifier.py +0 -0
  144. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_nominal_concept.py +0 -0
  145. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/fuzzy_property.py +0 -0
  146. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/left_shoulder_function.py +0 -0
  147. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_function.py +0 -0
  148. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/linear_modifier.py +0 -0
  149. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_concept.py +0 -0
  150. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_function.py +0 -0
  151. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/modified_property.py +0 -0
  152. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/owa_concept.py +0 -0
  153. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/property_definition.py +0 -0
  154. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/qowa_concept.py +0 -0
  155. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/quasi_sugeno_concept.py +0 -0
  156. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/right_shoulder_function.py +0 -0
  157. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/sugeno_concept.py +0 -0
  158. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/trapezoidal_function.py +0 -0
  159. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_function.py +0 -0
  160. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/triangular_modifer.py +0 -0
  161. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_concept.py +0 -0
  162. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_max_concept.py +0 -0
  163. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_min_concept.py +0 -0
  164. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_concept.py +0 -0
  165. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/owl_types/weighted_sum_zero_concept.py +0 -0
  166. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/parser/__init__.py +0 -0
  167. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_parser.py +0 -0
  168. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/parser/owl2_xml_parser.py +0 -0
  169. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/util/__init__.py +0 -0
  170. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/util/constants.py +0 -0
  171. {fuzzy_dl_owl2-1.0.7 → fuzzy_dl_owl2-1.0.9}/fuzzy_dl_owl2/fuzzyowl2/util/fuzzy_xml.py +0 -0
@@ -0,0 +1,848 @@
1
+ Metadata-Version: 2.3
2
+ Name: fuzzy-dl-owl2
3
+ Version: 1.0.9
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
+ License: CC-BY-SA-4.0
6
+ Author: Giuseppe Filippone
7
+ Author-email: filipponegiuseppe94@gmail.com
8
+ Requires-Python: >=3.11,<4.0
9
+ Classifier: License :: Other/Proprietary License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.11
12
+ Classifier: Programming Language :: Python :: 3.12
13
+ Classifier: Programming Language :: Python :: 3.13
14
+ Requires-Dist: networkx (>=3.3,<4.0)
15
+ Requires-Dist: owlready2 (>=0.47,<0.48)
16
+ Requires-Dist: pyowl2 (>=1.0.3,<2.0.0)
17
+ Requires-Dist: pyparsing (>=3.2.3,<4.0.0)
18
+ Requires-Dist: rdflib (>=7.1.4,<8.0.0)
19
+ Requires-Dist: setuptools (>=80.8.0,<81.0.0)
20
+ Requires-Dist: sortedcontainers (>=2.4.0,<3.0.0)
21
+ Requires-Dist: trycast (>=1.2.0,<2.0.0)
22
+ Project-URL: Documentation, https://fuzzy-dl-owl2.readthedocs.io/en/latest/
23
+ Project-URL: Repository, https://github.com/giuseppefilippone/fuzzy_dl_owl2
24
+ Description-Content-Type: text/markdown
25
+
26
+ ![Docs](https://img.shields.io/badge/docs-passing-brightgreen.svg)
27
+ ![Tests](https://img.shields.io/badge/tests-passing-brightgreen.svg)
28
+ [![Documentation](https://img.shields.io/badge/Read%20the%20Docs-8CA1AF?logo=readthedocs&logoColor=white)](https://fuzzy-dl-owl2.readthedocs.io/en/latest)
29
+ [![PyPI](https://img.shields.io/pypi/v/fuzzy-dl-owl2.svg)](https://pypi.org/project/fuzzy-dl-owl2/)
30
+ ![Python Versions](https://img.shields.io/pypi/pyversions/fuzzy-dl-owl2.svg)
31
+ ![Code Style](https://img.shields.io/badge/code%20style-python-green)
32
+
33
+
34
+ # Fuzzy DL OWL 2
35
+ A python porting of the [Fuzzy Description Language](https://www.umbertostraccia.it/cs/software/fuzzyDL/fuzzyDL.html) and the [Fuzzy OWL 2](https://www.umbertostraccia.it/cs/software/FuzzyOWL/index.html) framework.
36
+
37
+ ---
38
+
39
+ A lightweight Python porting of the Fuzzy Description Language (FuzzyDL) and the Fuzzy OWL 2 framework, designed for representing fuzzy logic within description logic and for mapping an knowledge base represented in FuzzyDL to a Fuzzy OWL 2 construct in RDF/XML format.
40
+
41
+ Features:
42
+ - Object-oriented representation of Fuzzy Description Logic elements
43
+ - Object-oriented representation of Fuzzy OWL 2 elements
44
+ - Mapping from FuzzyDL to Fuzzy OWL 2
45
+ - Mapping from Fuzzy OWL 2 to FuzzyDL
46
+ - Reasoning in FuzzyDL
47
+
48
+ ---
49
+
50
+ # Installation
51
+
52
+ ```python
53
+ pip install fuzzy-dl-owl2
54
+ ```
55
+
56
+ ---
57
+
58
+ Examples of supported Fuzzy Description Logic Constructs
59
+
60
+ | Python Class | Description |
61
+ |----------------------|-----------------------------------|
62
+ | AtomicConcept | Define an atomic concept |
63
+ | ChoquetIntegral | Define a choquet integral concept |
64
+ | ApproximationConcept | Define a tight/upper/* lower/upper approximation concept |
65
+
66
+ ---
67
+
68
+ # Directory dl-examples
69
+
70
+ The directory `dl-examples` contains a few examples of Knowledge Bases written using the Fuzzy Description Logic language.
71
+
72
+ ---
73
+
74
+ # Configuration of the MILP solver
75
+
76
+ Since version 1.0.1 uses `Gurobi Optimizer` (see [gurobipy](https://support.gurobi.com/hc/en-us/articles/360044290292-How-do-I-install-Gurobi-for-Python) for the Fuzzy DL reasoning, please create a GUROBI license to use this library.
77
+
78
+ For the configuration, create a `CONFIG.ini` file in the same directory used for the execution of the library.
79
+ Example of your execution directory:
80
+ ```text
81
+ your_directory
82
+ ├── CONFIG.ini
83
+ ├── your_file.py
84
+ ```
85
+
86
+ The file `CONFIG.ini` is structured as follows:
87
+ ```text
88
+ [DEFAULT]
89
+ debugPrint = False
90
+ epsilon = 0.001
91
+ maxIndividuals = -1
92
+ owlAnnotationLabel = fuzzyLabel
93
+ milpProvider = mip
94
+ ```
95
+
96
+ | Configuration Variable | Description |
97
+ |----------------------|-----------------------------------|
98
+ | debugPrint | Enable/disable debugging |
99
+ | 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 |
100
+ | maxIndividuals | Define the maximal number of individuals to handle. The value $-1$ indicates that there is no maximum |
101
+ | owlAnnotationLabel | Define the Annotation label used to build the Fuzzy OWL 2 RDF/XML ontology |
102
+ | milpProvider | Define the MILP provider used by the reasoner. The supported providers are listed below. |
103
+
104
+ Supported MILP Providers:
105
+ | Provider | milpProvider |
106
+ |--------------|----------------------|
107
+ | Gurobi | gurobi |
108
+ | CPLEX | pulp_cplex |
109
+ | CBC | pulp |
110
+ | GLPK | pulp_glpk |
111
+ | HiGHS | pulp_highs |
112
+ | MIP | mip |
113
+
114
+ ---
115
+
116
+ # MILP Provider Usage and Configuration
117
+
118
+ <details><summary>See configurations for each provider</summary>
119
+
120
+ ## GUROBI
121
+
122
+ - Install [gurobipy](https://pypi.org/project/gurobipy/):
123
+ ```python
124
+ pip install gurobipy==12.0.0
125
+ ```
126
+ - Download the GUROBI license from their [website](https://www.gurobi.com/solutions/licensing/).
127
+ - Add Gurobi to the PATH
128
+
129
+ ## MIP
130
+
131
+ - Install Python [MIP](https://www.python-mip.com/):
132
+ ```python
133
+ pip install mip==1.16rc0
134
+ ```
135
+
136
+ ## GLPK
137
+
138
+ - Install [GLPK](https://www.gnu.org/software/glpk/) v5.0 and [GMP](https://gmplib.org/) v6.3.0
139
+ - Install Python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
140
+ ```python
141
+ pip install pulp==3.2.1
142
+ ```
143
+ - Add GLPK to the PATH
144
+
145
+ ## CBC
146
+
147
+ - Install [CBC](https://github.com/coin-or/Cbc)
148
+ - Install Python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
149
+ ```python
150
+ pip install pulp==3.2.1
151
+ ```
152
+ - Add CBC to the PATH
153
+
154
+ ## CPLEX
155
+
156
+ - Install [CPLEX](https://www.ibm.com/it-it/products/ilog-cplex-optimization-studio) v22.11
157
+ - Install Python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
158
+ ```python
159
+ pip install pulp==3.2.1
160
+ ```
161
+ - Add CPLEX to the PATH
162
+
163
+ ## HiGHS
164
+
165
+ - Install [HiGHS](https://ergo-code.github.io/HiGHS/dev/interfaces/cpp/) v1.10.0
166
+ - Install python [pulp](https://github.com/coin-or/PuLP?tab=readme-ov-file):
167
+ ```python
168
+ pip install pulp==3.2.1
169
+ ```
170
+ - Add HiGHS to the PATH
171
+
172
+ </details>
173
+
174
+ ---
175
+
176
+ # Fuzzy Description Logic Grammatics
177
+
178
+ <details><summary>See all grammatics</summary>
179
+
180
+ ## String and Numbers
181
+ ```python
182
+ name := ["][a-zA-Z_][a-zA-Z0-9_]*["]
183
+ numbers := [+-]? [0-9]+(\.[0-9]+)
184
+ ```
185
+
186
+ ## Define the semantics of the knowledge base
187
+ ```python
188
+ logic := 'lukasiewicz' | 'zadeh' | 'classical'
189
+ define_logic := '(' 'define-fuzzy-logic' ["] logic ["] ')'
190
+ ```
191
+
192
+ ## Define truth constants
193
+ ```python
194
+ constant := '(' 'define-truth-constant' name numbers ')'
195
+ ```
196
+
197
+ - Example: **(define-truth-constant V 5.3)** defines the truth constant named $V$ with value $5.3$.
198
+
199
+ ## Define modifiers
200
+ Modifiers change the membership function of a fuzzy concept.
201
+
202
+ ```python
203
+ modifier := (
204
+ '(' 'define-modifier' name 'linear-modifier' '(' numbers ')' ')' # linear hedge with c > 0
205
+ | '(' 'define-modifier' name 'triangular-modifier' '(' numbers ',' numbers ',' numbers ')' ')' # triangular function
206
+ )
207
+ ```
208
+
209
+
210
+ ## Define concrete fuzzy concepts
211
+ ```python
212
+ concept_type := (
213
+ 'crisp' '(' numbers ',' numbers ',' numbers ',' numbers ')' # crisp interval
214
+ | 'left-shoulder' '(' numbers ',' numbers ',' numbers ',' numbers ')' # left-shoulder function
215
+ | 'right-shoulder' '(' numbers ',' numbers ',' numbers ',' numbers ')' # right-shoulder function
216
+ | 'triangular' '(' numbers ',' numbers ',' numbers ',' numbers ')' # triangular function
217
+ | 'trapezoidal' '(' numbers ',' numbers ',' numbers ',' numbers ',' numbers ')' # trapezoidal function
218
+ | 'linear' '(' numbers ',' numbers ',' numbers ',' numbers ')' # linear function
219
+ | 'modified' '(' name ',' name ')' # modified datatype
220
+ )
221
+ fuzzy_concept := '(' 'define-fuzzy-concept' name concept_type ')'
222
+ ```
223
+
224
+ - Note: the fuzzy concept **modified** applies only to modifiers and datatype restrictions. Example: **(define-fuzzy-concept CONCEPT modified(MOD, F))**, where **CONCEPT** is the name of the created concrete fuzzy concept, **MOD** is the name of an already defined modifier, and **F** is the name of an already defined datatype restriction.
225
+
226
+ ## Define fuzzy numbers
227
+ ```python
228
+ fuzzy_number_range := '(' 'define-fuzzy-number-range' numbers numbers ')' # if fuzzy numbers are used, then define the range [k1, k2]
229
+ fuzzy_number_expression := (
230
+ name
231
+ | numbers # if fuzzy number is a real number 'n', then it is considered as (n, n, n)
232
+ | '(' numbers ',' numbers ',' numbers ')'
233
+ | '(' 'f+' fuzzy_number_expression+ ')' # addition of fuzzy numbers
234
+ | '(' 'f-' fuzzy_number_expression fuzzy_number_expression ')' # subtraction of fuzzy numbers
235
+ | '(' 'f*' fuzzy_number_expression+ ')' # product of fuzzy numbers
236
+ | '(' 'f/' fuzzy_number_expression fuzzy_number_expression ')' # division of fuzzy numbers
237
+ )
238
+ fuzzy_number := '(' 'define-fuzzy-number' name fuzzy_number_expression ')'
239
+ ```
240
+
241
+ ### Definitions
242
+ |Example | | Definition|
243
+ | --- | --- | --- |
244
+ |(a, b, c) | fuzzy number | (a,b,c)|
245
+ |n | real number | (n,n,n) |
246
+ |(f+ f1 f2 $\ldots$ fn) | addition | $(\sum_{i = 0}^{n} a_i, \sum_{i = 0}^{n} b_i, \sum_{i = 0}^{n} c_i)$|
247
+ |(f- f1 f2) | subtraction | $(a_1−c_2, b_1 − b_2, c_1 − a_2)$ |
248
+ |(f* f1 f2 $\ldots$ fn) | product | $(\prod_{i = 0}^{n} a_i, \prod_{i = 0}^{n} b_i, \prod_{i = 0}^{n} c_i)$|
249
+ |(f/ f1 f2) | division | $(\frac{a_1}{c_2}, \frac{b_1}{b_2}, \frac{c_1}{a_2})$ |
250
+
251
+ ## Define Features, i.e., functional datatypes
252
+ ```python
253
+ feature := '(' 'functional' name ')' # first, define the feature
254
+ feature_range := (
255
+ '(' 'range' name '*integer*' numbers numbers ')'
256
+ | '(' 'range' name '*real*' numbers numbers ')'
257
+ | '(' 'range' name '*string*' ')'
258
+ | '(' 'range' name '*boolean*' ')'
259
+ )
260
+ ```
261
+
262
+ ### Definitions
263
+ |Rule|Meaning|
264
+ |--------------|----------------------|
265
+ |(functional F) | Define the feature F|
266
+ |(range F ```*integer*``` $k_1$ $k_2$) | The range of $F$ is an integer number in $[k_1, k_2]$|
267
+ |(range F ```*real*``` $k_1$ $k_2$) | The range of $F$ is a rational number in $[k_1, k_2]$|
268
+ |(range F ```*string*```) | The range of $F$ is a string|
269
+ |(range F ```*boolean*```) | The range of $F$ are booleans|
270
+
271
+ ## Datatype/feature restrictions
272
+ ```python
273
+ # (>= ...) = at least datatype restriction
274
+ # (<= ...) = at most datatype restriction
275
+ # (= ...) = exact datatype restriction
276
+
277
+ restriction_function := (
278
+ numbers
279
+ | name
280
+ | numbers [*]? restriction_function
281
+ | restriction_function [-] restriction_function
282
+ | (restriction_function [+])+ restriction_function
283
+ )
284
+ restriction := '(' ('>=' | '<=', '=') name (name | restriction_function | fuzzy_number) ')'
285
+ ```
286
+
287
+ ### Definitions
288
+ |Restriction|Definition|
289
+ | -- | -- |
290
+ |$(\mathrm{>=}\ F\ \text{variable})$| ${\mathrm{sup}}_{b \in {\Delta}_D} \[F^\mathcal{I} (x, b) \otimes (b \geq \text{variable})\]$|
291
+ |$(\mathrm{<=}\ F\ \text{variable})$| $\mathrm{sup}_{b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b \leq \text{variable})\]$|
292
+ |$(=\ F\ \text{variable}) $| $\mathrm{sup}_{b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b = \text{variable})\]$|
293
+ |$(\mathrm{>=}\ F\ \text{fuzzy\_number})$|$\mathrm{sup}_{b^\prime, b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b \geq b^\prime) \otimes {\text{fuzzy\_number}(b^\prime)}^\mathcal{I}\]$|
294
+ |$(\mathrm{<=}\ F\ \text{fuzzy\_number})$|$\mathrm{sup}_{b^\prime, b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b \leq b^\prime) \otimes {\text{fuzzy\_number}(b^\prime)}^\mathcal{I}\]$|
295
+ |$(=\ F\ \text{fuzzy\_number})$|$\mathrm{sup}_{b^\prime, b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b = b^\prime) \otimes {\text{fuzzy\_number}(b^\prime)}^\mathcal{I}\]$|
296
+ |$(\mathrm{>=}\ F\ \mathrm{function}(F_1, \ldots, F_n))$|$\mathrm{sup}_{b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b \geq {\mathrm{function}(F_1, \ldots, F_n)}^{\mathcal{I}})\]$|
297
+ |$(\mathrm{<=}\ F\ \mathrm{function}(F_1, \ldots, F_n))$|$\mathrm{sup}_{b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b \leq {\mathrm{function}(F_1, \ldots, F_n)}^{\mathcal{I}})\]$|
298
+ |$(=\ F\ \mathrm{function}(F_1, \ldots, F_n))$|$\mathrm{sup}_{b \in \Delta_D} \[F^\mathcal{I} (x, b) \otimes (b = {\mathrm{function}(F_1, \ldots, F_n)}^{\mathcal{I}})\]$|
299
+
300
+ - In datatype restrictions, the variable **variable** has to be declared **(free variable)** before its use in a datatype
301
+ restriction, using the **constraints** defined below;
302
+ - The value for $b$ has to be in the range $\[k_1,k_2\]$ subset or equivalent to $\[- k_{\infty}, k_{\infty}\]$ of the feature $F$, and the values for **variable**, $\mathbf{function}(F_1, \ldots, F_n)$ and the range of **fuzzy_number** have to be in $\[- k_{\infty}, k_{\infty}\]$, where $k_{\infty}$ is the maximal representable integer (see below for the table);
303
+ - In datatype restrictions, the variable **variable** may be replaced with a value, i.e., an integer, a real, a string, or a boolean constant (true, false), depending on the range of the feature $F$.
304
+
305
+ | MILP Solver | $k_{\infty}$ |
306
+ | --- | --- |
307
+ | Gurobi | $1000 \cdot ((1 \ll 31) - 1)$ |
308
+ | PULP CBC | $(1 \ll 31) - 1$ |
309
+ | MIP | $(1 \ll 31) - 1$ |
310
+ | PULP GLPK | $(1 \ll 28) - 1$ |
311
+ | PULP HiGHS | $(1 \ll 28) - 1$ |
312
+ | PULP CPLEX | $(1 \ll 28) - 1$ |
313
+
314
+ - Note: The value of $k_{\infty}$ is different for some MILP solvers for computational issues. In particular, higher values lead to the accumulation of errors, which can distort the results. The values currently given give the same results for the test files provided.
315
+
316
+ ## Constraints
317
+ ```python
318
+ operator := '>=' | '<=' | '='
319
+ term := numbers | name | numbers [*] term | name [*] term
320
+ expression := (term [+])+ term
321
+ inequation_constraint := expression operator numbers
322
+ constraints := '(' 'constraints' (
323
+ inequality_constraint
324
+ | 'binary' name # binary variable in {0, 1}
325
+ | 'free' name # continuous variable in (-inf, +inf)
326
+ ) ')'
327
+ ```
328
+
329
+ ## Show statements
330
+ ```python
331
+ statements = (
332
+ '(' 'show-concrete-fillers' name+ ')' # show value of the fillers
333
+ | '(' 'show-concrete-fillers-for' name{2, } ')' # show value of the fillers for an individual
334
+ | '(' 'show-concrete-instance-for' name{3, } ')' # show degrees of being the filler of individual instance of a concept
335
+ | '(' 'show-abstract-fillers' name+ ')' # show fillers and membership to any concept
336
+ | '(' 'show-abstract-fillers-for' name{2, } ')' # show fillers for an individuals and membership to any concept
337
+ | '(' 'show-concepts' name+ ')' # show membership of individuals to any concept
338
+ | '(' 'show-instances' name+ ')' # show value of the instances of the listed concepts
339
+ | '(' 'show-variables' name+ ')' # show value of the listed variables
340
+ | '(' 'show-language' ')' # show language of the KB, from ALC to SHIF(D)
341
+ )
342
+ ```
343
+
344
+ ### Usage
345
+ |Statement| Meaning |
346
+ | ---- | ---- |
347
+ |(show-concrete-fillers $F_1$ $\ldots$ $F_n$) | show value of the fillers of the features $F_i$|
348
+ |(show-concrete-fillers-for ind $F_1$ $\ldots$ $F_n$) | show value of the fillers of $F_i$ for the individual 'ind' |
349
+ |(show-concrete-instance-for ind $F$ $C_1$ $\ldots$ $C_n$) | show degrees of being the $F$ filler of the individual **ind** instance of $C_i$ |
350
+ |(show-abstract-fillers $R_1$ $\ldots$ $R_n$) | show fillers of $R_i$ and membership to any concept |
351
+ |(show-abstract-fillers-for ind $R_1$ $\ldots$ $R_n$) | show fillers of $R_i$ for the individual **ind** and membership to any concept |
352
+ |(show-concepts $a_1$ $\ldots$ $a_n$) | show membership of the individuals $a_i$ to any concept |
353
+ |(show-instances $C_1$ $\ldots$ $C_n$) | show value of the instances of the concepts $C_i$ |
354
+ |(show-variables $x_1$ $\ldots$ $x_n$) | show value of the variables $x_i$ |
355
+
356
+ ## Crisp declarations
357
+ ```python
358
+ crisp_concepts := '(' 'crisp-concept' name+ ')' # the listed concepts are crisp
359
+ crisp_roles := '(' 'crisp-role' name+ ')' # the listed roles are crisp
360
+ ```
361
+
362
+ ## Fuzzy relations
363
+ ```python
364
+ fuzzy_similarity := '(' 'define-fuzzy-similarity' name ')' # fuzzy similarity relation
365
+ fuzzy_equivalence := '(' 'define-fuzzy-equivalence' name ')' # fuzzy equivalence relation
366
+ ```
367
+
368
+ ## Concept expressions
369
+ ```python
370
+ concept := (
371
+ '*top*' # top concept
372
+ | '*bottom*' # bottom concept
373
+ | name # atomic concept or concrete fuzzy concept
374
+ | restriction # datatype restriction
375
+ | '(' 'and' concept concept ')' # concept conjunction
376
+ | '(' 'g-and' concept concept ')' # Goedel conjunction
377
+ | '(' 'l-and' concept concept ')' # Lukasiewicz conjunction
378
+ | '(' 'or' concept concept ')' # concept disjunction
379
+ | '(' 'g-or' concept concept ')' # Goedel disjunction
380
+ | '(' 'l-or' concept concept ')' # Lukasiewicz disjunction
381
+ | '(' 'not' concept ')' # concept negation
382
+ | '(' 'implies' concept concept ')' # concept implication
383
+ | '(' 'g-implies' concept concept ')' # Goedel implication
384
+ | '(' 'l-implies' concept concept ')' # Lukasiewicz implication
385
+ | '(' 'kd-implies' concept concept ')' # Kleene-Dienes implication
386
+ | '(' 'all' name concept ')' # universal role restriction
387
+ | '(' 'some' name concept ')' # existential role restriction
388
+ | '(' 'some' name name ')' # individual value restriction
389
+ | '(' 'ua' name concept ')' # upper approximation
390
+ | '(' 'lua' name concept ')' # loose upper approximation
391
+ | '(' 'tua' name concept ')' # tight upper approximation
392
+ | '(' 'la' name concept ')' # lower approximation
393
+ | '(' 'lla' name concept ')' # loose lower approximation
394
+ | '(' 'tla' name concept ')' # tight lower approximation
395
+ | '(' 'self' concept ')' # local reflexivity concept
396
+ | '(' name concept ')' # modifier applied to concept
397
+ | '(' fuzzy_number ')' # fuzzy number
398
+ | '(' '[' ('>=' | '<=') name ']' concept ')' # threshold concept
399
+ | '(' numbers concept ')' # weighted concept
400
+ | '(' 'w-sum' ('(' numbers concept ')')+ ')' # weighted sum concept
401
+ | '(' 'w-max' ('(' numbers concept ')')+ ')' # weighted max concept
402
+ | '(' 'w-min' ('(' numbers concept ')')+ ')' # weighted min concept
403
+ | '(' 'w-sum-zero' ('(' numbers concept ')')+ ')' # weighted sum zero concept
404
+ | '(' 'owa' numbers+ concept+ ')' # OWA aggregation operator
405
+ | '(' 'q-owa' name concept+ ')' # quantifier-guided OWA
406
+ | '(' 'choquet' numbers+ concept+ ')' # Choquet integral
407
+ | '(' 'sugeno' numbers+ concept+ ')' # Sugeno integral
408
+ | '(' 'q-sugeno' numbers+ concept+ ')' # Quasi-Sugeno integral
409
+ | '(' 'sigma-count' name concept '{' name+ '}' name ')' # Sigma-count concept
410
+ )
411
+ ```
412
+
413
+ ### Definitions
414
+ | Expression | | Definition
415
+ | ---- | --- | --- |
416
+ |```*top*``` | top concept | $\top\ =\ 1$ |
417
+ |```*bottom*``` | bottom concept | $\perp\ =\ 0$ |
418
+ | A | atomic concept $A$ | $A^\mathcal{I}(x)$ |
419
+ | CFC | concrete fuzzy concept $CFC$ (e.g., crisp, left-shoulder, and so on) | $\mathrm{CFC}^\mathcal{I}(x)$ |
420
+ | DR | datatype restriction $DR$ | $\mathrm{DR}^\mathcal{I}(x)$ |
421
+ | (and $C_1$ $C_2$) | concept conjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \otimes C_2^\mathcal{I}(x)$ |
422
+ | (g-and $C_1$ $C_2$) | Goedel conjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \otimes_G C_2^\mathcal{I}(x)$ |
423
+ | (l-and $C_1$ $C_2$) | Lukasiewicz conjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \otimes_L C_2^\mathcal{I}(x)$ |
424
+ | (or $C_1$ $C_2$) | concept disjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \oplus C_2^\mathcal{I}(x)$ |
425
+ | (g-or $C_1$ $C_2$) | Goedel disjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \oplus_G C_2^\mathcal{I}(x)$ |
426
+ | (l-or $C_1$ $C_2$) | Lukasiewicz disjunction of $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \oplus_L C_2^\mathcal{I}(x)$ |
427
+ | (not $C$) | concept $C$ negation | $\ominus_L C^\mathcal{I}(x)$ |
428
+ | (implies $C_1$ $C_2$) | concept implication between $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \Rightarrow C_2^\mathcal{I}(x)$ |
429
+ | (g-implies $C_1$ $C_2$) | Goedel implication between $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \Rightarrow_G C_2^\mathcal{I}(x)$ |
430
+ | (l-implies $C_1$ $C_2$) | Lukasiewicz implication between $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \Rightarrow_L C_2^\mathcal{I}(x)$ |
431
+ | (kd-implies $C_1$ $C_2$) | Kleene-Dienes implication between $C_1$ and $C_2$ | $C_1^\mathcal{I}(x) \Rightarrow_\mathrm{KD} C_2^\mathcal{I}(x)$ |
432
+ | (all $R$ $C$) | universal role $R$ restriction for concept $C$ | $\mathrm{inf}_{y \in \Delta^\mathcal{I}}\ \\{ R^\mathcal{I}(x, y) \Rightarrow C^\mathcal{I}(y) \\} $ |
433
+ | (some $R$ $C$) | existential role $R$ restriction for concept $C$ | $\mathrm{sup}_{y \in \Delta^\mathcal{I}}\ \\{ R^\mathcal{I}(x, y) \otimes C^\mathcal{I}(y) \\} $ |
434
+ | (some $R$ $a$) | individual value restriction for role $R$ and individual $a$ | $R^\mathcal{I}(x, a) $ |
435
+ | (ua $s$ $C$) | upper approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{sup}_{y \in \Delta^\mathcal{I}}\ \\{ s^\mathcal{I}(x, y) \otimes C^\mathcal{I}(y) \\} $ |
436
+ | (lua $s$ $C$) | loose upper approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{sup}\_{z \in X}\ \\{ s^\mathcal{I}(x, z) \otimes \mathrm{sup}\_{y \in \Delta^\mathcal{I}} s^\mathcal{I}(y, z) \otimes C^\mathcal{I}(x) \\}$ |
437
+ | (tua $s$ $C$) | tight upper approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{inf}\_{z \in X}\ \\{ s^\mathcal{I}(x, z) \Rightarrow \mathrm{sup}\_{y \in \Delta^\mathcal{I}} s^\mathcal{I}(y, z) \otimes C^\mathcal{I}(x) \\}$ |
438
+ | (la $s$ $C$) | lower approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{inf}_{y \in \Delta^\mathcal{I}}\ s^\mathcal{I}(x, y) \Rightarrow C^\mathcal{I}(y) $ |
439
+ | (lla $s$ $C$) | loose lower approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{sup}\_{z \in X}\ \\{ s^\mathcal{I}(x, z) \otimes \mathrm{inf}\_{y \in \Delta^\mathcal{I}} s^\mathcal{I}(y, z) \otimes C^\mathcal{I}(x) \\}$ |
440
+ | (tla $s$ $C$) | tight lower approximation for a fuzzy relation $s$ and individual $a$ | $\mathrm{inf}\_{z \in X}\ \\{ s^\mathcal{I}(x, z) \Rightarrow \mathrm{inf}\_{y \in \Delta^\mathcal{I}} s^\mathcal{I}(y, z) \otimes C^\mathcal{I}(x) \\}$ |
441
+ | (self C) | local reflexivity concept | $C^\mathcal{I}(x)(x, x)$ |
442
+ | (MOD C) | modifier MOD applied to concept $C$ | ${f_m}(C^\mathcal{I}(x))$, where $f_m$ is the modifier associated to MOD |
443
+ | (FN) | fuzzy number FN | $\mathrm{FM}^\mathcal{I}(x)$ |
444
+ | ([>= var ] C) | threshold concept | if $C^\mathcal{I}(x) \geq \mathrm{var}$, then $C^\mathcal{I}(x)$; otherwise $0$|
445
+ | ([<= var ] C) | threshold concept | if $C^\mathcal{I}(x) \leq \mathrm{var}$, then $C^\mathcal{I}(x)$; otherwise $0$|
446
+ | (n C) | weighted concept C with weight n | $n C^\mathcal{I}(x)$|
447
+ | (w-sum ($n_1$ $C_1$) $\ldots$ ($n_k$ $C_k$) ) | weighted sum of concepts | $\sum_{i=1}^{k} n_i C_i^\mathcal{I}(x)$ |
448
+ | (w-max ($v_1$ $C_1$) $\ldots$ ($v_k$ $C_k$) ) | weighted max of concepts | $\max_{i=1}^{k} \min \\{v_i, x_i\\}$|
449
+ | (w-min ($v_1$ $C_1$) $\ldots$ ($v_k$ $C_k$) ) | weighted min of concepts | $\min_{i=1}^{k} \max \\{1 - v_i, x_i\\}$|
450
+ | (w-sum-zero ($n_1$ $C_1$) $\ldots$ ($n_k$ $C_k$) ) | weighted min of concepts | if $C_i^\mathcal{I}(x) = 0$ for some $i \in \\{1, \ldots, k\\}$, then $0$; otherwise $\sum_{i=1}^{k} n_i C_i^\mathcal{I}(x)$|
451
+ |(owa ($w_1$, $\ldots$, $w_n$) ($C_1$, $\ldots$, $C_n$) | OWA aggregation operator | $\sum_{i=1}^n w_i y_i $ |
452
+ |(q-owa $Q$ ($C_1$, $\ldots$, $C_n$) | quantifier-guided OWA with name $Q$, where $Q$ is a right-shoulder or a linear function | $\sum_{i=1}^n w_i y_i $, where $w_i = Q(\frac{i}{n}) - Q(\frac{i - 1}{n})$|
453
+ |(choquet ($w_1$, $\ldots$, $w_n$) ($C_1$, $\ldots$, $C_n$) | Choquet integral | $y_1 w_1 + \sum_{i=2}^n (y_i - y_{i - 1}) w_i $ |
454
+ |(sugeno ($v_1$, $\ldots$, $v_n$) ($C_1$, $\ldots$, $C_n$) | Sugeno integral | $\max_{i=1}^n \min \\{y_i, mu_i\\}$ |
455
+ |(q-sugeno ($v_1$, $\ldots$, $v_n$) ($C_1$, $\ldots$, $C_n$) | Quasi-Sugeno integral | $\max_{i=1}^n y_i \otimes_L mu_i $|
456
+ |(sigma-count $R$ $C$ $\\{a_1\ \ldots\ a_k\\}$ $F_C$ | A Sigma-Count concept with role $R$ and associated to the concept $C$, the individuals $a_i$ and the fuzzy concrete concept $F_C$ | |
457
+
458
+ - $n_1, \ldots, n_k \in \[0, 1\]$, with $\sum_{i=1}^k\ n_i \leq 1$;
459
+ - $w_1, \ldots, w_n \in \[0, 1\]$, with $\sum_{i=1}^n\ w_i = 1$;
460
+ - $v_1, \ldots, v_n \in \[0, 1\]$, with $\max_{i=1}^n\ v_i = 1$;
461
+ - $y_i$ is the $i$-largest of the $C_i^\mathcal{I}(x)$;
462
+ - $ow_i$ is the weight $v_i$ of the $i$-largest of the $C_i^\mathcal{I}(x)$;
463
+ - $mu_i$ is defined as follows: $mu_1 = ow_1$, and $mu_i = ow_i \oplus mu_{i - 1}$ for $i \in \\{2, \ldots, n\\}$;
464
+ - Fuzzy numbers can only appear in existential, universal and datatype restrictions;
465
+ - In threshold concepts **var** may be replaced with $ w \in \[0, 1\] $;
466
+ - Fuzzy relations $s$ should be previously defined as fuzzy similarity relation or a fuzzy equivalence relation as **(define-fuzzy-similarity s)** or **(define-fuzzy-equivalence s)**, respectively;
467
+ - Fuzzy concrete concept $F_C$ in **sigma-count** concept has to be previously defined as **left-shoulder**, **right-shoulder** or **triangular** concept with **define-fuzzy-concept**.
468
+
469
+ ## Axioms
470
+ ```python
471
+ degree := (
472
+ numbers # a rational number
473
+ | expression # a linear expression
474
+ | name # variable or an already defined truth constant
475
+ )
476
+ axioms := (
477
+ '(' 'instance' name concept degree? ')' # concept assertion
478
+ | '(' 'related' name name name degree? ')' # role assertion
479
+ | '(' 'implies' concept concept numbers? ')' # General Concept Inclusion (GCI) with degree 'numbers'
480
+ | '(' 'g-implies' concept concept numbers? ')' # Goedel GCI with degree 'numbers'
481
+ | '(' 'kd-implies' concept concept numbers? ')' # Kleene-Dienes GCI with degree 'numbers'
482
+ | '(' 'l-implies' concept concept numbers? ')' # Lukasiewicz GCI with degree 'numbers'
483
+ | '(' 'z-implies' concept concept numbers? ')' # Zadeh’s set GCI with degree 'numbers'
484
+ | '(' 'define-concept' name concept ')' # concept definition
485
+ | '(' 'define-primitive-concept' name concept ')' # concept subsumption
486
+ | '(' 'equivalent-concepts' concept concept ')' # equivalent concept definition
487
+ | '(' 'disjoint' concept+ ')' # concept disjointness
488
+ | '(' 'disjoint-union' concept+ ')' # disjoint union of concepts
489
+ | '(' 'range' name concept ')' # range restriction of a concept
490
+ | '(' 'domain' name concept ')' # domain restriction of a concept
491
+ | '(' 'functional' name ')' # functional role
492
+ | '(' 'inverse-functional' name ')' # inverse functional role
493
+ | '(' 'reflexive' name ')' # reflexive role
494
+ | '(' 'symmetric' name ')' # symmetric role
495
+ | '(' 'transitive' name ')' # transitive role
496
+ | '(' 'implies-role' name name numbers? ')' # Role Implication Axiom (RIA)
497
+ | '(' 'inverse' name name ')' # inverse role
498
+ )
499
+ ```
500
+
501
+ ### Definitions
502
+ | Axiom | Definition |
503
+ | ---- | ---- |
504
+ | (instance a C d) | $C^\mathcal{I}(a^\mathcal{I}) \geq d $ |
505
+ | (related a b R d) | $R^\mathcal{I}(a^\mathcal{I}, b^\mathcal{I}) \geq d $ |
506
+ | (implies $C_1$ $C_2$ d) | $\mathrm{inf}\_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) \Rightarrow C_2^\mathcal{I}(x) \geq d$ |
507
+ | (g-implies $C_1$ $C_2$ d) | $\mathrm{inf}\_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) \Rightarrow_G C_2^\mathcal{I}(x) \geq d$ |
508
+ | (kd-implies $C_1$ $C_2$ d) | $\mathrm{inf}\_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) \Rightarrow_{\mathrm{KD}} C_2^\mathcal{I}(x) \geq d$ |
509
+ | (l-implies $C_1$ $C_2$ d) | $\mathrm{inf}\_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) \Rightarrow_{L} C_2^\mathcal{I}(x) \geq d $ |
510
+ | (z-implies $C_1$ $C_2$ d) | $\mathrm{inf}\_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) \Rightarrow_Z C_2^\mathcal{I}(x) \geq d$ |
511
+ | (define-concept A C) | $\forall_{x \in \Delta^\mathcal{I}}\ A^\mathcal{I}(x) = C^\mathcal{I}(x) $ |
512
+ | (define-primitive-concept A C) | $\mathrm{inf}_{x \in \Delta^\mathcal{I}}\ A^\mathcal{I}(x) \leq C^\mathcal{I}(x) $ |
513
+ | (equivalent-concepts $C_1$ $C_2$) | $\forall_{x \in \Delta^\mathcal{I}}\ C_1^\mathcal{I}(x) = C_2^\mathcal{I}(x) $ |
514
+ | (disjoint $C_1$ $\ldots$ $C_k$) | (implies (g-and $C_i$ $C_j$) ```*bottom*```), i.e., $\forall_{i, j \in \\{1, \ldots, k\\}, i < j}\ (C_i^\mathcal{I}(x) \otimes_G C_j^\mathcal{I}(x)) \Rightarrow \perp$ |
515
+ | (disjoint-union $C_1$ $\ldots$ $C_k$) | $C_1 = \bigoplus_{i=2}^k C_i$ and $\forall_{i, j \in \\{1, \ldots, k\\}, i < j}\ (C_i^\mathcal{I}(x) \otimes_G C_j^\mathcal{I}(x)) \Rightarrow \perp$ |
516
+ | (range R $C$) | (implies ```*top*``` (all R C)), i.e., $\top \Rightarrow \mathrm{inf}\_{y \in \Delta^\mathcal{I}}\ \\{ R^\mathcal{I}(x, y) \Rightarrow C^\mathcal{I}(y) \\}$ |
517
+ | (domain R $C$) | (implies (some R ```*top*```) C), i.e., $\mathrm{sup}\_{y \in \Delta^\mathcal{I}}\ \\{ R^\mathcal{I}(x, y) \otimes \top \\} \Rightarrow C^\mathcal{I}(x)$ |
518
+ | (functional R) | $R^\mathcal{I}(a, b) = R^\mathcal{I}(a, c) \rightarrow b = c$ |
519
+ | (inverse-functional R) | $R^\mathcal{I}(b, a) = R^\mathcal{I}(c, a) \rightarrow b = c$ |
520
+ | (reflexive R) | $\forall_{a \in \Delta^\mathcal{I}}\ R^\mathcal{I}(a, a) = 1$ |
521
+ | (symmetric R) | $\forall_{a, b \in \Delta^\mathcal{I}}\ R^\mathcal{I}(a, b) = R^\mathcal{I}(b, a)$ |
522
+ | (transitive R) | $\forall_{a, b \in \Delta^\mathcal{I}}\ R^\mathcal{I}(a, b) \geq \mathrm{sup}_{c \in \Delta^\mathcal{I}} R^\mathcal{I}(a, c) \otimes R^\mathcal{I}(c, b)$ |
523
+ | (implies-role $R_1$ $R_2$ d) | $\mathrm{inf}_{x, y \in \Delta^\mathcal{I}}\ R_1^\mathcal{I}(x, y) \Rightarrow_L R_2^\mathcal{I}(x, y) \geq d$ |
524
+ | (inverse $R_1$ $R_2$) | $R_1^\mathcal{I} \equiv {(R_2^\mathcal{I})}^{-1}$ |
525
+
526
+ - Transitive roles cannot be functional.
527
+ - In Zadeh logic, $\Rightarrow$ is Zadeh’s set inclusion.
528
+
529
+ ## Queries
530
+ ```python
531
+ queries := (
532
+ '(' 'sat?' ')' # is Knowledge base consistent?
533
+ | '(' 'max-instance?' name concpet ')'
534
+ | '(' 'min-instance?' name concept ')'
535
+ | '(' 'all-instances?' concept ')'
536
+ | '(' 'max-related?' name name name ')'
537
+ | '(' 'min-related?' name name name')'
538
+ | '(' 'max-subs?' concept concept ')'
539
+ | '(' 'min-subs?' concept concept ')'
540
+ | '(' 'max-g-subs?' concept concept ')'
541
+ | '(' 'min-g-subs?' concept concept ')'
542
+ | '(' 'max-l-subs?' concept concept ')'
543
+ | '(' 'min-l-subs?' concept concept ')'
544
+ | '(' 'max-kd-subs?' concept concept ')'
545
+ | '(' 'min-kd-subs?' concept concept ')'
546
+ | '(' 'max-sat?' concept name? ')'
547
+ | '(' 'min-sat?' concept name? ')'
548
+ | '(' 'max-var?' name ')'
549
+ | '(' 'min-var?' name ')'
550
+ | '(' 'defuzzify-lom?' concept name name ')' # Defuzzify using the largest of the maxima
551
+ | '(' 'defuzzify-mom?' concept name name ')' # Defuzzify using the middle of the maxima
552
+ | '(' 'defuzzify-som?' concept name name ')' # Defuzzify using the smallest of the maxima
553
+ | '(' 'bnp?' name ')' # Computes the Best Non-Fuzzy Performance (BNP) of a fuzzy number
554
+ )
555
+ ```
556
+
557
+ ### Definitions
558
+ | Query | Definition |
559
+ | --- | --- |
560
+ | (sat?) | Check if $\mathcal{K}$ is consistent |
561
+ | (max-instance? a C) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(instance a C n)}\\}$ |
562
+ | (min-instance? a C)| $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(instance a C n)}\\}$ |
563
+ | (all-instances? C) | (min-instance? a C) for every individual of $\mathcal{K}$ |
564
+ | (max-related? a b R) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(related a b R n)} \\}$ |
565
+ | (min-related? a b R) | $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(related a b R n)} \\}$ |
566
+ | (max-subs? C D) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(implies D C n)} \\}$|
567
+ | (min-subs? C D) | $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(implies D C n)} \\}$|
568
+ | (max-g-subs? C D) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(g-implies D C n)} \\}$ |
569
+ | (min-g-subs? C D) | $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(g-implies D C n)} \\}$ |
570
+ | (max-l-subs? C D) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(l-implies D C n)} \\}$ |
571
+ | (min-l-subs? C D) | $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(l-implies D C n)} \\}$|
572
+ | (max-kd-subs? C D) | $\mathrm{sup}\ \\{n \mid \mathcal{K} \models \text{(kd-implies D C n)} \\}$ |
573
+ | (min-kd-subs? C D) | $\mathrm{inf}\ \\{n \mid \mathcal{K} \models \text{(kd-implies D C n)} \\}$ |
574
+ | (max-sat? C a) | $\mathrm{sup}\_{\mathcal{I}}\ \mathrm{sup}\_{a \in \Delta^\mathcal{I}}\ C^\mathcal{I}(a)$|
575
+ | (min-sat? C a) | $\mathrm{inf}\_{\mathcal{I}}\ \mathrm{inf}\_{a \in \Delta^\mathcal{I}}\ C^\mathcal{I}(a)$|
576
+ | (max-var? var) | $\mathrm{sup}\ \\{\text{var} \mid \mathcal{K} \text{ is consistent}\\}$|
577
+ | (min-var? var) | $\mathrm{inf}\ \\{\text{var} \mid \mathcal{K} \text{ is consistent}\\}$|
578
+ | (defuzzify-lom? C a F) | Defuzzify the value of F using the largest of the maxima |
579
+ | (defuzzify-mom? C a F) | Defuzzify the value of F using the middle of the maxima |
580
+ | (defuzzify-som? C a F) | Defuzzify the value of F using the smallest of the maxima |
581
+ | (bnp? f) | Computes the Best Non-Fuzzy Performance (BNP) of a fuzzy number $f$ |
582
+
583
+ - In defuzzify queries, the concept $C$ represents several Mamdani/Rules IF-THEN fuzzy rules expressing how to obtain the value of the concrete feature F.
584
+
585
+ </details>
586
+
587
+ ---
588
+
589
+ # Usage - Reasoning
590
+
591
+ ## Knowledge base in example.fdl
592
+ ```python
593
+ (define-fuzzy-logic lukasiewicz)
594
+ (define-modifier very linear-modifier(0.8))
595
+ (define-fuzzy-concept eq243 crisp(0, 400, 243, 243))
596
+ (define-fuzzy-concept geq300 crisp(0, 400, 300, 400))
597
+ (define-fuzzy-concept High right-shoulder(0, 400, 180, 250))
598
+ (define-concept SportCar (and Car (some speed (very High))))
599
+ (instance ferrari (and Car (some speed geq300)) 1)
600
+ (instance audi (and Car (some speed eq243)) 1)
601
+
602
+ (min-instance? audi SportCar)
603
+ ```
604
+
605
+ ## Python code
606
+
607
+ ```python
608
+ from fuzzy_dl_owl2 import DLParser
609
+
610
+ DLParser.main("./example.fdl") # "Is audi instance of SportCar ? >= 0.92"
611
+ ```
612
+
613
+ ---
614
+
615
+ # Usage - Fuzzy OWL 2
616
+
617
+ ## From *.fdl to *.owl
618
+
619
+ ```python
620
+ from fuzzy_dl_owl2 import FuzzydlToOwl2
621
+
622
+ fdl = FuzzydlToOwl2("./example.fdl", "example.owl")
623
+ fdl.run() # save example.owl in the subdirectory "./results"
624
+ ```
625
+
626
+ ## From *.owl to *.fdl
627
+
628
+ ```python
629
+ from fuzzy_dl_owl2 import FuzzyOwl2ToFuzzyDL
630
+
631
+ fdl = FuzzyOwl2ToFuzzyDL("./results/example.owl", "example.fdl")
632
+ fdl.translate_owl2ontology() # save example.fdl in the subdirectory "./results"
633
+ ```
634
+
635
+ ---
636
+
637
+ # Project Structure
638
+
639
+ <details><summary>See project structure</summary>
640
+
641
+ ```text
642
+ fuzzy_dl_owl2
643
+ ├── __init__.py
644
+ ├── fuzzydl
645
+ │ ├── __init__.py
646
+ │ ├── assertion
647
+ │ │ ├── __init__.py
648
+ │ │ ├── assertion.py
649
+ │ │ └── atomic_assertion.py
650
+ │ ├── classification_node.py
651
+ │ ├── concept
652
+ │ │ ├── __init__.py
653
+ │ │ ├── all_some_concept.py
654
+ │ │ ├── approximation_concept.py
655
+ │ │ ├── atomic_concept.py
656
+ │ │ ├── choquet_integral.py
657
+ │ │ ├── concept.py
658
+ │ │ ├── concrete
659
+ │ │ │ ├── __init__.py
660
+ │ │ │ ├── __pycache__
661
+ │ │ │ ├── crisp_concrete_concept.py
662
+ │ │ │ ├── fuzzy_concrete_concept.py
663
+ │ │ │ ├── fuzzy_number
664
+ │ │ │ │ ├── __init__.py
665
+ │ │ │ │ └── triangular_fuzzy_number.py
666
+ │ │ │ ├── left_concrete_concept.py
667
+ │ │ │ ├── linear_concrete_concept.py
668
+ │ │ │ ├── modified_concrete_concept.py
669
+ │ │ │ ├── right_concrete_concept.py
670
+ │ │ │ ├── trapezoidal_concrete_concept.py
671
+ │ │ │ └── triangular_concrete_concept.py
672
+ │ │ ├── ext_threshold_concept.py
673
+ │ │ ├── has_value_concept.py
674
+ │ │ ├── implies_concept.py
675
+ │ │ ├── interface
676
+ │ │ │ ├── __init__.py
677
+ │ │ │ ├── __pycache__
678
+ │ │ │ ├── has_concept_interface.py
679
+ │ │ │ ├── has_concepts_interface.py
680
+ │ │ │ ├── has_role_concept_interface.py
681
+ │ │ │ ├── has_role_interface.py
682
+ │ │ │ ├── has_value_interface.py
683
+ │ │ │ └── has_weighted_concepts_interface.py
684
+ │ │ ├── modified
685
+ │ │ │ ├── __init__.py
686
+ │ │ │ ├── linearly_modified_concept.py
687
+ │ │ │ ├── modified_concept.py
688
+ │ │ │ └── triangularly_modified_concept.py
689
+ │ │ ├── negated_nominal.py
690
+ │ │ ├── operator_concept.py
691
+ │ │ ├── owa_concept.py
692
+ │ │ ├── qowa_concept.py
693
+ │ │ ├── quasi_sugeno_integral.py
694
+ │ │ ├── self_concept.py
695
+ │ │ ├── sigma_concept.py
696
+ │ │ ├── sigma_count.py
697
+ │ │ ├── string_concept.py
698
+ │ │ ├── sugeno_integral.py
699
+ │ │ ├── threshold_concept.py
700
+ │ │ ├── truth_concept.py
701
+ │ │ ├── value_concept.py
702
+ │ │ ├── weighted_concept.py
703
+ │ │ ├── weighted_max_concept.py
704
+ │ │ ├── weighted_min_concept.py
705
+ │ │ ├── weighted_sum_concept.py
706
+ │ │ └── weighted_sum_zero_concept.py
707
+ │ ├── concept_equivalence.py
708
+ │ ├── concrete_feature.py
709
+ │ ├── degree
710
+ │ │ ├── __init__.py
711
+ │ │ ├── degree_expression.py
712
+ │ │ ├── degree_numeric.py
713
+ │ │ ├── degree_variable.py
714
+ │ │ └── degree.py
715
+ │ ├── domain_axiom.py
716
+ │ ├── exception
717
+ │ │ ├── __init__.py
718
+ │ │ ├── fuzzy_ontology_exception.py
719
+ │ │ └── inconsistent_ontology_exception.py
720
+ │ ├── feature_function.py
721
+ │ ├── fuzzydl_to_owl2.py
722
+ │ ├── general_concept_inclusion.py
723
+ │ ├── individual
724
+ │ │ ├── __init__.py
725
+ │ │ ├── created_individual.py
726
+ │ │ ├── individual.py
727
+ │ │ └── representative_individual.py
728
+ │ ├── knowledge_base.py
729
+ │ ├── label.py
730
+ │ ├── milp
731
+ │ │ ├── __init__.py
732
+ │ │ ├── expression.py
733
+ │ │ ├── inequation.py
734
+ │ │ ├── milp_helper.py
735
+ │ │ ├── show_variables_helper.py
736
+ │ │ ├── solution.py
737
+ │ │ ├── term.py
738
+ │ │ └── variable.py
739
+ │ ├── modifier
740
+ │ │ ├── __init__.py
741
+ │ │ ├── linear_modifier.py
742
+ │ │ ├── modifier.py
743
+ │ │ └── triangular_modifier.py
744
+ │ ├── parser
745
+ │ │ ├── __init__.py
746
+ │ │ └── dl_parser.py
747
+ │ ├── primitive_concept_definition.py
748
+ │ ├── query
749
+ │ │ ├── __init__.py
750
+ │ │ ├── all_instances_query.py
751
+ │ │ ├── bnp_query.py
752
+ │ │ ├── classification_query.py
753
+ │ │ ├── defuzzify
754
+ │ │ │ ├── __init__.py
755
+ │ │ │ ├── defuzzify_query.py
756
+ │ │ │ ├── lom_defuzzify_query.py
757
+ │ │ │ ├── mom_defuzzify_query.py
758
+ │ │ │ └── som_defuzzify_query.py
759
+ │ │ ├── instance_query.py
760
+ │ │ ├── kb_satisfiable_query.py
761
+ │ │ ├── max
762
+ │ │ │ ├── __init__.py
763
+ │ │ │ ├── max_instance_query.py
764
+ │ │ │ ├── max_query.py
765
+ │ │ │ ├── max_related_query.py
766
+ │ │ │ ├── max_satisfiable_query.py
767
+ │ │ │ └── max_subsumes_query.py
768
+ │ │ ├── min
769
+ │ │ │ ├── __init__.py
770
+ │ │ │ ├── min_instance_query.py
771
+ │ │ │ ├── min_query.py
772
+ │ │ │ ├── min_related_query.py
773
+ │ │ │ ├── min_satisfiable_query.py
774
+ │ │ │ └── min_subsumes_query.py
775
+ │ │ ├── query.py
776
+ │ │ ├── related_query.py
777
+ │ │ ├── satisfiable_query.py
778
+ │ │ └── subsumption_query.py
779
+ │ ├── range_axiom.py
780
+ │ ├── relation.py
781
+ │ ├── restriction
782
+ │ │ ├── __init__.py
783
+ │ │ ├── has_value_restriction.py
784
+ │ │ └── restriction.py
785
+ │ ├── role_parent_with_degree.py
786
+ │ └── util
787
+ │ ├── __init__.py
788
+ │ ├── config_reader.py
789
+ │ ├── constants.py
790
+ │ ├── util.py
791
+ │ └── utils.py
792
+ └── fuzzyowl2
793
+ ├── __init__.py
794
+ ├── fuzzyowl2_to_fuzzydl.py
795
+ ├── fuzzyowl2.py
796
+ ├── owl_types
797
+ │ ├── __init__.py
798
+ │ ├── choquet_concept.py
799
+ │ ├── concept_definition.py
800
+ │ ├── fuzzy_datatype.py
801
+ │ ├── fuzzy_modifier.py
802
+ │ ├── fuzzy_nominal_concept.py
803
+ │ ├── fuzzy_property.py
804
+ │ ├── left_shoulder_function.py
805
+ │ ├── linear_function.py
806
+ │ ├── linear_modifier.py
807
+ │ ├── modified_concept.py
808
+ │ ├── modified_function.py
809
+ │ ├── modified_property.py
810
+ │ ├── owa_concept.py
811
+ │ ├── property_definition.py
812
+ │ ├── qowa_concept.py
813
+ │ ├── quasi_sugeno_concept.py
814
+ │ ├── right_shoulder_function.py
815
+ │ ├── sugeno_concept.py
816
+ │ ├── trapezoidal_function.py
817
+ │ ├── triangular_function.py
818
+ │ ├── triangular_modifer.py
819
+ │ ├── weighted_concept.py
820
+ │ ├── weighted_max_concept.py
821
+ │ ├── weighted_min_concept.py
822
+ │ ├── weighted_sum_concept.py
823
+ │ └── weighted_sum_zero_concept.py
824
+ ├── parser
825
+ │ ├── __init__.py
826
+ │ ├── owl2_parser.py
827
+ │ └── owl2_xml_parser.py
828
+ └── util
829
+ ├── __init__.py
830
+ ├── constants.py
831
+ └── fuzzy_xml.py
832
+ ```
833
+
834
+ </details>
835
+
836
+ ---
837
+
838
+ # Test
839
+
840
+ The directory `test` contains the `unittest` files. In particular, the file `test_suite.py` contains all the test suite.
841
+ The directory `examples/TestSuite` contains all the knowledge bases used for the tests.
842
+
843
+ ---
844
+
845
+ # License
846
+
847
+ This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International.
848
+