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.
- text2model/__init__.py +1 -0
- text2model/grammar.mzn +277 -0
- text2model/knowledge_graphs/CSPLib_12.ttl +41 -0
- text2model/knowledge_graphs/CSPLib_14.ttl +51 -0
- text2model/knowledge_graphs/CSPLib_2.ttl +59 -0
- text2model/knowledge_graphs/CSPLib_22.ttl +62 -0
- text2model/knowledge_graphs/CSPLib_28.ttl +28 -0
- text2model/knowledge_graphs/CSPLib_30.ttl +72 -0
- text2model/knowledge_graphs/CSPLib_34.ttl +52 -0
- text2model/knowledge_graphs/CSPLib_39.ttl +51 -0
- text2model/knowledge_graphs/CSPLib_54.ttl +50 -0
- text2model/knowledge_graphs/CSPLib_6.ttl +36 -0
- text2model/knowledge_graphs/CSPLib_8.ttl +53 -0
- text2model/knowledge_graphs/LPWP_128.ttl +79 -0
- text2model/knowledge_graphs/LPWP_232.ttl +95 -0
- text2model/knowledge_graphs/LPWP_53.ttl +58 -0
- text2model/knowledge_graphs/LPWP_66.ttl +52 -0
- text2model/knowledge_graphs/LPWP_85.ttl +95 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_1.ttl +34 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_18.ttl +59 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_2.ttl +43 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_28.ttl +42 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_31.ttl +44 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_4.ttl +48 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_5.ttl +40 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_6.ttl +61 -0
- text2model/knowledge_graphs/OR_LP_IP_Scheduling_problem_8.ttl +54 -0
- text2model/knowledge_graphs/combinatorial_problem_1.ttl +48 -0
- text2model/knowledge_graphs/combinatorial_problem_31.ttl +43 -0
- text2model/knowledge_graphs/combinatorial_problem_32.ttl +39 -0
- text2model/knowledge_graphs/combinatorial_problem_7.ttl +52 -0
- text2model/knowledge_graphs/complexor_AircraftAssignment.ttl +73 -0
- text2model/knowledge_graphs/complexor_AircraftLanding.ttl +53 -0
- text2model/knowledge_graphs/complexor_CFLP.ttl +43 -0
- text2model/knowledge_graphs/complexor_CapacitatedWarehouseLocation.ttl +59 -0
- text2model/knowledge_graphs/complexor_CarSelection.ttl +30 -0
- text2model/knowledge_graphs/complexor_TSP.ttl +52 -0
- text2model/knowledge_graphs/complexor_VRPTW.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_1.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_10.ttl +46 -0
- text2model/knowledge_graphs/nlp4lp_11.ttl +57 -0
- text2model/knowledge_graphs/nlp4lp_12.ttl +48 -0
- text2model/knowledge_graphs/nlp4lp_13.ttl +48 -0
- text2model/knowledge_graphs/nlp4lp_14.ttl +82 -0
- text2model/knowledge_graphs/nlp4lp_15.ttl +60 -0
- text2model/knowledge_graphs/nlp4lp_16.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_17.ttl +72 -0
- text2model/knowledge_graphs/nlp4lp_18.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_19.ttl +98 -0
- text2model/knowledge_graphs/nlp4lp_2.ttl +103 -0
- text2model/knowledge_graphs/nlp4lp_20.ttl +129 -0
- text2model/knowledge_graphs/nlp4lp_21.ttl +65 -0
- text2model/knowledge_graphs/nlp4lp_22.ttl +72 -0
- text2model/knowledge_graphs/nlp4lp_23.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_24.ttl +99 -0
- text2model/knowledge_graphs/nlp4lp_25.ttl +77 -0
- text2model/knowledge_graphs/nlp4lp_27.ttl +75 -0
- text2model/knowledge_graphs/nlp4lp_28.ttl +50 -0
- text2model/knowledge_graphs/nlp4lp_29.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_3.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_30.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_31.ttl +35 -0
- text2model/knowledge_graphs/nlp4lp_32.ttl +33 -0
- text2model/knowledge_graphs/nlp4lp_33.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_34.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_35.ttl +75 -0
- text2model/knowledge_graphs/nlp4lp_36.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_37.ttl +52 -0
- text2model/knowledge_graphs/nlp4lp_38.ttl +55 -0
- text2model/knowledge_graphs/nlp4lp_39.ttl +58 -0
- text2model/knowledge_graphs/nlp4lp_4.ttl +64 -0
- text2model/knowledge_graphs/nlp4lp_40.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_41.ttl +62 -0
- text2model/knowledge_graphs/nlp4lp_42.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_43.ttl +98 -0
- text2model/knowledge_graphs/nlp4lp_44.ttl +41 -0
- text2model/knowledge_graphs/nlp4lp_45.ttl +56 -0
- text2model/knowledge_graphs/nlp4lp_46.ttl +35 -0
- text2model/knowledge_graphs/nlp4lp_47.ttl +68 -0
- text2model/knowledge_graphs/nlp4lp_48.ttl +74 -0
- text2model/knowledge_graphs/nlp4lp_49.ttl +66 -0
- text2model/knowledge_graphs/nlp4lp_5.ttl +69 -0
- text2model/knowledge_graphs/nlp4lp_50.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_51.ttl +53 -0
- text2model/knowledge_graphs/nlp4lp_52.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_53.ttl +55 -0
- text2model/knowledge_graphs/nlp4lp_54.ttl +74 -0
- text2model/knowledge_graphs/nlp4lp_55.ttl +50 -0
- text2model/knowledge_graphs/nlp4lp_56.ttl +67 -0
- text2model/knowledge_graphs/nlp4lp_57.ttl +59 -0
- text2model/knowledge_graphs/nlp4lp_58.ttl +65 -0
- text2model/knowledge_graphs/nlp4lp_6.ttl +63 -0
- text2model/knowledge_graphs/nlp4lp_60.ttl +36 -0
- text2model/knowledge_graphs/nlp4lp_61.ttl +83 -0
- text2model/knowledge_graphs/nlp4lp_62.ttl +44 -0
- text2model/knowledge_graphs/nlp4lp_63.ttl +49 -0
- text2model/knowledge_graphs/nlp4lp_64.ttl +41 -0
- text2model/knowledge_graphs/nlp4lp_65.ttl +78 -0
- text2model/knowledge_graphs/nlp4lp_66.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_67.ttl +40 -0
- text2model/knowledge_graphs/nlp4lp_7.ttl +53 -0
- text2model/knowledge_graphs/nlp4lp_8.ttl +51 -0
- text2model/knowledge_graphs/nlp4lp_9.ttl +58 -0
- text2model/knowledge_graphs/non_linear_problem_10.ttl +57 -0
- text2model/knowledge_graphs/non_linear_problem_15.ttl +55 -0
- text2model/knowledge_graphs/non_linear_problem_23.ttl +42 -0
- text2model/knowledge_graphs/non_linear_problem_9.ttl +61 -0
- text2model/knowledge_graphs/puzzles_problem_1.ttl +64 -0
- text2model/knowledge_graphs/puzzles_problem_11.ttl +65 -0
- text2model/knowledge_graphs/puzzles_problem_12.ttl +79 -0
- text2model/knowledge_graphs/puzzles_problem_13.ttl +50 -0
- text2model/knowledge_graphs/puzzles_problem_31.ttl +62 -0
- text2model/main.py +771 -0
- text2model/prompts/assembler_prompt.txt +104 -0
- text2model/prompts/code_stitching_prompt.txt +49 -0
- text2model/prompts/code_validation_prompt.txt +36 -0
- text2model/prompts/constraint_generation_prompt.txt +35 -0
- text2model/prompts/cot_prompt.txt +45 -0
- text2model/prompts/global_constraint_prompts/all_different_prompt.txt +67 -0
- text2model/prompts/global_constraint_prompts/count_prompt.txt +75 -0
- text2model/prompts/global_constraint_prompts/cumulative_prompt.txt +88 -0
- text2model/prompts/global_constraint_prompts/global_cardinality_prompt.txt +76 -0
- text2model/prompts/global_constraint_prompts/increasing_prompt.txt +81 -0
- text2model/prompts/global_constraint_prompts/lex_less_prompt.txt +68 -0
- text2model/prompts/grammar_validation_prompt.txt +18 -0
- text2model/prompts/kg_code_generation_prompt.txt +20 -0
- text2model/prompts/kg_generation_prompt.txt +40 -0
- text2model/prompts/objective_generation_prompt.txt +34 -0
- text2model/prompts/parameter_and_variable_generation_prompt.txt +35 -0
- text2model/utils.py +350 -0
- text2model-0.1.0.dist-info/METADATA +221 -0
- text2model-0.1.0.dist-info/RECORD +135 -0
- text2model-0.1.0.dist-info/WHEEL +5 -0
- text2model-0.1.0.dist-info/entry_points.txt +2 -0
- text2model-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,67 @@
|
|
|
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:TotalPeriods a rdf:Property ;
|
|
7
|
+
rdfs:label "T" ;
|
|
8
|
+
rdfs:range xsd:integer .
|
|
9
|
+
|
|
10
|
+
opt:TotalGenerators a rdf:Property ;
|
|
11
|
+
rdfs:label "K" ;
|
|
12
|
+
rdfs:range xsd:integer .
|
|
13
|
+
|
|
14
|
+
opt:Demand a rdf:Property ;
|
|
15
|
+
rdfs:label "Demand" ;
|
|
16
|
+
rdfs:range xsd:integer .
|
|
17
|
+
|
|
18
|
+
opt:NumberGenerator a rdf:Property ;
|
|
19
|
+
rdfs:label "NumGenerator" ;
|
|
20
|
+
rdfs:range xsd:integer .
|
|
21
|
+
|
|
22
|
+
opt:MinLevel a rdf:Property ;
|
|
23
|
+
rdfs:label "MinLevel" ;
|
|
24
|
+
rdfs:range xsd:integer .
|
|
25
|
+
|
|
26
|
+
opt:MaxLevel a rdf:Property ;
|
|
27
|
+
rdfs:label "MaxLevel" ;
|
|
28
|
+
rdfs:range xsd:integer .
|
|
29
|
+
|
|
30
|
+
opt:RunCost a rdf:Property ;
|
|
31
|
+
rdfs:label "RunCost" ;
|
|
32
|
+
rdfs:range xsd:integer .
|
|
33
|
+
|
|
34
|
+
opt:ExtraCost a rdf:Property ;
|
|
35
|
+
rdfs:label "ExtraCost" ;
|
|
36
|
+
rdfs:range xsd:float .
|
|
37
|
+
|
|
38
|
+
opt:StartCost a rdf:Property ;
|
|
39
|
+
rdfs:label "StartCost" ;
|
|
40
|
+
rdfs:range xsd:integer .
|
|
41
|
+
|
|
42
|
+
opt:PowerStationOptimization a opt:OptimizationProblem ;
|
|
43
|
+
rdfs:label "Power Station Optimization" ;
|
|
44
|
+
opt:hasParameter opt:TotalPeriods, opt:TotalGenerators, opt:Demand, opt:NumberGenerator, opt:MinLevel, opt:MaxLevel, opt:RunCost, opt:ExtraCost, opt:StartCost ;
|
|
45
|
+
opt:hasVariable opt:GeneratorWorking ;
|
|
46
|
+
opt:hasConstraint opt:MeetDemand, opt:GeneratorAvailability, opt:GeneratorProductionLevel ;
|
|
47
|
+
opt:hasObjective opt:MinimizeCost .
|
|
48
|
+
|
|
49
|
+
opt:GeneratorWorking a opt:Variable ;
|
|
50
|
+
rdfs:label "GeneratorWorking" ;
|
|
51
|
+
opt:belongsTo opt:PowerStationOptimization .
|
|
52
|
+
|
|
53
|
+
opt:MeetDemand a opt:Constraint ;
|
|
54
|
+
rdfs:label "Meet Demand" ;
|
|
55
|
+
opt:belongsTo opt:PowerStationOptimization .
|
|
56
|
+
|
|
57
|
+
opt:GeneratorAvailability a opt:Constraint ;
|
|
58
|
+
rdfs:label "Generator Availability" ;
|
|
59
|
+
opt:belongsTo opt:PowerStationOptimization .
|
|
60
|
+
|
|
61
|
+
opt:GeneratorProductionLevel a opt:Constraint ;
|
|
62
|
+
rdfs:label "Generator Production Level" ;
|
|
63
|
+
opt:belongsTo opt:PowerStationOptimization .
|
|
64
|
+
|
|
65
|
+
opt:MinimizeCost a opt:Objective ;
|
|
66
|
+
rdfs:label "Minimize Cost" ;
|
|
67
|
+
opt:belongsTo opt:PowerStationOptimization .
|
|
@@ -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.example.org/optimization#> .
|
|
5
|
+
|
|
6
|
+
opt:NumProducts a rdf:Property ;
|
|
7
|
+
rdfs:label "Number of different products" ;
|
|
8
|
+
rdfs:range xsd:integer .
|
|
9
|
+
|
|
10
|
+
opt:NumMachines a rdf:Property ;
|
|
11
|
+
rdfs:label "Number of different machines or stations" ;
|
|
12
|
+
rdfs:range xsd:integer .
|
|
13
|
+
|
|
14
|
+
opt:ProduceTime a rdf:Property ;
|
|
15
|
+
rdfs:label "Time to produce one unit of product k on station s" ;
|
|
16
|
+
rdfs:range xsd:integer .
|
|
17
|
+
|
|
18
|
+
opt:AvailableTime a rdf:Property ;
|
|
19
|
+
rdfs:label "Total available time on station s" ;
|
|
20
|
+
rdfs:range xsd:integer .
|
|
21
|
+
|
|
22
|
+
opt:Profit a rdf:Property ;
|
|
23
|
+
rdfs:label "Profit from producing one unit of product k" ;
|
|
24
|
+
rdfs:range xsd:integer .
|
|
25
|
+
|
|
26
|
+
opt:Product a rdfs:Class ;
|
|
27
|
+
rdfs:label "Product" ;
|
|
28
|
+
rdfs:subClassOf rdfs:Resource .
|
|
29
|
+
|
|
30
|
+
opt:Machine a rdfs:Class ;
|
|
31
|
+
rdfs:label "Machine" ;
|
|
32
|
+
rdfs:subClassOf rdfs:Resource .
|
|
33
|
+
|
|
34
|
+
opt:Constraint a rdfs:Class ;
|
|
35
|
+
rdfs:label "Constraint" ;
|
|
36
|
+
rdfs:subClassOf rdfs:Resource .
|
|
37
|
+
|
|
38
|
+
opt:Objective a rdfs:Class ;
|
|
39
|
+
rdfs:label "Objective" ;
|
|
40
|
+
rdfs:subClassOf rdfs:Resource .
|
|
41
|
+
|
|
42
|
+
opt:hasNumProducts a rdf:Property ;
|
|
43
|
+
rdfs:label "has number of products" ;
|
|
44
|
+
rdfs:domain opt:Product ;
|
|
45
|
+
rdfs:range opt:NumProducts .
|
|
46
|
+
|
|
47
|
+
opt:hasNumMachines a rdf:Property ;
|
|
48
|
+
rdfs:label "has number of machines" ;
|
|
49
|
+
rdfs:domain opt:Machine ;
|
|
50
|
+
rdfs:range opt:NumMachines .
|
|
51
|
+
|
|
52
|
+
opt:hasProduceTime a rdf:Property ;
|
|
53
|
+
rdfs:label "has produce time" ;
|
|
54
|
+
rdfs:domain opt:Product ;
|
|
55
|
+
rdfs:range opt:ProduceTime .
|
|
56
|
+
|
|
57
|
+
opt:hasAvailableTime a rdf:Property ;
|
|
58
|
+
rdfs:label "has available time" ;
|
|
59
|
+
rdfs:domain opt:Machine ;
|
|
60
|
+
rdfs:range opt:AvailableTime .
|
|
61
|
+
|
|
62
|
+
opt:hasProfit a rdf:Property ;
|
|
63
|
+
rdfs:label "has profit" ;
|
|
64
|
+
rdfs:domain opt:Product ;
|
|
65
|
+
rdfs:range opt:Profit .
|
|
66
|
+
|
|
67
|
+
opt:hasConstraint a rdf:Property ;
|
|
68
|
+
rdfs:label "has constraint" ;
|
|
69
|
+
rdfs:domain opt:Constraint ;
|
|
70
|
+
rdfs:range rdfs:Resource .
|
|
71
|
+
|
|
72
|
+
opt:hasObjective a rdf:Property ;
|
|
73
|
+
rdfs:label "has objective" ;
|
|
74
|
+
rdfs:domain opt:Objective ;
|
|
75
|
+
rdfs:range rdfs:Resource .
|
|
@@ -0,0 +1,56 @@
|
|
|
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 knap: <http://www.example.org/knapsack#> .
|
|
5
|
+
|
|
6
|
+
knap:KnapsackProblem a rdfs:Class ;
|
|
7
|
+
rdfs:comment "The knapsack problem class" .
|
|
8
|
+
|
|
9
|
+
knap:hasCapacity a rdf:Property ;
|
|
10
|
+
rdfs:domain knap:KnapsackProblem ;
|
|
11
|
+
rdfs:range xsd:integer ;
|
|
12
|
+
rdfs:comment "Total capacity of the knapsack" .
|
|
13
|
+
|
|
14
|
+
knap:hasItem a rdf:Property ;
|
|
15
|
+
rdfs:domain knap:KnapsackProblem ;
|
|
16
|
+
rdfs:range knap:Item ;
|
|
17
|
+
rdfs:comment "Item to be packed in the knapsack" .
|
|
18
|
+
|
|
19
|
+
knap:Item a rdfs:Class ;
|
|
20
|
+
rdfs:comment "Item class" .
|
|
21
|
+
|
|
22
|
+
knap:hasValue a rdf:Property ;
|
|
23
|
+
rdfs:domain knap:Item ;
|
|
24
|
+
rdfs:range xsd:integer ;
|
|
25
|
+
rdfs:comment "Value of the item" .
|
|
26
|
+
|
|
27
|
+
knap:hasSize a rdf:Property ;
|
|
28
|
+
rdfs:domain knap:Item ;
|
|
29
|
+
rdfs:range xsd:integer ;
|
|
30
|
+
rdfs:comment "Size of the item" .
|
|
31
|
+
|
|
32
|
+
knap:hasObjective a rdf:Property ;
|
|
33
|
+
rdfs:domain knap:KnapsackProblem ;
|
|
34
|
+
rdfs:range knap:Objective ;
|
|
35
|
+
rdfs:comment "Objective of the knapsack problem" .
|
|
36
|
+
|
|
37
|
+
knap:Objective a rdfs:Class ;
|
|
38
|
+
rdfs:comment "Objective class" .
|
|
39
|
+
|
|
40
|
+
knap:isMaximization a rdf:Property ;
|
|
41
|
+
rdfs:domain knap:Objective ;
|
|
42
|
+
rdfs:range xsd:boolean ;
|
|
43
|
+
rdfs:comment "Whether the objective is to maximize the total value" .
|
|
44
|
+
|
|
45
|
+
knap:hasConstraint a rdf:Property ;
|
|
46
|
+
rdfs:domain knap:KnapsackProblem ;
|
|
47
|
+
rdfs:range knap:Constraint ;
|
|
48
|
+
rdfs:comment "Constraint of the knapsack problem" .
|
|
49
|
+
|
|
50
|
+
knap:Constraint a rdfs:Class ;
|
|
51
|
+
rdfs:comment "Constraint class" .
|
|
52
|
+
|
|
53
|
+
knap:isSizeLimit a rdf:Property ;
|
|
54
|
+
rdfs:domain knap:Constraint ;
|
|
55
|
+
rdfs:range xsd:boolean ;
|
|
56
|
+
rdfs:comment "Whether the constraint is a size limit" .
|
|
@@ -0,0 +1,52 @@
|
|
|
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 different types of food" ;
|
|
8
|
+
rdfs:range xsd:integer .
|
|
9
|
+
|
|
10
|
+
opt:M a rdf:Property ;
|
|
11
|
+
rdfs:label "Number of nutrients to consider" ;
|
|
12
|
+
rdfs:range xsd:integer .
|
|
13
|
+
|
|
14
|
+
opt:Price a rdf:Property ;
|
|
15
|
+
rdfs:label "Price of food k" ;
|
|
16
|
+
rdfs:range xsd:float .
|
|
17
|
+
|
|
18
|
+
opt:Demand a rdf:Property ;
|
|
19
|
+
rdfs:label "Demand for nutrient m" ;
|
|
20
|
+
rdfs:range xsd:float .
|
|
21
|
+
|
|
22
|
+
opt:Nutrition a rdf:Property ;
|
|
23
|
+
rdfs:label "Amount of nutrient m in food k" ;
|
|
24
|
+
rdfs:range xsd:float .
|
|
25
|
+
|
|
26
|
+
opt:OptimizationProblem a rdfs:Class ;
|
|
27
|
+
rdfs:label "Optimization Problem" .
|
|
28
|
+
|
|
29
|
+
opt:OptimizationProblem1 a opt:OptimizationProblem ;
|
|
30
|
+
opt:K "3"^^xsd:integer ;
|
|
31
|
+
opt:M "2"^^xsd:integer ;
|
|
32
|
+
opt:Price "1"^^xsd:float, "2"^^xsd:float, "3"^^xsd:float ;
|
|
33
|
+
opt:Demand "10"^^xsd:float, "20"^^xsd:float ;
|
|
34
|
+
opt:Nutrition "3"^^xsd:float, "5"^^xsd:float, "1"^^xsd:float, "3"^^xsd:float, "4"^^xsd:float, "4"^^xsd:float .
|
|
35
|
+
|
|
36
|
+
opt:Variable a rdfs:Class ;
|
|
37
|
+
rdfs:label "Variable" .
|
|
38
|
+
|
|
39
|
+
opt:Variable1 a opt:Variable ;
|
|
40
|
+
rdfs:label "Amount of each type of food to buy" .
|
|
41
|
+
|
|
42
|
+
opt:Constraint a rdfs:Class ;
|
|
43
|
+
rdfs:label "Constraint" .
|
|
44
|
+
|
|
45
|
+
opt:Constraint1 a opt:Constraint ;
|
|
46
|
+
rdfs:label "Nutritional demand must be met" .
|
|
47
|
+
|
|
48
|
+
opt:Objective a rdfs:Class ;
|
|
49
|
+
rdfs:label "Objective" .
|
|
50
|
+
|
|
51
|
+
opt:Objective1 a opt:Objective ;
|
|
52
|
+
rdfs:label "Minimize the cost of meeting all nutritional demands" .
|
|
@@ -0,0 +1,55 @@
|
|
|
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:WarehouseOperation a rdfs:Class ;
|
|
7
|
+
rdfs:label "Warehouse Operation" ;
|
|
8
|
+
rdfs:comment "The operation of a warehouse by buying and selling stock to maximize profit over a certain length of time." .
|
|
9
|
+
|
|
10
|
+
opt:TimePeriod a rdfs:Class ;
|
|
11
|
+
rdfs:label "Time Period" ;
|
|
12
|
+
rdfs:comment "A specific period of time in which the warehouse operation takes place." .
|
|
13
|
+
|
|
14
|
+
opt:TimePeriod rdfs:subClassOf opt:WarehouseOperation .
|
|
15
|
+
|
|
16
|
+
opt:hasNumber a rdf:Property ;
|
|
17
|
+
rdfs:label "has number" ;
|
|
18
|
+
rdfs:domain opt:TimePeriod ;
|
|
19
|
+
rdfs:range xsd:integer .
|
|
20
|
+
|
|
21
|
+
opt:hasCapacity a rdf:Property ;
|
|
22
|
+
rdfs:label "has capacity" ;
|
|
23
|
+
rdfs:domain opt:WarehouseOperation ;
|
|
24
|
+
rdfs:range xsd:integer .
|
|
25
|
+
|
|
26
|
+
opt:hasHoldingCost a rdf:Property ;
|
|
27
|
+
rdfs:label "has holding cost" ;
|
|
28
|
+
rdfs:domain opt:WarehouseOperation ;
|
|
29
|
+
rdfs:range xsd:integer .
|
|
30
|
+
|
|
31
|
+
opt:hasPrice a rdf:Property ;
|
|
32
|
+
rdfs:label "has price" ;
|
|
33
|
+
rdfs:domain opt:TimePeriod ;
|
|
34
|
+
rdfs:range xsd:integer .
|
|
35
|
+
|
|
36
|
+
opt:hasCost a rdf:Property ;
|
|
37
|
+
rdfs:label "has cost" ;
|
|
38
|
+
rdfs:domain opt:TimePeriod ;
|
|
39
|
+
rdfs:range xsd:integer .
|
|
40
|
+
|
|
41
|
+
opt:MaximizeProfit a rdfs:Class ;
|
|
42
|
+
rdfs:label "Maximize Profit" ;
|
|
43
|
+
rdfs:comment "The objective of the warehouse operation is to maximize profit." .
|
|
44
|
+
|
|
45
|
+
opt:MaximizeProfit rdfs:subClassOf opt:WarehouseOperation .
|
|
46
|
+
|
|
47
|
+
opt:hasConstraint a rdf:Property ;
|
|
48
|
+
rdfs:label "has constraint" ;
|
|
49
|
+
rdfs:domain opt:WarehouseOperation ;
|
|
50
|
+
rdfs:range rdfs:Literal .
|
|
51
|
+
|
|
52
|
+
opt:hasObjective a rdf:Property ;
|
|
53
|
+
rdfs:label "has objective" ;
|
|
54
|
+
rdfs:domain opt:WarehouseOperation ;
|
|
55
|
+
rdfs:range opt:MaximizeProfit .
|
|
@@ -0,0 +1,58 @@
|
|
|
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, :M, :AlloyQuantity, :Target, :Ratio, :Price ;
|
|
8
|
+
opt:hasVariable :AlloyCombination ;
|
|
9
|
+
opt:hasConstraint :AlloyCompositionConstraint, :AlloyQuantityConstraint ;
|
|
10
|
+
opt:hasObjective :MinimizeCost .
|
|
11
|
+
|
|
12
|
+
:K a opt:Parameter ;
|
|
13
|
+
rdfs:label "Number of Alloys" ;
|
|
14
|
+
rdfs:comment "The total number of available alloys." ;
|
|
15
|
+
rdfs:range xsd:integer .
|
|
16
|
+
|
|
17
|
+
:M a opt:Parameter ;
|
|
18
|
+
rdfs:label "Number of Metals" ;
|
|
19
|
+
rdfs:comment "The total number of different types of metals." ;
|
|
20
|
+
rdfs:range xsd:integer .
|
|
21
|
+
|
|
22
|
+
:AlloyQuantity a opt:Parameter ;
|
|
23
|
+
rdfs:label "Quantity of alloy to produce" ;
|
|
24
|
+
rdfs:comment "The total quantity of alloy that needs to be produced." ;
|
|
25
|
+
rdfs:range xsd:float .
|
|
26
|
+
|
|
27
|
+
:Target a opt:Parameter ;
|
|
28
|
+
rdfs:label "Quantity of target components in the alloy" ;
|
|
29
|
+
rdfs:comment "The target quantity of each type of metal in the alloy." ;
|
|
30
|
+
rdfs:range xsd:float .
|
|
31
|
+
|
|
32
|
+
:Ratio a opt:Parameter ;
|
|
33
|
+
rdfs:label "Ratio of each component k in the alloy m" ;
|
|
34
|
+
rdfs:comment "The ratio of each metal in the available alloys." ;
|
|
35
|
+
rdfs:range xsd:float .
|
|
36
|
+
|
|
37
|
+
:Price a opt:Parameter ;
|
|
38
|
+
rdfs:label "Price of each alloy k" ;
|
|
39
|
+
rdfs:comment "The price at which each alloy is sold per unit." ;
|
|
40
|
+
rdfs:range xsd:float .
|
|
41
|
+
|
|
42
|
+
:AlloyCombination a opt:Variable ;
|
|
43
|
+
rdfs:label "Combination of alloys" ;
|
|
44
|
+
rdfs:comment "The combination of quantities of alloys that reaches the target quantity of each type of metal." ;
|
|
45
|
+
rdfs:range xsd:float .
|
|
46
|
+
|
|
47
|
+
:AlloyCompositionConstraint a opt:Constraint ;
|
|
48
|
+
rdfs:label "Alloy composition constraint" ;
|
|
49
|
+
rdfs:comment "The combination of alloys must meet the target quantity of each type of metal." .
|
|
50
|
+
|
|
51
|
+
:AlloyQuantityConstraint a opt:Constraint ;
|
|
52
|
+
rdfs:label "Alloy quantity constraint" ;
|
|
53
|
+
rdfs:comment "The total quantity of alloy produced must meet the required quantity." .
|
|
54
|
+
|
|
55
|
+
:MinimizeCost a opt:Objective ;
|
|
56
|
+
rdfs:label "Minimize cost" ;
|
|
57
|
+
rdfs:comment "The objective is to find the cheapest combination of quantities of alloys." ;
|
|
58
|
+
opt:isTypeOf opt:Minimization .
|
|
@@ -0,0 +1,64 @@
|
|
|
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:Period rdf:type rdfs:Class ;
|
|
7
|
+
rdfs:label "Period" ;
|
|
8
|
+
rdfs:comment "The planning period for nurse staffing" ;
|
|
9
|
+
rdfs:range xsd:integer .
|
|
10
|
+
|
|
11
|
+
opt:Demand rdf:type rdfs:Class ;
|
|
12
|
+
rdfs:label "Demand" ;
|
|
13
|
+
rdfs:comment "Array of demands for nurses for 7 days" ;
|
|
14
|
+
rdfs:range xsd:integer .
|
|
15
|
+
|
|
16
|
+
opt:Nurse rdf:type rdfs:Class ;
|
|
17
|
+
rdfs:label "Nurse" ;
|
|
18
|
+
rdfs:comment "Nurse to be scheduled for night shift" .
|
|
19
|
+
|
|
20
|
+
opt:WorkDays rdf:type rdf:Property ;
|
|
21
|
+
rdfs:label "WorkDays" ;
|
|
22
|
+
rdfs:comment "Number of days a nurse works in a row on the night shift" ;
|
|
23
|
+
rdfs:domain opt:Nurse ;
|
|
24
|
+
rdfs:range xsd:integer .
|
|
25
|
+
|
|
26
|
+
opt:OffDays rdf:type rdf:Property ;
|
|
27
|
+
rdfs:label "OffDays" ;
|
|
28
|
+
rdfs:comment "Number of days a nurse has off after working" ;
|
|
29
|
+
rdfs:domain opt:Nurse ;
|
|
30
|
+
rdfs:range xsd:integer .
|
|
31
|
+
|
|
32
|
+
opt:hasDemand rdf:type rdf:Property ;
|
|
33
|
+
rdfs:label "hasDemand" ;
|
|
34
|
+
rdfs:comment "The demand for nurses on a particular day" ;
|
|
35
|
+
rdfs:domain opt:Period ;
|
|
36
|
+
rdfs:range opt:Demand .
|
|
37
|
+
|
|
38
|
+
opt:hasNurse rdf:type rdf:Property ;
|
|
39
|
+
rdfs:label "hasNurse" ;
|
|
40
|
+
rdfs:comment "The nurse assigned to a particular period" ;
|
|
41
|
+
rdfs:domain opt:Period ;
|
|
42
|
+
rdfs:range opt:Nurse .
|
|
43
|
+
|
|
44
|
+
opt:MinimizeNurses rdf:type opt:OptimizationProblem ;
|
|
45
|
+
rdfs:label "MinimizeNurses" ;
|
|
46
|
+
rdfs:comment "Minimize the number of nurses needed to meet demand" ;
|
|
47
|
+
opt:hasObjectiveFunction opt:MinimizeNursesObjectiveFunction ;
|
|
48
|
+
opt:hasConstraint opt:WorkDaysConstraint, opt:OffDaysConstraint .
|
|
49
|
+
|
|
50
|
+
opt:MinimizeNursesObjectiveFunction rdf:type opt:ObjectiveFunction ;
|
|
51
|
+
rdfs:label "MinimizeNursesObjectiveFunction" ;
|
|
52
|
+
rdfs:comment "Objective function to minimize the number of nurses" ;
|
|
53
|
+
opt:hasVariable opt:Nurse ;
|
|
54
|
+
opt:isMinimization true .
|
|
55
|
+
|
|
56
|
+
opt:WorkDaysConstraint rdf:type opt:Constraint ;
|
|
57
|
+
rdfs:label "WorkDaysConstraint" ;
|
|
58
|
+
rdfs:comment "Constraint that a nurse works x number of days in a row" ;
|
|
59
|
+
opt:hasVariable opt:WorkDays .
|
|
60
|
+
|
|
61
|
+
opt:OffDaysConstraint rdf:type opt:Constraint ;
|
|
62
|
+
rdfs:label "OffDaysConstraint" ;
|
|
63
|
+
rdfs:comment "Constraint that a nurse has 7 - x days off after working" ;
|
|
64
|
+
opt:hasVariable opt:OffDays .
|
|
@@ -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 different spare parts" ;
|
|
8
|
+
rdfs:range xsd:integer .
|
|
9
|
+
|
|
10
|
+
opt:S a rdf:Property ;
|
|
11
|
+
rdfs:label "Number of machines capable of making the spare parts" ;
|
|
12
|
+
rdfs:range xsd:integer .
|
|
13
|
+
|
|
14
|
+
opt:Time a rdf:Property ;
|
|
15
|
+
rdfs:label "Time taken to make spare part k on machine s" ;
|
|
16
|
+
rdfs:range rdf:Seq .
|
|
17
|
+
|
|
18
|
+
opt:Profit a rdf:Property ;
|
|
19
|
+
rdfs:label "Profit obtained from making spare part k" ;
|
|
20
|
+
rdfs:range rdf:Seq .
|
|
21
|
+
|
|
22
|
+
opt:Capacity a rdf:Property ;
|
|
23
|
+
rdfs:label "Capacity of machine s for the spare parts" ;
|
|
24
|
+
rdfs:range rdf:Seq .
|
|
25
|
+
|
|
26
|
+
opt:Problem a rdfs:Class ;
|
|
27
|
+
rdfs:label "Optimization Problem" ;
|
|
28
|
+
rdfs:subClassOf opt:Optimization .
|
|
29
|
+
|
|
30
|
+
opt:ProblemInstance a opt:Problem ;
|
|
31
|
+
opt:K "5"^^xsd:integer ;
|
|
32
|
+
opt:S "2"^^xsd:integer ;
|
|
33
|
+
opt:Time (2 3 1 2 3 2 3 1 1 1) ;
|
|
34
|
+
opt:Profit (30 20 40 25 10) ;
|
|
35
|
+
opt:Capacity (700 1000) .
|
|
36
|
+
|
|
37
|
+
opt:Constraint a rdfs:Class ;
|
|
38
|
+
rdfs:label "Constraint" ;
|
|
39
|
+
rdfs:subClassOf opt:Optimization .
|
|
40
|
+
|
|
41
|
+
opt:ConstraintInstance a opt:Constraint ;
|
|
42
|
+
rdfs:comment "Each shop has a capacity of working hours it cannot exceed" .
|
|
43
|
+
|
|
44
|
+
opt:Objective a rdfs:Class ;
|
|
45
|
+
rdfs:label "Objective" ;
|
|
46
|
+
rdfs:subClassOf opt:Optimization .
|
|
47
|
+
|
|
48
|
+
opt:ObjectiveInstance a opt:Objective ;
|
|
49
|
+
rdfs:comment "Determine the quantities of each spare part to be made during the month to maximize profit" .
|
|
@@ -0,0 +1,62 @@
|
|
|
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:Product a rdfs:Class ;
|
|
7
|
+
rdfs:label "Product" ;
|
|
8
|
+
rdfs:comment "A type of product produced by the company" .
|
|
9
|
+
|
|
10
|
+
opt:ProductDemand a rdfs:Property ;
|
|
11
|
+
rdfs:label "Product Demand" ;
|
|
12
|
+
rdfs:comment "The demand of a product" ;
|
|
13
|
+
rdfs:domain opt:Product ;
|
|
14
|
+
rdfs:range xsd:float .
|
|
15
|
+
|
|
16
|
+
opt:MaxRegularAmount a rdfs:Property ;
|
|
17
|
+
rdfs:label "Maximum Regular Production Amount" ;
|
|
18
|
+
rdfs:comment "Maximum production amount under regular conditions" ;
|
|
19
|
+
rdfs:range xsd:float .
|
|
20
|
+
|
|
21
|
+
opt:CostRegular a rdfs:Property ;
|
|
22
|
+
rdfs:label "Regular Production Cost" ;
|
|
23
|
+
rdfs:comment "Cost of production under regular conditions per unit" ;
|
|
24
|
+
rdfs:range xsd:float .
|
|
25
|
+
|
|
26
|
+
opt:CostOvertime a rdfs:Property ;
|
|
27
|
+
rdfs:label "Overtime Production Cost" ;
|
|
28
|
+
rdfs:comment "Cost of production under overtime conditions per unit" ;
|
|
29
|
+
rdfs:range xsd:float .
|
|
30
|
+
|
|
31
|
+
opt:StoreCost a rdfs:Property ;
|
|
32
|
+
rdfs:label "Storage Cost" ;
|
|
33
|
+
rdfs:comment "Cost to store one unit of product" ;
|
|
34
|
+
rdfs:range xsd:float .
|
|
35
|
+
|
|
36
|
+
opt:ProductionSchedule a rdfs:Class ;
|
|
37
|
+
rdfs:label "Production Schedule" ;
|
|
38
|
+
rdfs:comment "The production schedule that minimizes the cost" .
|
|
39
|
+
|
|
40
|
+
opt:hasProduct a rdfs:Property ;
|
|
41
|
+
rdfs:label "has product" ;
|
|
42
|
+
rdfs:comment "The production schedule has a product" ;
|
|
43
|
+
rdfs:domain opt:ProductionSchedule ;
|
|
44
|
+
rdfs:range opt:Product .
|
|
45
|
+
|
|
46
|
+
opt:hasCost a rdfs:Property ;
|
|
47
|
+
rdfs:label "has cost" ;
|
|
48
|
+
rdfs:comment "The production schedule has a cost" ;
|
|
49
|
+
rdfs:domain opt:ProductionSchedule ;
|
|
50
|
+
rdfs:range xsd:float .
|
|
51
|
+
|
|
52
|
+
opt:hasObjective a rdfs:Property ;
|
|
53
|
+
rdfs:label "has objective" ;
|
|
54
|
+
rdfs:comment "The optimization problem has an objective" ;
|
|
55
|
+
rdfs:domain opt:ProductionSchedule ;
|
|
56
|
+
rdfs:range rdfs:Literal .
|
|
57
|
+
|
|
58
|
+
opt:hasConstraint a rdfs:Property ;
|
|
59
|
+
rdfs:label "has constraint" ;
|
|
60
|
+
rdfs:comment "The optimization problem has a constraint" ;
|
|
61
|
+
rdfs:domain opt:ProductionSchedule ;
|
|
62
|
+
rdfs:range rdfs:Literal .
|
|
@@ -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:CafeteriaStaffingProblem a opt:OptimizationProblem ;
|
|
7
|
+
rdfs:label "Cafeteria Staffing Problem" ;
|
|
8
|
+
opt:hasParameter opt:N, opt:Num, opt:WorkingDays, opt:RestingDays ;
|
|
9
|
+
opt:hasVariable opt:Employees ;
|
|
10
|
+
opt:hasConstraint opt:WorkRestCycle ;
|
|
11
|
+
opt:hasObjective opt:MinimizeEmployees .
|
|
12
|
+
|
|
13
|
+
opt:N a opt:Parameter ;
|
|
14
|
+
rdfs:label "Number of days in recurring period" ;
|
|
15
|
+
rdfs:comment "N represents the number of days in the recurring period." ;
|
|
16
|
+
rdfs:range xsd:integer .
|
|
17
|
+
|
|
18
|
+
opt:Num a opt:Parameter ;
|
|
19
|
+
rdfs:label "Number of users on the nth day" ;
|
|
20
|
+
rdfs:comment "Num represents the number of users on the nth day." ;
|
|
21
|
+
rdfs:range xsd:integer .
|
|
22
|
+
|
|
23
|
+
opt:WorkingDays a opt:Parameter ;
|
|
24
|
+
rdfs:label "Number of consecutive working days before a resting period" ;
|
|
25
|
+
rdfs:comment "WorkingDays represents the number of consecutive working days before a resting period." ;
|
|
26
|
+
rdfs:range xsd:integer .
|
|
27
|
+
|
|
28
|
+
opt:RestingDays a opt:Parameter ;
|
|
29
|
+
rdfs:label "Number of consecutive resting days" ;
|
|
30
|
+
rdfs:comment "RestingDays represents the number of consecutive resting days." ;
|
|
31
|
+
rdfs:range xsd:integer .
|
|
32
|
+
|
|
33
|
+
opt:Employees a opt:Variable ;
|
|
34
|
+
rdfs:label "Number of employees to hire" ;
|
|
35
|
+
rdfs:comment "Employees represents the number of employees to hire." ;
|
|
36
|
+
rdfs:range xsd:integer .
|
|
37
|
+
|
|
38
|
+
opt:WorkRestCycle a opt:Constraint ;
|
|
39
|
+
rdfs:label "Work-rest cycle constraint" ;
|
|
40
|
+
rdfs:comment "WorkRestCycle ensures that each employee works a fixed number of days in a row followed by a fixed number of days off." .
|
|
41
|
+
|
|
42
|
+
opt:MinimizeEmployees a opt:Objective ;
|
|
43
|
+
rdfs:label "Minimize number of employees" ;
|
|
44
|
+
rdfs:comment "MinimizeEmployees is the objective to minimize the number of employees to hire." ;
|
|
45
|
+
opt:optimizationType opt:Minimization .
|
|
46
|
+
|
|
47
|
+
opt:Minimization a opt:OptimizationType ;
|
|
48
|
+
rdfs:label "Minimization" ;
|
|
49
|
+
rdfs:comment "Minimization is the type of optimization." .
|