text2model 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. text2model/__init__.py +1 -0
  2. text2model/grammar.mzn +277 -0
  3. text2model/knowledge_graphs/CSPLib_12.ttl +41 -0
  4. text2model/knowledge_graphs/CSPLib_14.ttl +51 -0
  5. text2model/knowledge_graphs/CSPLib_2.ttl +59 -0
  6. text2model/knowledge_graphs/CSPLib_22.ttl +62 -0
  7. text2model/knowledge_graphs/CSPLib_28.ttl +28 -0
  8. text2model/knowledge_graphs/CSPLib_30.ttl +72 -0
  9. text2model/knowledge_graphs/CSPLib_34.ttl +52 -0
  10. text2model/knowledge_graphs/CSPLib_39.ttl +51 -0
  11. text2model/knowledge_graphs/CSPLib_54.ttl +50 -0
  12. text2model/knowledge_graphs/CSPLib_6.ttl +36 -0
  13. text2model/knowledge_graphs/CSPLib_8.ttl +53 -0
  14. text2model/knowledge_graphs/LPWP_128.ttl +79 -0
  15. text2model/knowledge_graphs/LPWP_232.ttl +95 -0
  16. text2model/knowledge_graphs/LPWP_53.ttl +58 -0
  17. text2model/knowledge_graphs/LPWP_66.ttl +52 -0
  18. text2model/knowledge_graphs/LPWP_85.ttl +95 -0
  19. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_1.ttl +34 -0
  20. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_18.ttl +59 -0
  21. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_2.ttl +43 -0
  22. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_28.ttl +42 -0
  23. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_31.ttl +44 -0
  24. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_4.ttl +48 -0
  25. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_5.ttl +40 -0
  26. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_6.ttl +61 -0
  27. text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_8.ttl +54 -0
  28. text2model/knowledge_graphs/combinatorial_problem_1.ttl +48 -0
  29. text2model/knowledge_graphs/combinatorial_problem_31.ttl +43 -0
  30. text2model/knowledge_graphs/combinatorial_problem_32.ttl +39 -0
  31. text2model/knowledge_graphs/combinatorial_problem_7.ttl +52 -0
  32. text2model/knowledge_graphs/complexor_AircraftAssignment.ttl +73 -0
  33. text2model/knowledge_graphs/complexor_AircraftLanding.ttl +53 -0
  34. text2model/knowledge_graphs/complexor_CFLP.ttl +43 -0
  35. text2model/knowledge_graphs/complexor_CapacitatedWarehouseLocation.ttl +59 -0
  36. text2model/knowledge_graphs/complexor_CarSelection.ttl +30 -0
  37. text2model/knowledge_graphs/complexor_TSP.ttl +52 -0
  38. text2model/knowledge_graphs/complexor_VRPTW.ttl +67 -0
  39. text2model/knowledge_graphs/nlp4lp_1.ttl +56 -0
  40. text2model/knowledge_graphs/nlp4lp_10.ttl +46 -0
  41. text2model/knowledge_graphs/nlp4lp_11.ttl +57 -0
  42. text2model/knowledge_graphs/nlp4lp_12.ttl +48 -0
  43. text2model/knowledge_graphs/nlp4lp_13.ttl +48 -0
  44. text2model/knowledge_graphs/nlp4lp_14.ttl +82 -0
  45. text2model/knowledge_graphs/nlp4lp_15.ttl +60 -0
  46. text2model/knowledge_graphs/nlp4lp_16.ttl +64 -0
  47. text2model/knowledge_graphs/nlp4lp_17.ttl +72 -0
  48. text2model/knowledge_graphs/nlp4lp_18.ttl +64 -0
  49. text2model/knowledge_graphs/nlp4lp_19.ttl +98 -0
  50. text2model/knowledge_graphs/nlp4lp_2.ttl +103 -0
  51. text2model/knowledge_graphs/nlp4lp_20.ttl +129 -0
  52. text2model/knowledge_graphs/nlp4lp_21.ttl +65 -0
  53. text2model/knowledge_graphs/nlp4lp_22.ttl +72 -0
  54. text2model/knowledge_graphs/nlp4lp_23.ttl +63 -0
  55. text2model/knowledge_graphs/nlp4lp_24.ttl +99 -0
  56. text2model/knowledge_graphs/nlp4lp_25.ttl +77 -0
  57. text2model/knowledge_graphs/nlp4lp_27.ttl +75 -0
  58. text2model/knowledge_graphs/nlp4lp_28.ttl +50 -0
  59. text2model/knowledge_graphs/nlp4lp_29.ttl +63 -0
  60. text2model/knowledge_graphs/nlp4lp_3.ttl +49 -0
  61. text2model/knowledge_graphs/nlp4lp_30.ttl +49 -0
  62. text2model/knowledge_graphs/nlp4lp_31.ttl +35 -0
  63. text2model/knowledge_graphs/nlp4lp_32.ttl +33 -0
  64. text2model/knowledge_graphs/nlp4lp_33.ttl +49 -0
  65. text2model/knowledge_graphs/nlp4lp_34.ttl +67 -0
  66. text2model/knowledge_graphs/nlp4lp_35.ttl +75 -0
  67. text2model/knowledge_graphs/nlp4lp_36.ttl +56 -0
  68. text2model/knowledge_graphs/nlp4lp_37.ttl +52 -0
  69. text2model/knowledge_graphs/nlp4lp_38.ttl +55 -0
  70. text2model/knowledge_graphs/nlp4lp_39.ttl +58 -0
  71. text2model/knowledge_graphs/nlp4lp_4.ttl +64 -0
  72. text2model/knowledge_graphs/nlp4lp_40.ttl +49 -0
  73. text2model/knowledge_graphs/nlp4lp_41.ttl +62 -0
  74. text2model/knowledge_graphs/nlp4lp_42.ttl +49 -0
  75. text2model/knowledge_graphs/nlp4lp_43.ttl +98 -0
  76. text2model/knowledge_graphs/nlp4lp_44.ttl +41 -0
  77. text2model/knowledge_graphs/nlp4lp_45.ttl +56 -0
  78. text2model/knowledge_graphs/nlp4lp_46.ttl +35 -0
  79. text2model/knowledge_graphs/nlp4lp_47.ttl +68 -0
  80. text2model/knowledge_graphs/nlp4lp_48.ttl +74 -0
  81. text2model/knowledge_graphs/nlp4lp_49.ttl +66 -0
  82. text2model/knowledge_graphs/nlp4lp_5.ttl +69 -0
  83. text2model/knowledge_graphs/nlp4lp_50.ttl +51 -0
  84. text2model/knowledge_graphs/nlp4lp_51.ttl +53 -0
  85. text2model/knowledge_graphs/nlp4lp_52.ttl +51 -0
  86. text2model/knowledge_graphs/nlp4lp_53.ttl +55 -0
  87. text2model/knowledge_graphs/nlp4lp_54.ttl +74 -0
  88. text2model/knowledge_graphs/nlp4lp_55.ttl +50 -0
  89. text2model/knowledge_graphs/nlp4lp_56.ttl +67 -0
  90. text2model/knowledge_graphs/nlp4lp_57.ttl +59 -0
  91. text2model/knowledge_graphs/nlp4lp_58.ttl +65 -0
  92. text2model/knowledge_graphs/nlp4lp_6.ttl +63 -0
  93. text2model/knowledge_graphs/nlp4lp_60.ttl +36 -0
  94. text2model/knowledge_graphs/nlp4lp_61.ttl +83 -0
  95. text2model/knowledge_graphs/nlp4lp_62.ttl +44 -0
  96. text2model/knowledge_graphs/nlp4lp_63.ttl +49 -0
  97. text2model/knowledge_graphs/nlp4lp_64.ttl +41 -0
  98. text2model/knowledge_graphs/nlp4lp_65.ttl +78 -0
  99. text2model/knowledge_graphs/nlp4lp_66.ttl +51 -0
  100. text2model/knowledge_graphs/nlp4lp_67.ttl +40 -0
  101. text2model/knowledge_graphs/nlp4lp_7.ttl +53 -0
  102. text2model/knowledge_graphs/nlp4lp_8.ttl +51 -0
  103. text2model/knowledge_graphs/nlp4lp_9.ttl +58 -0
  104. text2model/knowledge_graphs/non_linear_problem_10.ttl +57 -0
  105. text2model/knowledge_graphs/non_linear_problem_15.ttl +55 -0
  106. text2model/knowledge_graphs/non_linear_problem_23.ttl +42 -0
  107. text2model/knowledge_graphs/non_linear_problem_9.ttl +61 -0
  108. text2model/knowledge_graphs/puzzles_problem_1.ttl +64 -0
  109. text2model/knowledge_graphs/puzzles_problem_11.ttl +65 -0
  110. text2model/knowledge_graphs/puzzles_problem_12.ttl +79 -0
  111. text2model/knowledge_graphs/puzzles_problem_13.ttl +50 -0
  112. text2model/knowledge_graphs/puzzles_problem_31.ttl +62 -0
  113. text2model/main.py +771 -0
  114. text2model/prompts/assembler_prompt.txt +104 -0
  115. text2model/prompts/code_stitching_prompt.txt +49 -0
  116. text2model/prompts/code_validation_prompt.txt +36 -0
  117. text2model/prompts/constraint_generation_prompt.txt +35 -0
  118. text2model/prompts/cot_prompt.txt +45 -0
  119. text2model/prompts/global_constraint_prompts/all_different_prompt.txt +67 -0
  120. text2model/prompts/global_constraint_prompts/count_prompt.txt +75 -0
  121. text2model/prompts/global_constraint_prompts/cumulative_prompt.txt +88 -0
  122. text2model/prompts/global_constraint_prompts/global_cardinality_prompt.txt +76 -0
  123. text2model/prompts/global_constraint_prompts/increasing_prompt.txt +81 -0
  124. text2model/prompts/global_constraint_prompts/lex_less_prompt.txt +68 -0
  125. text2model/prompts/grammar_validation_prompt.txt +18 -0
  126. text2model/prompts/kg_code_generation_prompt.txt +20 -0
  127. text2model/prompts/kg_generation_prompt.txt +40 -0
  128. text2model/prompts/objective_generation_prompt.txt +34 -0
  129. text2model/prompts/parameter_and_variable_generation_prompt.txt +35 -0
  130. text2model/utils.py +350 -0
  131. text2model-0.1.0.dist-info/METADATA +221 -0
  132. text2model-0.1.0.dist-info/RECORD +135 -0
  133. text2model-0.1.0.dist-info/WHEEL +5 -0
  134. text2model-0.1.0.dist-info/entry_points.txt +2 -0
  135. text2model-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,63 @@
