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