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,98 @@
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 types of minerals" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:SteelQuantity a rdf:Property ;
11
+ rdfs:label "Amount of steel to produce in tons" ;
12
+ rdfs:range xsd:float .
13
+
14
+ opt:ManganesePercent a rdf:Property ;
15
+ rdfs:label "Percentage of manganese in the steel required" ;
16
+ rdfs:range xsd:float .
17
+
18
+ opt:SiliconMinPercent a rdf:Property ;
19
+ rdfs:label "Minimum percentage of silicon in the steel required" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:SiliconMaxPercent a rdf:Property ;
23
+ rdfs:label "Maximum percentage of silicon in the steel allowed" ;
24
+ rdfs:range xsd:float .
25
+
26
+ opt:SiliconContent a rdf:Property ;
27
+ rdfs:label "Silicon content in the k-th stock" ;
28
+ rdfs:range xsd:float .
29
+
30
+ opt:ManganeseContent a rdf:Property ;
31
+ rdfs:label "Manganese content in the k-th stock" ;
32
+ rdfs:range xsd:float .
33
+
34
+ opt:ManganesePrice a rdf:Property ;
35
+ rdfs:label "Price of manganese per ton" ;
36
+ rdfs:range xsd:float .
37
+
38
+ opt:MaterialCost a rdf:Property ;
39
+ rdfs:label "Cost of the k-th stock material per ton" ;
40
+ rdfs:range xsd:float .
41
+
42
+ opt:SellingPrice a rdf:Property ;
43
+ rdfs:label "Selling price of steel per ton" ;
44
+ rdfs:range xsd:float .
45
+
46
+ opt:MeltingPrice a rdf:Property ;
47
+ rdfs:label "Price to melt one ton of steel" ;
48
+ rdfs:range xsd:float .
49
+
50
+ opt:SteelProduction a rdf:Class ;
51
+ rdfs:label "Steel Production" ;
52
+ rdfs:subClassOf opt:OptimizationProblem ;
53
+ rdfs:comment "Optimization problem to maximize profit in steel production" .
54
+
55
+ opt:OptimizationProblem a rdf:Class ;
56
+ rdfs:label "Optimization Problem" ;
57
+ rdfs:comment "A problem to be solved by finding the best solution among a set of possible solutions" .
58
+
59
+ opt:hasParameter a rdf:Property ;
60
+ rdfs:label "has parameter" ;
61
+ rdfs:domain opt:OptimizationProblem ;
62
+ rdfs:range opt:Parameter .
63
+
64
+ opt:Parameter a rdf:Class ;
65
+ rdfs:label "Parameter" ;
66
+ rdfs:comment "A constant in the problem that is not subject to optimization" .
67
+
68
+ opt:hasVariable a rdf:Property ;
69
+ rdfs:label "has variable" ;
70
+ rdfs:domain opt:OptimizationProblem ;
71
+ rdfs:range opt:Variable .
72
+
73
+ opt:Variable a rdf:Class ;
74
+ rdfs:label "Variable" ;
75
+ rdfs:comment "A quantity that is subject to optimization in the problem" .
76
+
77
+ opt:hasConstraint a rdf:Property ;
78
+ rdfs:label "has constraint" ;
79
+ rdfs:domain opt:OptimizationProblem ;
80
+ rdfs:range opt:Constraint .
81
+
82
+ opt:Constraint a rdf:Class ;
83
+ rdfs:label "Constraint" ;
84
+ rdfs:comment "A condition that the solution to the problem must satisfy" .
85
+
86
+ opt:hasObjective a rdf:Property ;
87
+ rdfs:label "has objective" ;
88
+ rdfs:domain opt:OptimizationProblem ;
89
+ rdfs:range opt:Objective .
90
+
91
+ opt:Objective a rdf:Class ;
92
+ rdfs:label "Objective" ;
93
+ rdfs:comment "The goal to be achieved in the problem" .
94
+
95
+ opt:Maximize a rdf:Class ;
96
+ rdfs:label "Maximize" ;
97
+ rdfs:subClassOf opt:Objective ;
98
+ rdfs:comment "An objective to maximize a quantity" .
@@ -0,0 +1,41 @@
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:FileBackupProblem a opt:OptimizationProblem ;
7
+ opt:hasParameter opt:N, opt:Capacity, opt:Size ;
8
+ opt:hasVariable opt:Distribution ;
9
+ opt:hasConstraint opt:CapacityConstraint ;
10
+ opt:hasObjective opt:MinimizeDisks .
11
+
12
+ opt:N a opt:Parameter ;
13
+ rdfs:label "Number of files" ;
14
+ rdfs:comment "The total number of files to be backed up" ;
15
+ rdfs:range xsd:integer .
16
+
17
+ opt:Capacity a opt:Parameter ;
18
+ rdfs:label "Floppy disk capacity" ;
19
+ rdfs:comment "The total storage capacity of a single floppy disk" ;
20
+ rdfs:range xsd:float .
21
+
22
+ opt:Size a opt:Parameter ;
23
+ rdfs:label "File sizes" ;
24
+ rdfs:comment "The size of each file to be backed up" ;
25
+ rdfs:range xsd:float .
26
+
27
+ opt:Distribution a opt:Variable ;
28
+ rdfs:label "File distribution" ;
29
+ rdfs:comment "The distribution of files across the floppy disks" ;
30
+ rdfs:range xsd:integer .
31
+
32
+ opt:CapacityConstraint a opt:Constraint ;
33
+ rdfs:label "Capacity constraint" ;
34
+ rdfs:comment "The total size of files on a disk must not exceed the disk's capacity" ;
35
+ opt:constrains opt:Distribution .
36
+
37
+ opt:MinimizeDisks a opt:Objective ;
38
+ rdfs:label "Minimize number of disks" ;
39
+ rdfs:comment "The goal is to minimize the number of floppy disks used for backup" ;
40
+ opt:optimizationType opt:Minimization ;
41
+ opt:constrains opt:Distribution .
@@ -0,0 +1,56 @@
1
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
2
+ @prefix opt: <http://www.semanticweb.org/ontologies/optimizationProblem#> .
3
+
4
+ :TransportationProblem a opt:OptimizationProblem ;
5
+ opt:hasObjective :Objective ;
6
+ opt:hasConstraint :Constraint1, :Constraint2 ;
7
+ opt:hasVariable :Variable1 ;
8
+ opt:hasParameter :Parameter1, :Parameter2, :Parameter3, :Parameter4, :Parameter5, :Parameter6 .
9
+
10
+ :Parameter1 a opt:Parameter ;
11
+ opt:hasName "D" ;
12
+ opt:hasType xsd:integer ;
13
+ opt:hasShape "scalar" .
14
+
15
+ :Parameter2 a opt:Parameter ;
16
+ opt:hasName "P" ;
17
+ opt:hasType xsd:integer ;
18
+ opt:hasShape "scalar" .
19
+
20
+ :Parameter3 a opt:Parameter ;
21
+ opt:hasName "Numdepot" ;
22
+ opt:hasType xsd:integer ;
23
+ opt:hasShape "[N]" .
24
+
25
+ :Parameter4 a opt:Parameter ;
26
+ opt:hasName "Numport" ;
27
+ opt:hasType xsd:integer ;
28
+ opt:hasShape "[N]" .
29
+
30
+ :Parameter5 a opt:Parameter ;
31
+ opt:hasName "Price" ;
32
+ opt:hasType xsd:float ;
33
+ opt:hasShape "scalar" .
34
+
35
+ :Parameter6 a opt:Parameter ;
36
+ opt:hasName "Distance" ;
37
+ opt:hasType xsd:float ;
38
+ opt:hasShape "[D, P]" .
39
+
40
+ :Variable1 a opt:Variable ;
41
+ opt:hasName "x" ;
42
+ opt:hasType xsd:integer ;
43
+ opt:hasShape "[D, P]" .
44
+
45
+ :Constraint1 a opt:Constraint ;
46
+ opt:hasName "Supply" ;
47
+ opt:hasExpression "sum_{p in P} x[d,p] <= Numdepot[d] for all d in D" .
48
+
49
+ :Constraint2 a opt:Constraint ;
50
+ opt:hasName "Demand" ;
51
+ opt:hasExpression "sum_{d in D} x[d,p] >= Numport[p] for all p in P" .
52
+
53
+ :Objective a opt:Objective ;
54
+ opt:hasName "MinimizeCost" ;
55
+ opt:hasType "minimize" ;
56
+ opt:hasExpression "sum_{d in D, p in P} Price * Distance[d,p] * x[d,p]" .
@@ -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:RawMaterials rdf:type rdfs:Class .
7
+ opt:Products rdf:type rdfs:Class .
8
+ opt:Available rdf:type rdfs:Property ;
9
+ rdfs:domain opt:RawMaterials ;
10
+ rdfs:range xsd:integer .
11
+ opt:Requirements rdf:type rdfs:Property ;
12
+ rdfs:domain opt:Products ;
13
+ rdfs:range opt:RawMaterials .
14
+ opt:Prices rdf:type rdfs:Property ;
15
+ rdfs:domain opt:Products ;
16
+ rdfs:range xsd:float .
17
+ opt:Costs rdf:type rdfs:Property ;
18
+ rdfs:domain opt:Products ;
19
+ rdfs:range xsd:float .
20
+ opt:Demands rdf:type rdfs:Property ;
21
+ rdfs:domain opt:Products ;
22
+ rdfs:range xsd:integer .
23
+ opt:MaximizeProfit rdf:type opt:OptimizationProblem ;
24
+ opt:hasObjectiveFunction opt:ProfitFunction ;
25
+ opt:hasConstraint opt:MaterialAvailabilityConstraint , opt:ProductDemandConstraint .
26
+ opt:ProfitFunction rdf:type opt:ObjectiveFunction ;
27
+ opt:hasVariable opt:Products ;
28
+ opt:hasParameter opt:Prices , opt:Costs ;
29
+ opt:optimizationType "Maximization"^^xsd:string .
30
+ opt:MaterialAvailabilityConstraint rdf:type opt:Constraint ;
31
+ opt:hasVariable opt:Products ;
32
+ opt:hasParameter opt:Available , opt:Requirements .
33
+ opt:ProductDemandConstraint rdf:type opt:Constraint ;
34
+ opt:hasVariable opt:Products ;
35
+ opt:hasParameter opt:Demands .
@@ -0,0 +1,68 @@
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
+ :OptimizationProblem a owl:Class ;
7
+ rdfs:subClassOf :Problem .
8
+
9
+ :Parameter a owl:Class ;
10
+ rdfs:subClassOf :OptimizationProblem .
11
+
12
+ :Variable a owl:Class ;
13
+ rdfs:subClassOf :OptimizationProblem .
14
+
15
+ :Constraint a owl:Class ;
16
+ rdfs:subClassOf :OptimizationProblem .
17
+
18
+ :Objective a owl:Class ;
19
+ rdfs:subClassOf :OptimizationProblem .
20
+
21
+ :P a :Parameter ;
22
+ rdfs:label "Number of parts" ;
23
+ rdfs:comment "P = 4" ;
24
+ rdfs:range xsd:integer .
25
+
26
+ :M a :Parameter ;
27
+ rdfs:label "Number of machines" ;
28
+ rdfs:comment "M = 3" ;
29
+ rdfs:range xsd:integer .
30
+
31
+ :TimeRequired a :Parameter ;
32
+ rdfs:label "Time required to produce one batch of part p on machine m" ;
33
+ rdfs:comment "TimeRequired = array2d(1..3, 1..4, [2, 1, 3, 2, 4, 2, 1, 2, 6, 2, 1, 2])" ;
34
+ rdfs:range xsd:array .
35
+
36
+ :MachineCosts a :Parameter ;
37
+ rdfs:label "Cost associated with using machine m" ;
38
+ rdfs:comment "MachineCosts = [160, 10, 15]" ;
39
+ rdfs:range xsd:array .
40
+
41
+ :Availability a :Parameter ;
42
+ rdfs:label "Availability of machine m per month" ;
43
+ rdfs:comment "Availability = [200, 300, 500]" ;
44
+ rdfs:range xsd:array .
45
+
46
+ :Prices a :Parameter ;
47
+ rdfs:label "Selling price of one batch of part p" ;
48
+ rdfs:comment "Prices = [570, 250, 585, 430]" ;
49
+ rdfs:range xsd:array .
50
+
51
+ :MinBatches a :Parameter ;
52
+ rdfs:label "Minimum number of batches of part p to be produced" ;
53
+ rdfs:comment "MinBatches = [10, 10, 10, 10]" ;
54
+ rdfs:range xsd:array .
55
+
56
+ :Batches a :Variable ;
57
+ rdfs:label "Number of batches of each part to be produced" ;
58
+ rdfs:range xsd:integer .
59
+
60
+ :MachineTimeConstraint a :Constraint ;
61
+ rdfs:label "Time required to produce batches should not exceed machine availability" .
62
+
63
+ :MinBatchConstraint a :Constraint ;
64
+ rdfs:label "Number of batches produced should be greater than or equal to the minimum required" .
65
+
66
+ :ProfitMaximization a :Objective ;
67
+ rdfs:label "Maximize profit" ;
68
+ rdfs:comment "Profit is calculated as the difference between the selling price of the batches and the cost of using the machines" .
@@ -0,0 +1,74 @@
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:AdCampaign a rdfs:Class ;
7
+ rdfs:label "Ad Campaign" .
8
+
9
+ opt:AdType a rdfs:Class ;
10
+ rdfs:label "Ad Type" .
11
+
12
+ opt:GoalYoung a rdf:Property ;
13
+ rdfs:label "Goal for young clicks" ;
14
+ rdfs:domain opt:AdCampaign ;
15
+ rdfs:range xsd:integer .
16
+
17
+ opt:GoalOld a rdf:Property ;
18
+ rdfs:label "Goal for old clicks" ;
19
+ rdfs:domain opt:AdCampaign ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:GoalUniqueYoung a rdf:Property ;
23
+ rdfs:label "Goal for unique young clicks" ;
24
+ rdfs:domain opt:AdCampaign ;
25
+ rdfs:range xsd:integer .
26
+
27
+ opt:GoalUniqueOld a rdf:Property ;
28
+ rdfs:label "Goal for unique old clicks" ;
29
+ rdfs:domain opt:AdCampaign ;
30
+ rdfs:range xsd:integer .
31
+
32
+ opt:YoungClicks a rdf:Property ;
33
+ rdfs:label "Young clicks per ad type" ;
34
+ rdfs:domain opt:AdType ;
35
+ rdfs:range xsd:integer .
36
+
37
+ opt:OldClicks a rdf:Property ;
38
+ rdfs:label "Old clicks per ad type" ;
39
+ rdfs:domain opt:AdType ;
40
+ rdfs:range xsd:integer .
41
+
42
+ opt:Costs a rdf:Property ;
43
+ rdfs:label "Cost per ad type" ;
44
+ rdfs:domain opt:AdType ;
45
+ rdfs:range xsd:integer .
46
+
47
+ opt:MaxClicks a rdf:Property ;
48
+ rdfs:label "Maximum clicks per ad type" ;
49
+ rdfs:domain opt:AdType ;
50
+ rdfs:range xsd:integer .
51
+
52
+ opt:UniqueClicks a rdf:Property ;
53
+ rdfs:label "Unique clicks per ad type" ;
54
+ rdfs:domain opt:AdType ;
55
+ rdfs:range xsd:integer .
56
+
57
+ opt:hasAdType a rdf:Property ;
58
+ rdfs:label "Has ad type" ;
59
+ rdfs:domain opt:AdCampaign ;
60
+ rdfs:range opt:AdType .
61
+
62
+ opt:MinimizeCost a rdfs:Class ;
63
+ rdfs:label "Minimize cost" ;
64
+ rdfs:subClassOf opt:AdCampaign .
65
+
66
+ opt:hasConstraint a rdf:Property ;
67
+ rdfs:label "Has constraint" ;
68
+ rdfs:domain opt:AdCampaign ;
69
+ rdfs:range rdfs:Literal .
70
+
71
+ opt:hasObjective a rdf:Property ;
72
+ rdfs:label "Has objective" ;
73
+ rdfs:domain opt:AdCampaign ;
74
+ rdfs:range rdfs:Literal .
@@ -0,0 +1,66 @@
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:Alloy a rdfs:Class ;
7
+ rdfs:label "Alloy" ;
8
+ rdfs:comment "Different types of alloys used in steel production" .
9
+
10
+ opt:Steel a rdfs:Class ;
11
+ rdfs:label "Steel" ;
12
+ rdfs:comment "Different types of steel produced by the company" .
13
+
14
+ opt:hasAvailableAmount a rdf:Property ;
15
+ rdfs:label "has available amount" ;
16
+ rdfs:domain opt:Alloy ;
17
+ rdfs:range xsd:integer .
18
+
19
+ opt:hasCarbonContent a rdf:Property ;
20
+ rdfs:label "has carbon content" ;
21
+ rdfs:domain opt:Alloy ;
22
+ rdfs:range xsd:float .
23
+
24
+ opt:hasNickelContent a rdf:Property ;
25
+ rdfs:label "has nickel content" ;
26
+ rdfs:domain opt:Alloy ;
27
+ rdfs:range xsd:float .
28
+
29
+ opt:hasAlloyPrice a rdf:Property ;
30
+ rdfs:label "has alloy price" ;
31
+ rdfs:domain opt:Alloy ;
32
+ rdfs:range xsd:integer .
33
+
34
+ opt:hasSteelPrice a rdf:Property ;
35
+ rdfs:label "has steel price" ;
36
+ rdfs:domain opt:Steel ;
37
+ rdfs:range xsd:integer .
38
+
39
+ opt:hasCarbonMin a rdf:Property ;
40
+ rdfs:label "has minimum carbon content" ;
41
+ rdfs:domain opt:Steel ;
42
+ rdfs:range xsd:float .
43
+
44
+ opt:hasNickelMax a rdf:Property ;
45
+ rdfs:label "has maximum nickel content" ;
46
+ rdfs:domain opt:Steel ;
47
+ rdfs:range xsd:float .
48
+
49
+ opt:OptimizationProblem a rdfs:Class ;
50
+ rdfs:label "Optimization Problem" ;
51
+ rdfs:comment "The optimization problem to maximize profit" .
52
+
53
+ opt:hasObjective a rdf:Property ;
54
+ rdfs:label "has objective" ;
55
+ rdfs:domain opt:OptimizationProblem ;
56
+ rdfs:range xsd:string .
57
+
58
+ opt:hasConstraint a rdf:Property ;
59
+ rdfs:label "has constraint" ;
60
+ rdfs:domain opt:OptimizationProblem ;
61
+ rdfs:range xsd:string .
62
+
63
+ opt:hasVariable a rdf:Property ;
64
+ rdfs:label "has variable" ;
65
+ rdfs:domain opt:OptimizationProblem ;
66
+ rdfs:range xsd:string .
@@ -0,0 +1,69 @@
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:NumLinks a rdf:Property ;
7
+ rdfs:domain opt:Network ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:StartNode a rdf:Property ;
11
+ rdfs:domain opt:Link ;
12
+ rdfs:range opt:Node .
13
+
14
+ opt:EndNode a rdf:Property ;
15
+ rdfs:domain opt:Link ;
16
+ rdfs:range opt:Node .
17
+
18
+ opt:Capacity a rdf:Property ;
19
+ rdfs:domain opt:Link ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:Cost a rdf:Property ;
23
+ rdfs:domain opt:Link ;
24
+ rdfs:range xsd:integer .
25
+
26
+ opt:NumFlowReqs a rdf:Property ;
27
+ rdfs:domain opt:Network ;
28
+ rdfs:range xsd:integer .
29
+
30
+ opt:SourceNode a rdf:Property ;
31
+ rdfs:domain opt:FlowReq ;
32
+ rdfs:range opt:Node .
33
+
34
+ opt:DestinationNode a rdf:Property ;
35
+ rdfs:domain opt:FlowReq ;
36
+ rdfs:range opt:Node .
37
+
38
+ opt:DataRate a rdf:Property ;
39
+ rdfs:domain opt:FlowReq ;
40
+ rdfs:range xsd:integer .
41
+
42
+ opt:Network a rdfs:Class .
43
+
44
+ opt:Link a rdfs:Class ;
45
+ rdfs:subClassOf opt:Network .
46
+
47
+ opt:Node a rdfs:Class ;
48
+ rdfs:subClassOf opt:Network .
49
+
50
+ opt:FlowReq a rdfs:Class ;
51
+ rdfs:subClassOf opt:Network .
52
+
53
+ opt:MinimizeTotalCost a opt:Objective ;
54
+ rdfs:comment "Minimize the total cost of data transmission" ;
55
+ rdfs:subClassOf opt:Network .
56
+
57
+ opt:Objective a rdfs:Class ;
58
+ rdfs:subClassOf opt:Network .
59
+
60
+ opt:Constraint a rdfs:Class ;
61
+ rdfs:subClassOf opt:Network .
62
+
63
+ opt:CapacityConstraint a opt:Constraint ;
64
+ rdfs:comment "Data transmitted along a link should not exceed its capacity" ;
65
+ rdfs:subClassOf opt:Network .
66
+
67
+ opt:FlowReqConstraint a opt:Constraint ;
68
+ rdfs:comment "Data generated at the source node must reach the destination node" ;
69
+ rdfs:subClassOf opt:Network .
@@ -0,0 +1,51 @@
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:NumShifts a rdf:Property ;
7
+ rdfs:domain opt:PoliceShiftOptimization ;
8
+ rdfs:range xsd:integer ;
9
+ rdfs:comment "Number of shifts for which officers are needed" .
10
+
11
+ opt:OfficersNeeded a rdf:Property ;
12
+ rdfs:domain opt:PoliceShiftOptimization ;
13
+ rdfs:range xsd:integer ;
14
+ rdfs:comment "Number of officers needed for shift s" .
15
+
16
+ opt:ShiftCosts a rdf:Property ;
17
+ rdfs:domain opt:PoliceShiftOptimization ;
18
+ rdfs:range xsd:integer ;
19
+ rdfs:comment "Cost of assigning an officer to shift s" .
20
+
21
+ opt:PoliceShiftOptimization a rdfs:Class ;
22
+ rdfs:subClassOf opt:OptimizationProblem ;
23
+ rdfs:comment "Optimization problem to minimize the total cost of assigning police officers to shifts" .
24
+
25
+ opt:OptimizationProblem a rdfs:Class ;
26
+ rdfs:comment "A general class for optimization problems" .
27
+
28
+ opt:hasObjective a rdf:Property ;
29
+ rdfs:domain opt:OptimizationProblem ;
30
+ rdfs:range opt:Objective ;
31
+ rdfs:comment "The objective of the optimization problem" .
32
+
33
+ opt:Objective a rdfs:Class ;
34
+ rdfs:comment "The objective of an optimization problem" .
35
+
36
+ opt:MinimizeTotalCost a opt:Objective ;
37
+ rdfs:comment "Minimize the total cost of assigning police officers to shifts" .
38
+
39
+ opt:hasConstraint a rdf:Property ;
40
+ rdfs:domain opt:OptimizationProblem ;
41
+ rdfs:range opt:Constraint ;
42
+ rdfs:comment "A constraint of the optimization problem" .
43
+
44
+ opt:Constraint a rdfs:Class ;
45
+ rdfs:comment "A constraint of an optimization problem" .
46
+
47
+ opt:OfficersWorkTwoShifts a opt:Constraint ;
48
+ rdfs:comment "Each police officer works for two consecutive shifts" .
49
+
50
+ opt:RequiredOfficersPerShift a opt:Constraint ;
51
+ rdfs:comment "The town has a requirement for the number of police officers on duty during each shift" .
@@ -0,0 +1,53 @@
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:W rdf:type rdfs:Class ;
7
+ rdfs:label "Number of weeks in planning period" ;
8
+ rdfs:comment "Scalar value representing the number of weeks in the planning period" .
9
+
10
+ opt:RegularCost rdf:type rdfs:Class ;
11
+ rdfs:label "Cost of regular labor per unit of time" ;
12
+ rdfs:comment "Scalar value representing the cost of regular labor per unit of time" .
13
+
14
+ opt:OvertimeCost rdf:type rdfs:Class ;
15
+ rdfs:label "Cost of overtime labor per unit of time" ;
16
+ rdfs:comment "Scalar value representing the cost of overtime labor per unit of time" .
17
+
18
+ opt:AssemblyTime rdf:type rdfs:Class ;
19
+ rdfs:label "Time required to assemble a single basket" ;
20
+ rdfs:comment "Scalar value representing the time required to assemble a single basket" .
21
+
22
+ opt:MaterialCost rdf:type rdfs:Class ;
23
+ rdfs:label "Cost of materials per basket" ;
24
+ rdfs:comment "Scalar value representing the cost of materials per basket" .
25
+
26
+ opt:SellingPrice rdf:type rdfs:Class ;
27
+ rdfs:label "Selling price per basket" ;
28
+ rdfs:comment "Scalar value representing the selling price per basket" .
29
+
30
+ opt:HoldingCost rdf:type rdfs:Class ;
31
+ rdfs:label "Holding cost per basket per unit of time" ;
32
+ rdfs:comment "Scalar value representing the holding cost per basket per unit of time" .
33
+
34
+ opt:SalvageValue rdf:type rdfs:Class ;
35
+ rdfs:label "Salvage value per unsold basket at the end of the season" ;
36
+ rdfs:comment "Scalar value representing the salvage value per unsold basket at the end of the season" .
37
+
38
+ opt:Demand rdf:type rdfs:Class ;
39
+ rdfs:label "Demand for baskets in week w" ;
40
+ rdfs:comment "Array of size W representing the demand for baskets in each week" .
41
+
42
+ opt:RegularLabor rdf:type rdfs:Class ;
43
+ rdfs:label "Number of regular labor units available in week w" ;
44
+ rdfs:comment "Array of size W representing the number of regular labor units available in each week" .
45
+
46
+ opt:OvertimeLabor rdf:type rdfs:Class ;
47
+ rdfs:label "Number of overtime labor units available in week w" ;
48
+ rdfs:comment "Array of size W representing the number of overtime labor units available in each week" .
49
+
50
+ opt:OptimizationProblem rdf:type rdfs:Class ;
51
+ rdfs:label "Optimization problem" ;
52
+ rdfs:comment "The optimization problem to maximize the profit over the season" ;
53
+ rdfs:subClassOf opt:W, opt:RegularCost, opt:OvertimeCost, opt:AssemblyTime, opt:MaterialCost, opt:SellingPrice, opt:HoldingCost, opt:SalvageValue, opt:Demand, opt:RegularLabor, opt:OvertimeLabor .
@@ -0,0 +1,51 @@
1
+ @prefix : <http://www.semanticweb.org/ontologies/2021/4/untitled-ontology-13#> .
2
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
3
+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
4
+ @prefix xml: <http://www.w3.org/XML/1998/namespace> .
5
+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
6
+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7
+
8
+ :OptimizationProblem a owl:Class ;
9
+ rdfs:subClassOf owl:Thing ;
10
+ rdfs:label "Optimization Problem" .
11
+
12
+ :Machines a owl:Class ;
13
+ rdfs:subClassOf owl:Thing ;
14
+ rdfs:label "Machines" .
15
+
16
+ :Parts a owl:Class ;
17
+ rdfs:subClassOf owl:Thing ;
18
+ rdfs:label "Parts" .
19
+
20
+ :TimeRequired a owl:Class ;
21
+ rdfs:subClassOf owl:Thing ;
22
+ rdfs:label "Time Required" .
23
+
24
+ :MachineCosts a owl:Class ;
25
+ rdfs:subClassOf owl:Thing ;
26
+ rdfs:label "Machine Costs" .
27
+
28
+ :Availability a owl:Class ;
29
+ rdfs:subClassOf owl:Thing ;
30
+ rdfs:label "Availability" .
31
+
32
+ :Prices a owl:Class ;
33
+ rdfs:subClassOf owl:Thing ;
34
+ rdfs:label "Prices" .
35
+
36
+ :MinBatches a owl:Class ;
37
+ rdfs:subClassOf owl:Thing ;
38
+ rdfs:label "Minimum Batches" .
39
+
40
+ :Constraints a owl:Class ;
41
+ rdfs:subClassOf owl:Thing ;
42
+ rdfs:label "Constraints" .
43
+
44
+ :Objective a owl:Class ;
45
+ rdfs:subClassOf owl:Thing ;
46
+ rdfs:label "Objective" .
47
+
48
+ :OptimizationProblem :hasParameter :Machines, :Parts, :TimeRequired, :MachineCosts, :Availability, :Prices, :MinBatches .
49
+ :OptimizationProblem :hasVariable :Batches .
50
+ :OptimizationProblem :hasConstraint :Constraints .
51
+ :OptimizationProblem :hasObjective :Objective .