1
+ @prefix : <http://www.semanticweb.org/ontologies/2021/4/OptimizationProblem#> .
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+
5
+ :Requirement rdf:type owl:DatatypeProperty ;
6
+ rdfs:domain :Manpower ;
7
+ rdfs:range xsd:integer .
8
+
9
+ :K rdf:type owl:DatatypeProperty ;
10
+ rdfs:domain :Resource ;
11
+ rdfs:range xsd:integer .
12
+
13
+ :I rdf:type owl:DatatypeProperty ;
14
+ rdfs:domain :Resource ;
15
+ rdfs:range xsd:integer .
16
+
17
+ :Strength rdf:type owl:DatatypeProperty ;
18
+ rdfs:domain :Resource ;
19
+ rdfs:range xsd:integer .
20
+
21
+ :LessOneWaste rdf:type owl:DatatypeProperty ;
22
+ rdfs:domain :Resource ;
23
+ rdfs:range xsd:float .
24
+
25
+ :MoreOneWaste rdf:type owl:DatatypeProperty ;
26
+ rdfs:domain :Resource ;
27
+ rdfs:range xsd:float .
28
+
29
+ :Recruit rdf:type owl:DatatypeProperty ;
30
+ rdfs:domain :Resource ;
31
+ rdfs:range xsd:integer .
32
+
33
+ :CostRedundancy rdf:type owl:DatatypeProperty ;
34
+ rdfs:domain :Resource ;
35
+ rdfs:range xsd:integer .
36
+
37
+ :NumOverman rdf:type owl:DatatypeProperty ;
38
+ rdfs:domain :Company ;
39
+ rdfs:range xsd:integer .
40
+
41
+ :CostOverman rdf:type owl:DatatypeProperty ;
42
+ rdfs:domain :Resource ;
43
+ rdfs:range xsd:integer .
44
+
45
+ :NumShortwork rdf:type owl:DatatypeProperty ;
46
+ rdfs:domain :Company ;
47
+ rdfs:range xsd:integer .
48
+
49
+ :CostShort rdf:type owl:DatatypeProperty ;
50
+ rdfs:domain :Resource ;
51
+ rdfs:range xsd:integer .
52
+
53
+ :Manpower rdf:type owl:Class .
54
+
55
+ :Resource rdf:type owl:Class .
56
+
57
+ :Company rdf:type owl:Class .
58
+
59
+ :Constraint rdf:type owl:Class .
60
+
61
+ :Objective rdf:type owl:Class .
62
+
63
+ :Variable rdf:type owl:Class .
@@ -0,0 +1,99 @@
1
+ @prefix : <http://www.semanticweb.org/ontologies/2021/4/untitled-ontology-4#> .
2
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
5
+
6
+ :Requirement a owl:Class ;
7
+ rdfs:label "Requirement" ;
8
+ rdfs:comment "The estimated manpower requirements of unskilled workers, semi-skilled workers, and skilled workers" .
9
+
10
+ :K a owl:Class ;
11
+ rdfs:label "Number of requirements categories" .
12
+
13
+ :I a owl:Class ;
14
+ rdfs:label "Number of different requirements" .
15
+
16
+ :Strength a owl:Class ;
17
+ rdfs:label "Strength of each requirement category" .
18
+
19
+ :LessOneWaste a owl:Class ;
20
+ rdfs:label "Cost reduction per unit less waste in each category" .
21
+
22
+ :MoreOneWaste a owl:Class ;
23
+ rdfs:label "Additional cost per unit more waste in each category" .
24
+
25
+ :Recruit a owl:Class ;
26
+ rdfs:label "Number of recruits in each category" .
27
+
28
+ :CostRedundancy a owl:Class ;
29
+ rdfs:label "Cost of redundancy per recruit in each category" .
30
+
31
+ :NumOverman a owl:Class ;
32
+ rdfs:label "Number of over-managed categories allowed" .
33
+
34
+ :CostOverman a owl:Class ;
35
+ rdfs:label "Cost of over-managing in each category" .
36
+
37
+ :NumShortwork a owl:Class ;
38
+ rdfs:label "Number of short-work categories allowed" .
39
+
40
+ :CostShort a owl:Class ;
41
+ rdfs:label "Cost of short-work in each category" .
42
+
43
+ :OptimizationProblem a owl:Class ;
44
+ rdfs:label "Optimization Problem" ;
45
+ rdfs:subClassOf [ a owl:Restriction ;
46
+ owl:onProperty :hasParameter ;
47
+ owl:someValuesFrom :Requirement
48
+ ] ,
49
+ [ a owl:Restriction ;
50
+ owl:onProperty :hasParameter ;
51
+ owl:someValuesFrom :K
52
+ ] ,
53
+ [ a owl:Restriction ;
54
+ owl:onProperty :hasParameter ;
55
+ owl:someValuesFrom :I
56
+ ] ,
57
+ [ a owl:Restriction ;
58
+ owl:onProperty :hasParameter ;
59
+ owl:someValuesFrom :Strength
60
+ ] ,
61
+ [ a owl:Restriction ;
62
+ owl:onProperty :hasParameter ;
63
+ owl:someValuesFrom :LessOneWaste
64
+ ] ,
65
+ [ a owl:Restriction ;
66
+ owl:onProperty :hasParameter ;
67
+ owl:someValuesFrom :MoreOneWaste
68
+ ] ,
69
+ [ a owl:Restriction ;
70
+ owl:onProperty :hasParameter ;
71
+ owl:someValuesFrom :Recruit
72
+ ] ,
73
+ [ a owl:Restriction ;
74
+ owl:onProperty :hasParameter ;
75
+ owl:someValuesFrom :CostRedundancy
76
+ ] ,
77
+ [ a owl:Restriction ;
78
+ owl:onProperty :hasParameter ;
79
+ owl:someValuesFrom :NumOverman
80
+ ] ,
81
+ [ a owl:Restriction ;
82
+ owl:onProperty :hasParameter ;
83
+ owl:someValuesFrom :CostOverman
84
+ ] ,
85
+ [ a owl:Restriction ;
86
+ owl:onProperty :hasParameter ;
87
+ owl:someValuesFrom :NumShortwork
88
+ ] ,
89
+ [ a owl:Restriction ;
90
+ owl:onProperty :hasParameter ;
91
+ owl:someValuesFrom :CostShort
92
+ ] .
93
+
94
+ :hasParameter a owl:ObjectProperty ;
95
+ rdfs:label "has parameter" ;
96
+ rdfs:domain :OptimizationProblem ;
97
+ rdfs:range [ a owl:Class ;
98
+ owl:unionOf ( :Requirement :K :I :Strength :LessOneWaste :MoreOneWaste :Recruit :CostRedundancy :NumOverman :CostOverman :NumShortwork :CostShort )
99
+ ] .
@@ -0,0 +1,77 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:MiningProblem a opt:OptimizationProblem ;
7
+ opt:hasParameter opt:K, opt:MaxWork, opt:Royalty, opt:Limit, opt:Quality, opt:RequiredQuality, opt:Price, opt:Discount ;
8
+ opt:hasVariable opt:MineOperation, opt:Production ;
9
+ opt:hasConstraint opt:MaxMineOperationConstraint, opt:ProductionLimitConstraint, opt:QualityConstraint ;
10
+ opt:hasObjective opt:MaximizeProfit .
11
+
12
+ opt:K a opt:Parameter ;
13
+ rdfs:label "Number of mines" ;
14
+ rdfs:comment "The total number of mines owned by the company." ;
15
+ rdfs:range xsd:integer .
16
+
17
+ opt:MaxWork a opt:Parameter ;
18
+ rdfs:label "Maximum number of mines that can be operated in a year" ;
19
+ rdfs:comment "The maximum number of mines the company can operate in any one year." ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:Royalty a opt:Parameter ;
23
+ rdfs:label "Royalty cost for operating mine k" ;
24
+ rdfs:comment "The specific yearly royalties payable for each mine." ;
25
+ rdfs:range xsd:float .
26
+
27
+ opt:Limit a opt:Parameter ;
28
+ rdfs:label "Production limit for mine k" ;
29
+ rdfs:comment "The upper limit to the amount of ore, which can be extracted from each mine in a year." ;
30
+ rdfs:range xsd:float .
31
+
32
+ opt:Quality a opt:Parameter ;
33
+ rdfs:label "Quality of the material from mine k" ;
34
+ rdfs:comment "The quality of ore extracted from each mine." ;
35
+ rdfs:range xsd:float .
36
+
37
+ opt:RequiredQuality a opt:Parameter ;
38
+ rdfs:label "Required quality of the material for client i" ;
39
+ rdfs:comment "The quality of the blended ore required by the client each year." ;
40
+ rdfs:range xsd:float .
41
+
42
+ opt:Price a opt:Parameter ;
43
+ rdfs:label "Price per unit of material sold" ;
44
+ rdfs:comment "The fixed price per ton each year for the final blended ore." ;
45
+ rdfs:range xsd:float .
46
+
47
+ opt:Discount a opt:Parameter ;
48
+ rdfs:label "Discount on the royalty cost per unit of material sold" ;
49
+ rdfs:comment "The discount rate for revenue and expenditure for future years." ;
50
+ rdfs:range xsd:float .
51
+
52
+ opt:MineOperation a opt:Variable ;
53
+ rdfs:label "Mine operation decision" ;
54
+ rdfs:comment "Decision on which mines should be operated each year." ;
55
+ rdfs:range xsd:boolean .
56
+
57
+ opt:Production a opt:Variable ;
58
+ rdfs:label "Production quantity" ;
59
+ rdfs:comment "The amount of ore to be produced from each mine each year." ;
60
+ rdfs:range xsd:float .
61
+
62
+ opt:MaxMineOperationConstraint a opt:Constraint ;
63
+ rdfs:label "Maximum mine operation constraint" ;
64
+ rdfs:comment "The number of mines operated in a year cannot exceed the maximum work capacity." .
65
+
66
+ opt:ProductionLimitConstraint a opt:Constraint ;
67
+ rdfs:label "Production limit constraint" ;
68
+ rdfs:comment "The amount of ore produced from a mine cannot exceed its production limit." .
69
+
70
+ opt:QualityConstraint a opt:Constraint ;
71
+ rdfs:label "Quality constraint" ;
72
+ rdfs:comment "The quality of the blended ore must meet the required quality." .
73
+
74
+ opt:MaximizeProfit a opt:Objective ;
75
+ rdfs:label "Maximize profit" ;
76
+ rdfs:comment "The objective is to maximize the profit by deciding which mines to operate and how much to produce from each." ;
77
+ opt:optimizationType opt:Maximization .
@@ -0,0 +1,75 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.semanticweb.org/ontologies/optimization#> .
5
+
6
+ :Problem1 a opt:OptimizationProblem ;
7
+ opt:hasParameter :K, :InputOne, :ManpowerOne, :InputTwo, :ManpowerTwo, :Stock, :Capacity, :ManpowerLimit, :Demand ;
8
+ opt:hasVariable :Strategy ;
9
+ opt:hasConstraint :Constraint1, :Constraint2, :Constraint3, :Constraint4, :Constraint5 ;
10
+ opt:hasObjective :Objective1 .
11
+
12
+ :K a opt:Parameter ;
13
+ rdfs:label "Total number of years in the planning horizon" ;
14
+ rdfs:range xsd:integer .
15
+
16
+ :InputOne a opt:Parameter ;
17
+ rdfs:label "Input one coefficients matrix" ;
18
+ rdfs:range xsd:float .
19
+
20
+ :ManpowerOne a opt:Parameter ;
21
+ rdfs:label "Manpower coefficients for input one" ;
22
+ rdfs:range xsd:float .
23
+
24
+ :InputTwo a opt:Parameter ;
25
+ rdfs:label "Input two coefficients matrix" ;
26
+ rdfs:range xsd:float .
27
+
28
+ :ManpowerTwo a opt:Parameter ;
29
+ rdfs:label "Manpower coefficients for input two" ;
30
+ rdfs:range xsd:float .
31
+
32
+ :Stock a opt:Parameter ;
33
+ rdfs:label "Initial stock level for each of the productive units" ;
34
+ rdfs:range xsd:integer .
35
+
36
+ :Capacity a opt:Parameter ;
37
+ rdfs:label "Productive capacity for each productive unit" ;
38
+ rdfs:range xsd:integer .
39
+
40
+ :ManpowerLimit a opt:Parameter ;
41
+ rdfs:label "Company-wide manpower limit" ;
42
+ rdfs:range xsd:float .
43
+
44
+ :Demand a opt:Parameter ;
45
+ rdfs:label "Demand for each of the productive units at the end of the planning horizon" ;
46
+ rdfs:range xsd:float .
47
+
48
+ :Strategy a opt:Variable ;
49
+ rdfs:label "Strategy to maximize total productive capacity" ;
50
+ rdfs:range xsd:float .
51
+
52
+ :Constraint1 a opt:Constraint ;
53
+ rdfs:label "Manpower limit constraint" ;
54
+ opt:hasVariable :Strategy .
55
+
56
+ :Constraint2 a opt:Constraint ;
57
+ rdfs:label "Stock level constraint" ;
58
+ opt:hasVariable :Strategy .
59
+
60
+ :Constraint3 a opt:Constraint ;
61
+ rdfs:label "Productive capacity constraint" ;
62
+ opt:hasVariable :Strategy .
63
+
64
+ :Constraint4 a opt:Constraint ;
65
+ rdfs:label "Input one constraint" ;
66
+ opt:hasVariable :Strategy .
67
+
68
+ :Constraint5 a opt:Constraint ;
69
+ rdfs:label "Input two constraint" ;
70
+ opt:hasVariable :Strategy .
71
+
72
+ :Objective1 a opt:Objective ;
73
+ rdfs:label "Maximize total productive capacity" ;
74
+ opt:hasVariable :Strategy ;
75
+ opt:isTypeOf opt:Maximization .
@@ -0,0 +1,50 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:K a rdf:Property ;
7
+ rdfs:label "Total number of years in the planning horizon" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:InputOne a rdf:Property ;
11
+ rdfs:label "The production inputs from resource type one to product k in year j" ;
12
+ rdfs:range xsd:float .
13
+
14
+ opt:ManpowerOne a rdf:Property ;
15
+ rdfs:label "The manpower allocated to resource type one for product k" ;
16
+ rdfs:range xsd:float .
17
+
18
+ opt:InputTwo a rdf:Property ;
19
+ rdfs:label "The production inputs from resource type two to product k in year j" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:ManpowerTwo a rdf:Property ;
23
+ rdfs:label "The manpower allocated to resource type two for product k" ;
24
+ rdfs:range xsd:float .
25
+
26
+ opt:Stock a rdf:Property ;
27
+ rdfs:label "Stock levels of product k at the start of the planning horizon" ;
28
+ rdfs:range xsd:integer .
29
+
30
+ opt:Capacity a rdf:Property ;
31
+ rdfs:label "Production capacity for product k" ;
32
+ rdfs:range xsd:integer .
33
+
34
+ opt:ManpowerLimit a rdf:Property ;
35
+ rdfs:label "The upper limit of manpower" ;
36
+ rdfs:range xsd:float .
37
+
38
+ opt:OptimizationProblem a rdfs:Class ;
39
+ rdfs:label "Optimization Problem" ;
40
+ rdfs:subClassOf rdfs:Resource .
41
+
42
+ opt:Problem1 a opt:OptimizationProblem ;
43
+ opt:K "3"^^xsd:integer ;
44
+ opt:InputOne "0.1"^^xsd:float ;
45
+ opt:ManpowerOne "0.6"^^xsd:float ;
46
+ opt:InputTwo "0.0"^^xsd:float ;
47
+ opt:ManpowerTwo "0.4"^^xsd:float ;
48
+ opt:Stock "150"^^xsd:integer ;
49
+ opt:Capacity "300"^^xsd:integer ;
50
+ opt:ManpowerLimit "470000000.0"^^xsd:float .
@@ -0,0 +1,63 @@
1
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
3
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
5
+ @prefix : <http://www.semanticweb.org/ontologies/2021/5/untitled-ontology-13#> .
6
+
7
+ :K a owl:DatatypeProperty ;
8
+ rdfs:domain :Problem ;
9
+ rdfs:range xsd:integer .
10
+
11
+ :ManpowerOne a owl:DatatypeProperty ;
12
+ rdfs:domain :Problem ;
13
+ rdfs:range xsd:float .
14
+
15
+ :ManpowerTwo a owl:DatatypeProperty ;
16
+ rdfs:domain :Problem ;
17
+ rdfs:range xsd:float .
18
+
19
+ :Stock a owl:DatatypeProperty ;
20
+ rdfs:domain :Problem ;
21
+ rdfs:range xsd:integer .
22
+
23
+ :Capacity a owl:DatatypeProperty ;
24
+ rdfs:domain :Problem ;
25
+ rdfs:range xsd:integer .
26
+
27
+ :Demand a owl:DatatypeProperty ;
28
+ rdfs:domain :Problem ;
29
+ rdfs:range xsd:float .
30
+
31
+ :InputOne a owl:DatatypeProperty ;
32
+ rdfs:domain :Problem ;
33
+ rdfs:range xsd:float .
34
+
35
+ :InputTwo a owl:DatatypeProperty ;
36
+ rdfs:domain :Problem ;
37
+ rdfs:range xsd:float .
38
+
39
+ :Problem a owl:Class ;
40
+ rdfs:subClassOf [ a owl:Restriction ;
41
+ owl:onProperty :K ;
42
+ owl:allValuesFrom xsd:integer ] ,
43
+ [ a owl:Restriction ;
44
+ owl:onProperty :ManpowerOne ;
45
+ owl:allValuesFrom xsd:float ] ,
46
+ [ a owl:Restriction ;
47
+ owl:onProperty :ManpowerTwo ;
48
+ owl:allValuesFrom xsd:float ] ,
49
+ [ a owl:Restriction ;
50
+ owl:onProperty :Stock ;
51
+ owl:allValuesFrom xsd:integer ] ,
52
+ [ a owl:Restriction ;
53
+ owl:onProperty :Capacity ;
54
+ owl:allValuesFrom xsd:integer ] ,
55
+ [ a owl:Restriction ;
56
+ owl:onProperty :Demand ;
57
+ owl:allValuesFrom xsd:float ] ,
58
+ [ a owl:Restriction ;
59
+ owl:onProperty :InputOne ;
60
+ owl:allValuesFrom xsd:float ] ,
61
+ [ a owl:Restriction ;
62
+ owl:onProperty :InputTwo ;
63
+ owl:allValuesFrom xsd:float ] .
@@ -0,0 +1,49 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:PlanningPeriod rdf:type rdfs:Class ;
7
+ rdfs:label "Planning Period" ;
8
+ rdfs:comment "The number of years for which planning is to be conducted" ;
9
+ rdfs:subClassOf xsd:integer .
10
+
11
+ opt:Demand rdf:type rdfs:Class ;
12
+ rdfs:label "Demand" ;
13
+ rdfs:comment "The demand in period t" ;
14
+ rdfs:subClassOf xsd:integer .
15
+
16
+ opt:OilCapacity rdf:type rdfs:Class ;
17
+ rdfs:label "Oil Capacity" ;
18
+ rdfs:comment "The maximum oil capacity in period t" ;
19
+ rdfs:subClassOf xsd:integer .
20
+
21
+ opt:CoalCost rdf:type rdfs:Class ;
22
+ rdfs:label "Coal Cost" ;
23
+ rdfs:comment "The cost of coal per unit" ;
24
+ rdfs:subClassOf xsd:integer .
25
+
26
+ opt:NuclearCost rdf:type rdfs:Class ;
27
+ rdfs:label "Nuclear Cost" ;
28
+ rdfs:comment "The cost of nuclear energy per unit" ;
29
+ rdfs:subClassOf xsd:integer .
30
+
31
+ opt:MaxNuclearCapacity rdf:type rdfs:Class ;
32
+ rdfs:label "Max Nuclear Capacity" ;
33
+ rdfs:comment "The maximum nuclear capacity" ;
34
+ rdfs:subClassOf xsd:integer .
35
+
36
+ opt:CoalPlantLife rdf:type rdfs:Class ;
37
+ rdfs:label "Coal Plant Life" ;
38
+ rdfs:comment "The lifetime of a coal plant" ;
39
+ rdfs:subClassOf xsd:integer .
40
+
41
+ opt:NuclearPlantLife rdf:type rdfs:Class ;
42
+ rdfs:label "Nuclear Plant Life" ;
43
+ rdfs:comment "The lifetime of a nuclear plant" ;
44
+ rdfs:subClassOf xsd:integer .
45
+
46
+ opt:ElectricityCapacityPlanning rdf:type rdfs:Class ;
47
+ rdfs:label "Electricity Capacity Planning" ;
48
+ rdfs:comment "A state wants to plan its electricity capacity for the next few years" ;
49
+ rdfs:subClassOf opt:PlanningPeriod, opt:Demand, opt:OilCapacity, opt:CoalCost, opt:NuclearCost, opt:MaxNuclearCapacity, opt:CoalPlantLife, opt:NuclearPlantLife .
@@ -0,0 +1,49 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:DepartmentRelocationProblem a opt:OptimizationProblem ;
7
+ opt:hasParameter opt:K, opt:L, opt:Benefit, opt:Communication, opt:Cost ;
8
+ opt:hasVariable opt:DepartmentLocation ;
9
+ opt:hasConstraint opt:LocationLimit ;
10
+ opt:hasObjective opt:MinimizeCost .
11
+
12
+ opt:K a opt:Parameter ;
13
+ rdfs:label "Number of departments" ;
14
+ rdfs:comment "The total number of departments in the company." ;
15
+ rdfs:range xsd:integer .
16
+
17
+ opt:L a opt:Parameter ;
18
+ rdfs:label "Number of possible locations" ;
19
+ rdfs:comment "The total number of possible locations for relocation." ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:Benefit a opt:Parameter ;
23
+ rdfs:label "Benefit of department k being located at location l" ;
24
+ rdfs:comment "The benefit derived from relocating department k to location l." ;
25
+ rdfs:range xsd:float .
26
+
27
+ opt:Communication a opt:Parameter ;
28
+ rdfs:label "Communication costs between departments k and j" ;
29
+ rdfs:comment "The cost of communication between department k and department j." ;
30
+ rdfs:range xsd:float .
31
+
32
+ opt:Cost a opt:Parameter ;
33
+ rdfs:label "Cost of locating at location l with requirement m" ;
34
+ rdfs:comment "The cost of locating a department at location l with requirement m." ;
35
+ rdfs:range xsd:float .
36
+
37
+ opt:DepartmentLocation a opt:Variable ;
38
+ rdfs:label "Department location" ;
39
+ rdfs:comment "The location of each department." ;
40
+ rdfs:range xsd:integer .
41
+
42
+ opt:LocationLimit a opt:Constraint ;
43
+ rdfs:label "Location limit" ;
44
+ rdfs:comment "No more than three departments can be located in the same city." .
45
+
46
+ opt:MinimizeCost a opt:Objective ;
47
+ rdfs:label "Minimize cost" ;
48
+ rdfs:comment "The objective is to minimize the overall yearly cost." ;
49
+ opt:optimizationType opt:Minimization .
@@ -0,0 +1,35 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:K a rdf:Property ;
7
+ rdfs:label "Number of data points" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:Y a rdf:Property ;
11
+ rdfs:label "Observed values of the dependent variable" ;
12
+ rdfs:range xsd:float .
13
+
14
+ opt:X a rdf:Property ;
15
+ rdfs:label "Observed values of the independent variable" ;
16
+ rdfs:range xsd:float .
17
+
18
+ opt:a a rdf:Property ;
19
+ rdfs:label "Intercept of the best fit line" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:b a rdf:Property ;
23
+ rdfs:label "Slope of the best fit line" ;
24
+ rdfs:range xsd:float .
25
+
26
+ opt:LinearRelationship a opt:OptimizationProblem ;
27
+ rdfs:label "Linear Relationship" ;
28
+ opt:hasParameter opt:K, opt:Y, opt:X ;
29
+ opt:hasVariable opt:a, opt:b ;
30
+ opt:hasObjectiveFunction opt:MinimizeSumOfAbsoluteDeviations .
31
+
32
+ opt:MinimizeSumOfAbsoluteDeviations a opt:ObjectiveFunction ;
33
+ rdfs:label "Minimize the sum of absolute deviations" ;
34
+ opt:hasVariable opt:a, opt:b ;
35
+ opt:isMinimization true .
@@ -0,0 +1,33 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:NumObs a rdf:Property ;
7
+ rdfs:label "Number of observed data points" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:Y a rdf:Property ;
11
+ rdfs:label "Observed values of y" ;
12
+ rdfs:range xsd:float .
13
+
14
+ opt:X a rdf:Property ;
15
+ rdfs:label "Observed values of x" ;
16
+ rdfs:range xsd:float .
17
+
18
+ opt:a a opt:Variable ;
19
+ rdfs:label "Intercept of the best fit line" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:b a opt:Variable ;
23
+ rdfs:label "Slope of the best fit line" ;
24
+ rdfs:range xsd:float .
25
+
26
+ opt:LinearRelationship a opt:Constraint ;
27
+ rdfs:label "Linear relationship between x and y" ;
28
+ rdfs:comment "y = bx + a" .
29
+
30
+ opt:MaxDeviation a opt:Objective ;
31
+ rdfs:label "Maximum deviation of observed y from predicted y" ;
32
+ rdfs:comment "Minimize the maximum deviation" ;
33
+ opt:optimizationType opt:Minimization .
@@ -0,0 +1,49 @@
1
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix opt: <http://www.example.org/optimization#> .
5
+
6
+ opt:K a rdf:Property ;
7
+ rdfs:label "Number of data points" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:ObservedValues a rdf:Property ;
11
+ rdfs:label "Observed y values at each data point k" ;
12
+ rdfs:range xsd:float .
13
+
14
+ opt:ObservedXValues a rdf:Property ;
15
+ rdfs:label "Observed x values at each data point k" ;
16
+ rdfs:range xsd:float .
17
+
18
+ opt:a a rdf:Property ;
19
+ rdfs:label "Constant term in quadratic equation" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:b a rdf:Property ;
23
+ rdfs:label "Linear coefficient in quadratic equation" ;
24
+ rdfs:range xsd:float .
25
+
26
+ opt:c a rdf:Property ;
27
+ rdfs:label "Quadratic coefficient in quadratic equation" ;
28
+ rdfs:range xsd:float .
29
+
30
+ opt:QuadraticCurve a rdfs:Class ;
31
+ rdfs:label "Quadratic curve" ;
32
+ rdfs:subClassOf opt:Curve ;
33
+ rdfs:comment "Curve defined by the equation y = c * x^2 + b * x + a" .
34
+
35
+ opt:Curve a rdfs:Class ;
36
+ rdfs:label "Curve" ;
37
+ rdfs:comment "A curve in a two-dimensional space" .
38
+
39
+ opt:DataPoint a rdfs:Class ;
40
+ rdfs:label "Data point" ;
41
+ rdfs:comment "A point in a two-dimensional space representing observed values of x and y" .
42
+
43
+ opt:MinimizeAbsoluteDeviations a opt:Objective ;
44
+ rdfs:label "Minimize the sum of absolute deviations" ;
45
+ rdfs:comment "Objective is to minimize the sum of absolute deviations of each observed value of y from the value predicted by the quadratic relationship" .
46
+
47
+ opt:Objective a rdfs:Class ;
48
+ rdfs:label "Objective" ;
49
+ rdfs:comment "The goal of the optimization problem" .