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,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:ConcertProblem a opt:OptimizationProblem ;
7
+ opt:hasParameter opt:num_pieces, opt:num_players, opt:duration, opt:rehearsal ;
8
+ opt:hasVariable opt:order ;
9
+ opt:hasConstraint opt:arrivalConstraint, opt:departureConstraint ;
10
+ opt:hasObjective opt:minimizeWaitingTime .
11
+
12
+ opt:num_pieces a opt:Parameter ;
13
+ rdfs:label "num_pieces" ;
14
+ rdfs:comment "Number of pieces of music for the concert" ;
15
+ rdfs:range xsd:integer .
16
+
17
+ opt:num_players a opt:Parameter ;
18
+ rdfs:label "num_players" ;
19
+ rdfs:comment "Number of players in the orchestra" ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:duration a opt:Parameter ;
23
+ rdfs:label "duration" ;
24
+ rdfs:comment "Array containing the duration of each piece" ;
25
+ rdfs:range xsd:array .
26
+
27
+ opt:rehearsal a opt:Parameter ;
28
+ rdfs:label "rehearsal" ;
29
+ rdfs:comment "Array representing players' availability for each piece" ;
30
+ rdfs:range xsd:array .
31
+
32
+ opt:order a opt:Variable ;
33
+ rdfs:label "order" ;
34
+ rdfs:comment "Order in which the pieces can be rehearsed" ;
35
+ rdfs:range xsd:array .
36
+
37
+ opt:arrivalConstraint a opt:Constraint ;
38
+ rdfs:label "arrivalConstraint" ;
39
+ rdfs:comment "Players can arrive at rehearsals immediately before the first piece in which they are involved" .
40
+
41
+ opt:departureConstraint a opt:Constraint ;
42
+ rdfs:label "departureConstraint" ;
43
+ rdfs:comment "Players can depart immediately after the last piece in which they are involved" .
44
+
45
+ opt:minimizeWaitingTime a opt:Objective ;
46
+ rdfs:label "minimizeWaitingTime" ;
47
+ rdfs:comment "Minimize the total time that players are waiting to play" ;
48
+ opt:optimizationType opt:Minimization .
49
+
50
+ opt:Minimization a opt:OptimizationType ;
51
+ rdfs:label "Minimization" .
@@ -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 nqueens: <http://www.semanticweb.org/nqueens#> .
5
+
6
+ nqueens:Chessboard a rdfs:Class ;
7
+ rdfs:label "Chessboard" ;
8
+ rdfs:comment "A chessboard for the N-Queens problem" .
9
+
10
+ nqueens:Queen a rdfs:Class ;
11
+ rdfs:label "Queen" ;
12
+ rdfs:comment "A queen in the N-Queens problem" .
13
+
14
+ nqueens:size a rdf:Property ;
15
+ rdfs:label "size" ;
16
+ rdfs:comment "Size of the chessboard and the number of queens to be placed" ;
17
+ rdfs:domain nqueens:Chessboard ;
18
+ rdfs:range xsd:integer .
19
+
20
+ nqueens:position a rdf:Property ;
21
+ rdfs:label "position" ;
22
+ rdfs:comment "Position of a queen on the chessboard" ;
23
+ rdfs:domain nqueens:Queen ;
24
+ rdfs:range xsd:integer .
25
+
26
+ nqueens:placedOn a rdf:Property ;
27
+ rdfs:label "placed on" ;
28
+ rdfs:comment "Indicates the chessboard a queen is placed on" ;
29
+ rdfs:domain nqueens:Queen ;
30
+ rdfs:range nqueens:Chessboard .
31
+
32
+ nqueens:NoTwoQueensCanAttackEachOther a rdfs:Class ;
33
+ rdfs:label "No two queens can attack each other" ;
34
+ rdfs:comment "Constraint that no two queens can attack each other" .
35
+
36
+ nqueens:hasConstraint a rdf:Property ;
37
+ rdfs:label "has constraint" ;
38
+ rdfs:comment "Indicates a constraint of the N-Queens problem" ;
39
+ rdfs:domain nqueens:Chessboard ;
40
+ rdfs:range nqueens:NoTwoQueensCanAttackEachOther .
41
+
42
+ nqueens:FindPositionsForQueens a rdfs:Class ;
43
+ rdfs:label "Find positions for queens" ;
44
+ rdfs:comment "Objective to find positions for queens where they do not attack each other" .
45
+
46
+ nqueens:hasObjective a rdf:Property ;
47
+ rdfs:label "has objective" ;
48
+ rdfs:comment "Indicates the objective of the N-Queens problem" ;
49
+ rdfs:domain nqueens:Chessboard ;
50
+ rdfs:range nqueens:FindPositionsForQueens .
@@ -0,0 +1,36 @@
1
+ @prefix : <http://www.semanticweb.org/ontologies/golomb-ruler#> .
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 xsd: <http://www.w3.org/2001/XMLSchema#> .
5
+
6
+ :GolombRuler a rdfs:Class ;
7
+ rdfs:label "Golomb Ruler" ;
8
+ rdfs:comment "A set of m integers 0 = a_1 < a_2 < ... < a_m such that the m(m-1)/2 differences a_j - a_i, 1 <= i < j <= m are distinct." .
9
+
10
+ :m a rdf:Property ;
11
+ rdfs:label "Number of marks" ;
12
+ rdfs:comment "Number of marks on the Golomb ruler" ;
13
+ rdfs:domain :GolombRuler ;
14
+ rdfs:range xsd:integer .
15
+
16
+ :a a rdf:Property ;
17
+ rdfs:label "Mark positions" ;
18
+ rdfs:comment "Positions of the marks on the Golomb ruler" ;
19
+ rdfs:domain :GolombRuler ;
20
+ rdfs:range xsd:integer .
21
+
22
+ :OptimizationProblem a rdfs:Class ;
23
+ rdfs:label "Optimization Problem" ;
24
+ rdfs:comment "The objective is to find the optimal or near optimal Golomb ruler of minimum length." .
25
+
26
+ :objective a rdf:Property ;
27
+ rdfs:label "Objective" ;
28
+ rdfs:comment "Find the length of the smallest Golomb ruler with m marks" ;
29
+ rdfs:domain :OptimizationProblem ;
30
+ rdfs:range xsd:integer .
31
+
32
+ :constraint a rdf:Property ;
33
+ rdfs:label "Constraint" ;
34
+ rdfs:comment "Symmetry can be removed by adding the constraint that a_2 - a_1 < a_m - a_{m-1} where the first difference is less than the last." ;
35
+ rdfs:domain :OptimizationProblem ;
36
+ rdfs:range xsd:string .
@@ -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:deck_width a rdf:Property ;
7
+ rdfs:domain opt:Deck ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:deck_length a rdf:Property ;
11
+ rdfs:domain opt:Deck ;
12
+ rdfs:range xsd:integer .
13
+
14
+ opt:n_containers a rdf:Property ;
15
+ rdfs:domain opt:Container ;
16
+ rdfs:range xsd:integer .
17
+
18
+ opt:n_classes a rdf:Property ;
19
+ rdfs:domain opt:Container ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:width a rdf:Property ;
23
+ rdfs:domain opt:Container ;
24
+ rdfs:range xsd:integer .
25
+
26
+ opt:length a rdf:Property ;
27
+ rdfs:domain opt:Container ;
28
+ rdfs:range xsd:integer .
29
+
30
+ opt:class a rdf:Property ;
31
+ rdfs:domain opt:Container ;
32
+ rdfs:range xsd:integer .
33
+
34
+ opt:separation a rdf:Property ;
35
+ rdfs:domain opt:Container ;
36
+ rdfs:range xsd:integer .
37
+
38
+ opt:Deck a rdfs:Class ;
39
+ rdfs:subClassOf opt:OptimizationProblem .
40
+
41
+ opt:Container a rdfs:Class ;
42
+ rdfs:subClassOf opt:OptimizationProblem .
43
+
44
+ opt:OptimizationProblem a rdfs:Class ;
45
+ rdfs:comment "An optimization problem involves determining the best solution from a set of feasible solutions." .
46
+
47
+ opt:Constraint a rdfs:Class ;
48
+ rdfs:subClassOf opt:OptimizationProblem ;
49
+ rdfs:comment "Constraints are the conditions that must be met in an optimization problem." .
50
+
51
+ opt:Objective a rdfs:Class ;
52
+ rdfs:subClassOf opt:OptimizationProblem ;
53
+ rdfs:comment "The objective is the goal of the optimization problem, which is to determine whether a given set of containers can be positioned on a given deck, without overlapping, and without violating any of the separation constraints." .
@@ -0,0 +1,79 @@
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 : <http://example.org/> .
5
+
6
+ :LiquidSanitizers a rdf:Property ;
7
+ rdfs:label "Number of liquid hand sanitizers to produce" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ :FoamSanitizers a rdf:Property ;
11
+ rdfs:label "Number of foam hand sanitizers to produce" ;
12
+ rdfs:range xsd:integer .
13
+
14
+ :WaterPerLiquid a rdf:Property ;
15
+ rdfs:label "Water required per liquid sanitizer" ;
16
+ rdfs:range xsd:integer .
17
+
18
+ :AlcoholPerLiquid a rdf:Property ;
19
+ rdfs:label "Alcohol required per liquid sanitizer" ;
20
+ rdfs:range xsd:integer .
21
+
22
+ :WaterPerFoam a rdf:Property ;
23
+ rdfs:label "Water required per foam sanitizer" ;
24
+ rdfs:range xsd:integer .
25
+
26
+ :AlcoholPerFoam a rdf:Property ;
27
+ rdfs:label "Alcohol required per foam sanitizer" ;
28
+ rdfs:range xsd:integer .
29
+
30
+ :TotalWater a rdf:Property ;
31
+ rdfs:label "Total available water" ;
32
+ rdfs:range xsd:integer .
33
+
34
+ :TotalAlcohol a rdf:Property ;
35
+ rdfs:label "Total available alcohol" ;
36
+ rdfs:range xsd:integer .
37
+
38
+ :HandsPerLiquid a rdf:Property ;
39
+ rdfs:label "Cleaning capacity per liquid sanitizer" ;
40
+ rdfs:range xsd:integer .
41
+
42
+ :HandsPerFoam a rdf:Property ;
43
+ rdfs:label "Cleaning capacity per foam sanitizer" ;
44
+ rdfs:range xsd:integer .
45
+
46
+ :MaxLiquid a rdf:Property ;
47
+ rdfs:label "Maximum number of liquid sanitizers" ;
48
+ rdfs:range xsd:integer .
49
+
50
+ :SanitizerProduction a rdf:Class ;
51
+ rdfs:label "Sanitizer Production" ;
52
+ rdfs:subClassOf [
53
+ a owl:Restriction ;
54
+ owl:onProperty :LiquidSanitizers ;
55
+ owl:maxCardinality "MaxLiquid"^^xsd:integer
56
+ ] ;
57
+ rdfs:subClassOf [
58
+ a owl:Restriction ;
59
+ owl:onProperty :FoamSanitizers ;
60
+ owl:minCardinality "LiquidSanitizers"^^xsd:integer
61
+ ] ;
62
+ rdfs:subClassOf [
63
+ a owl:Restriction ;
64
+ owl:onProperty :TotalWater ;
65
+ owl:maxCardinality "WaterPerLiquid*LiquidSanitizers + WaterPerFoam*FoamSanitizers"^^xsd:integer
66
+ ] ;
67
+ rdfs:subClassOf [
68
+ a owl:Restriction ;
69
+ owl:onProperty :TotalAlcohol ;
70
+ owl:maxCardinality "AlcoholPerLiquid*LiquidSanitizers + AlcoholPerFoam*FoamSanitizers"^^xsd:integer
71
+ ] .
72
+
73
+ :Objective a rdf:Class ;
74
+ rdfs:label "Objective" ;
75
+ rdfs:subClassOf [
76
+ a owl:Restriction ;
77
+ owl:onProperty :HandsPerLiquid ;
78
+ owl:maxCardinality "LiquidSanitizers*HandsPerLiquid + FoamSanitizers*HandsPerFoam"^^xsd:integer
79
+ ] .
@@ -0,0 +1,95 @@
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:CircularTables a rdf:Property ;
7
+ rdfs:label "Number of circular tables to set up" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ opt:RectangularTables a rdf:Property ;
11
+ rdfs:label "Number of rectangular tables to set up" ;
12
+ rdfs:range xsd:integer .
13
+
14
+ opt:ParticipantsPerCircular a rdf:Property ;
15
+ rdfs:label "Participants per circular table" ;
16
+ rdfs:range xsd:integer .
17
+
18
+ opt:ParticipantsPerRectangular a rdf:Property ;
19
+ rdfs:label "Participants per rectangular table" ;
20
+ rdfs:range xsd:integer .
21
+
22
+ opt:BoardsPerCircular a rdf:Property ;
23
+ rdfs:label "Poster boards per circular table" ;
24
+ rdfs:range xsd:integer .
25
+
26
+ opt:BoardsPerRectangular a rdf:Property ;
27
+ rdfs:label "Poster boards per rectangular table" ;
28
+ rdfs:range xsd:integer .
29
+
30
+ opt:GuestsPerCircular a rdf:Property ;
31
+ rdfs:label "Guests per circular table" ;
32
+ rdfs:range xsd:integer .
33
+
34
+ opt:GuestsPerRectangular a rdf:Property ;
35
+ rdfs:label "Guests per rectangular table" ;
36
+ rdfs:range xsd:integer .
37
+
38
+ opt:SpacePerCircular a rdf:Property ;
39
+ rdfs:label "Space required per circular table" ;
40
+ rdfs:range xsd:integer .
41
+
42
+ opt:SpacePerRectangular a rdf:Property ;
43
+ rdfs:label "Space required per rectangular table" ;
44
+ rdfs:range xsd:integer .
45
+
46
+ opt:TotalSpace a rdf:Property ;
47
+ rdfs:label "Total available space" ;
48
+ rdfs:range xsd:integer .
49
+
50
+ opt:MinParticipants a rdf:Property ;
51
+ rdfs:label "Minimum number of participants required" ;
52
+ rdfs:range xsd:integer .
53
+
54
+ opt:MinBoards a rdf:Property ;
55
+ rdfs:label "Minimum number of poster boards required" ;
56
+ rdfs:range xsd:integer .
57
+
58
+ opt:ScienceFair a rdfs:Class ;
59
+ rdfs:label "Science Fair" ;
60
+ rdfs:subClassOf rdfs:Resource .
61
+
62
+ opt:ScienceFair rdfs:subClassOf [
63
+ a rdf:Property ;
64
+ rdfs:label "has constraints" ;
65
+ rdf:subject opt:ScienceFair ;
66
+ rdf:object [
67
+ a rdf:Bag ;
68
+ rdf:_1 [
69
+ a opt:Constraint ;
70
+ rdfs:label "Space constraint" ;
71
+ opt:formula "CircularTables*SpacePerCircular + RectangularTables*SpacePerRectangular <= TotalSpace"
72
+ ] ;
73
+ rdf:_2 [
74
+ a opt:Constraint ;
75
+ rdfs:label "Participants constraint" ;
76
+ opt:formula "CircularTables*ParticipantsPerCircular + RectangularTables*ParticipantsPerRectangular >= MinParticipants"
77
+ ] ;
78
+ rdf:_3 [
79
+ a opt:Constraint ;
80
+ rdfs:label "Poster boards constraint" ;
81
+ opt:formula "CircularTables*BoardsPerCircular + RectangularTables*BoardsPerRectangular >= MinBoards"
82
+ ]
83
+ ]
84
+ ] .
85
+
86
+ opt:ScienceFair rdfs:subClassOf [
87
+ a rdf:Property ;
88
+ rdfs:label "has objective" ;
89
+ rdf:subject opt:ScienceFair ;
90
+ rdf:object [
91
+ a opt:Objective ;
92
+ rdfs:label "Maximize guests" ;
93
+ opt:formula "Maximize CircularTables*GuestsPerCircular + RectangularTables*GuestsPerRectangular"
94
+ ]
95
+ ] .
@@ -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 coin: <http://www.example.com/coin_plating#> .
5
+
6
+ coin:ProcessA a rdf:Property ;
7
+ rdfs:range xsd:integer ;
8
+ rdfs:domain coin:CoinPlating .
9
+
10
+ coin:ProcessB a rdf:Property ;
11
+ rdfs:range xsd:integer ;
12
+ rdfs:domain coin:CoinPlating .
13
+
14
+ coin:GoldPerA a rdf:Property ;
15
+ rdfs:range xsd:integer ;
16
+ rdfs:domain coin:CoinPlating .
17
+
18
+ coin:WiresPerA a rdf:Property ;
19
+ rdfs:range xsd:integer ;
20
+ rdfs:domain coin:CoinPlating .
21
+
22
+ coin:CoinsPerA a rdf:Property ;
23
+ rdfs:range xsd:integer ;
24
+ rdfs:domain coin:CoinPlating .
25
+
26
+ coin:GoldPerB a rdf:Property ;
27
+ rdfs:range xsd:integer ;
28
+ rdfs:domain coin:CoinPlating .
29
+
30
+ coin:WiresPerB a rdf:Property ;
31
+ rdfs:range xsd:integer ;
32
+ rdfs:domain coin:CoinPlating .
33
+
34
+ coin:CoinsPerB a rdf:Property ;
35
+ rdfs:range xsd:integer ;
36
+ rdfs:domain coin:CoinPlating .
37
+
38
+ coin:TotalGold a rdf:Property ;
39
+ rdfs:range xsd:integer ;
40
+ rdfs:domain coin:CoinPlating .
41
+
42
+ coin:TotalWires a rdf:Property ;
43
+ rdfs:range xsd:integer ;
44
+ rdfs:domain coin:CoinPlating .
45
+
46
+ coin:CoinPlating a rdfs:Class ;
47
+ rdfs:label "Coin Plating Operation" ;
48
+ rdfs:comment "An operation that involves two processes (A and B) to plate coins using gold and wires." .
49
+
50
+ coin:Constraint a rdfs:Class ;
51
+ rdfs:subClassOf coin:CoinPlating ;
52
+ rdfs:label "Constraints" ;
53
+ rdfs:comment "Constraints for the coin plating operation, including the total available gold and wires." .
54
+
55
+ coin:Objective a rdfs:Class ;
56
+ rdfs:subClassOf coin:CoinPlating ;
57
+ rdfs:label "Objective" ;
58
+ rdfs:comment "Objective of the coin plating operation, which is to maximize the total number of coins plated." .
@@ -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 bakery: <http://www.example.com/bakery#> .
5
+
6
+ bakery:AlmondCroissants rdf:type rdfs:Class ;
7
+ rdfs:label "Number of almond croissants to be produced" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ bakery:PistachioCroissants rdf:type rdfs:Class ;
11
+ rdfs:label "Number of pistachio croissants to be produced" ;
12
+ rdfs:range xsd:integer .
13
+
14
+ bakery:ButterPerAlmond rdf:type rdfs:Class ;
15
+ rdfs:label "Butter required per almond croissant" ;
16
+ rdfs:range xsd:integer .
17
+
18
+ bakery:ButterPerPistachio rdf:type rdfs:Class ;
19
+ rdfs:label "Butter required per pistachio croissant" ;
20
+ rdfs:range xsd:integer .
21
+
22
+ bakery:FlourPerAlmond rdf:type rdfs:Class ;
23
+ rdfs:label "Flour required per almond croissant" ;
24
+ rdfs:range xsd:integer .
25
+
26
+ bakery:FlourPerPistachio rdf:type rdfs:Class ;
27
+ rdfs:label "Flour required per pistachio croissant" ;
28
+ rdfs:range xsd:integer .
29
+
30
+ bakery:TotalButter rdf:type rdfs:Class ;
31
+ rdfs:label "Total available butter" ;
32
+ rdfs:range xsd:integer .
33
+
34
+ bakery:TotalFlour rdf:type rdfs:Class ;
35
+ rdfs:label "Total available flour" ;
36
+ rdfs:range xsd:integer .
37
+
38
+ bakery:TimePerAlmond rdf:type rdfs:Class ;
39
+ rdfs:label "Time required per almond croissant" ;
40
+ rdfs:range xsd:integer .
41
+
42
+ bakery:TimePerPistachio rdf:type rdfs:Class ;
43
+ rdfs:label "Time required per pistachio croissant" ;
44
+ rdfs:range xsd:integer .
45
+
46
+ bakery:MinAlmondRatio rdf:type rdfs:Class ;
47
+ rdfs:label "Minimum almond-to-pistachio croissant production ratio" ;
48
+ rdfs:range xsd:integer .
49
+
50
+ bakery:OptimizationProblem rdf:type rdfs:Class ;
51
+ rdfs:label "Optimization problem for bakery" ;
52
+ rdfs:subClassOf bakery:AlmondCroissants, bakery:PistachioCroissants, bakery:ButterPerAlmond, bakery:ButterPerPistachio, bakery:FlourPerAlmond, bakery:FlourPerPistachio, bakery:TotalButter, bakery:TotalFlour, bakery:TimePerAlmond, bakery:TimePerPistachio, bakery:MinAlmondRatio .
@@ -0,0 +1,95 @@
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:NetAcres a rdf:Property ;
7
+ rdfs:label "NetAcres" ;
8
+ rdfs:range xsd:decimal .
9
+
10
+ opt:LineAcres a rdf:Property ;
11
+ rdfs:label "LineAcres" ;
12
+ rdfs:range xsd:decimal .
13
+
14
+ opt:TotalAcres a rdf:Property ;
15
+ rdfs:label "TotalAcres" ;
16
+ rdfs:range xsd:decimal .
17
+
18
+ opt:FishPerNetAcre a rdf:Property ;
19
+ rdfs:label "FishPerNetAcre" ;
20
+ rdfs:range xsd:decimal .
21
+
22
+ opt:FishPerLineAcre a rdf:Property ;
23
+ rdfs:label "FishPerLineAcre" ;
24
+ rdfs:range xsd:decimal .
25
+
26
+ opt:BaitPerNetAcre a rdf:Property ;
27
+ rdfs:label "BaitPerNetAcre" ;
28
+ rdfs:range xsd:decimal .
29
+
30
+ opt:BaitPerLineAcre a rdf:Property ;
31
+ rdfs:label "BaitPerLineAcre" ;
32
+ rdfs:range xsd:decimal .
33
+
34
+ opt:TotalBait a rdf:Property ;
35
+ rdfs:label "TotalBait" ;
36
+ rdfs:range xsd:decimal .
37
+
38
+ opt:PainPerNetAcre a rdf:Property ;
39
+ rdfs:label "PainPerNetAcre" ;
40
+ rdfs:range xsd:decimal .
41
+
42
+ opt:PainPerLineAcre a rdf:Property ;
43
+ rdfs:label "PainPerLineAcre" ;
44
+ rdfs:range xsd:decimal .
45
+
46
+ opt:MaxPain a rdf:Property ;
47
+ rdfs:label "MaxPain" ;
48
+ rdfs:range xsd:decimal .
49
+
50
+ opt:FishingProblem a rdfs:Class ;
51
+ rdfs:label "FishingProblem" ;
52
+ rdfs:subClassOf opt:OptimizationProblem .
53
+
54
+ opt:OptimizationProblem a rdfs:Class ;
55
+ rdfs:label "OptimizationProblem" .
56
+
57
+ opt:hasVariable opt:NetAcres, opt:LineAcres ;
58
+ rdfs:label "hasVariable" ;
59
+ rdfs:range opt:Variable .
60
+
61
+ opt:hasParameter opt:TotalAcres, opt:FishPerNetAcre, opt:FishPerLineAcre, opt:BaitPerNetAcre, opt:BaitPerLineAcre, opt:TotalBait, opt:PainPerNetAcre, opt:PainPerLineAcre, opt:MaxPain ;
62
+ rdfs:label "hasParameter" ;
63
+ rdfs:range opt:Parameter .
64
+
65
+ opt:hasConstraint opt:TotalAcresConstraint, opt:TotalBaitConstraint, opt:MaxPainConstraint ;
66
+ rdfs:label "hasConstraint" ;
67
+ rdfs:range opt:Constraint .
68
+
69
+ opt:hasObjective opt:MaximizeFishCatch ;
70
+ rdfs:label "hasObjective" ;
71
+ rdfs:range opt:Objective .
72
+
73
+ opt:Variable a rdfs:Class ;
74
+ rdfs:label "Variable" .
75
+
76
+ opt:Parameter a rdfs:Class ;
77
+ rdfs:label "Parameter" .
78
+
79
+ opt:Constraint a rdfs:Class ;
80
+ rdfs:label "Constraint" .
81
+
82
+ opt:Objective a rdfs:Class ;
83
+ rdfs:label "Objective" .
84
+
85
+ opt:TotalAcresConstraint a opt:Constraint ;
86
+ rdfs:label "TotalAcresConstraint" .
87
+
88
+ opt:TotalBaitConstraint a opt:Constraint ;
89
+ rdfs:label "TotalBaitConstraint" .
90
+
91
+ opt:MaxPainConstraint a opt:Constraint ;
92
+ rdfs:label "MaxPainConstraint" .
93
+
94
+ opt:MaximizeFishCatch a opt:Objective ;
95
+ rdfs:label "MaximizeFishCatch" .
@@ -0,0 +1,34 @@
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 ski: <http://www.example.org/ski#> .
5
+
6
+ ski:num_skis rdf:type rdfs:Class ;
7
+ rdfs:label "Number of available skis" ;
8
+ rdfs:comment "A scalar value representing the total number of skis available." .
9
+
10
+ ski:num_skiers rdf:type rdfs:Class ;
11
+ rdfs:label "Number of skiers" ;
12
+ rdfs:comment "A scalar value representing the total number of skiers." .
13
+
14
+ ski:ski_heights rdf:type rdfs:Class ;
15
+ rdfs:label "Array of ski heights" ;
16
+ rdfs:comment "An array representing the heights of each ski available." .
17
+
18
+ ski:skier_heights rdf:type rdfs:Class ;
19
+ rdfs:label "Array of skier heights" ;
20
+ rdfs:comment "An array representing the heights of each skier." .
21
+
22
+ ski:disparity rdf:type rdfs:Class ;
23
+ rdfs:label "Disparity" ;
24
+ rdfs:comment "The absolute difference between the skier heights and ski heights." .
25
+
26
+ ski:OptimizationProblem rdf:type rdfs:Class ;
27
+ rdfs:label "Ski Optimization Problem" ;
28
+ rdfs:comment "The problem aims to minimize the disparity between skier heights and assigned ski heights." .
29
+
30
+ ski:OptimizationProblem rdfs:subClassOf ski:num_skis, ski:num_skiers, ski:ski_heights, ski:skier_heights, ski:disparity .
31
+
32
+ ski:OptimizationProblem rdf:type rdfs:Class ;
33
+ rdfs:label "Objective" ;
34
+ rdfs:comment "The objective is to find an assignment of skis to skiers such that the sum of disparities is minimized." .
@@ -0,0 +1,59 @@
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:num_projects rdf:type rdfs:Literal ;
7
+ rdfs:label "Number of projects to select from" ;
8
+ rdfs:range xsd:integer .
9
+
10
+ knap:max_budget rdf:type rdfs:Literal ;
11
+ rdfs:label "Budget limit in million Swedish kronor" ;
12
+ rdfs:range xsd:integer .
13
+
14
+ knap:max_persons rdf:type rdfs:Literal ;
15
+ rdfs:label "Number of persons available" ;
16
+ rdfs:range xsd:integer .
17
+
18
+ knap:max_projects rdf:type rdfs:Literal ;
19
+ rdfs:label "Maximum number of projects that can be selected" ;
20
+ rdfs:range xsd:integer .
21
+
22
+ knap:values rdf:type rdfs:Literal ;
23
+ rdfs:label "Values of each project in thousand Swedish kronor" ;
24
+ rdfs:range xsd:integer .
25
+
26
+ knap:budgets rdf:type rdfs:Literal ;
27
+ rdfs:label "Budgets of each project in million Swedish kronor" ;
28
+ rdfs:range xsd:integer .
29
+
30
+ knap:personell rdf:type rdfs:Literal ;
31
+ rdfs:label "Personnel required for each project" ;
32
+ rdfs:range xsd:integer .
33
+
34
+ knap:not_with rdf:type rdfs:Literal ;
35
+ rdfs:label "Projects that cannot be selected together" ;
36
+ rdfs:range xsd:integer .
37
+
38
+ knap:requires rdf:type rdfs:Literal ;
39
+ rdfs:label "Projects that must be selected together" ;
40
+ rdfs:range xsd:integer .
41
+
42
+ knap:KnapsackProblem rdf:type rdfs:Class ;
43
+ rdfs:label "Knapsack (investment) problem" ;
44
+ rdfs:subClassOf rdfs:Resource .
45
+
46
+ knap:hasParameter rdf:type rdf:Property ;
47
+ rdfs:label "has parameter" ;
48
+ rdfs:domain knap:KnapsackProblem ;
49
+ rdfs:range rdfs:Literal .
50
+
51
+ knap:hasConstraint rdf:type rdf:Property ;
52
+ rdfs:label "has constraint" ;
53
+ rdfs:domain knap:KnapsackProblem ;
54
+ rdfs:range rdfs:Literal .
55
+
56
+ knap:hasObjective rdf:type rdf:Property ;
57
+ rdfs:label "has objective" ;
58
+ rdfs:domain knap:KnapsackProblem ;
59
+ rdfs:range rdfs:Literal .