activefacts 0.7.3 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. data/LICENSE +19 -0
  2. data/Manifest.txt +24 -2
  3. data/Rakefile +25 -3
  4. data/bin/afgen +1 -1
  5. data/bin/cql +13 -2
  6. data/css/offline.css +3 -0
  7. data/css/orm2.css +24 -0
  8. data/css/print.css +8 -0
  9. data/css/style-print.css +357 -0
  10. data/css/style.css +387 -0
  11. data/download.html +85 -0
  12. data/examples/CQL/Address.cql +3 -3
  13. data/examples/CQL/Blog.cql +13 -14
  14. data/examples/CQL/CompanyDirectorEmployee.cql +4 -4
  15. data/examples/CQL/Death.cql +3 -2
  16. data/examples/CQL/Genealogy.cql +13 -11
  17. data/examples/CQL/Marriage.cql +2 -2
  18. data/examples/CQL/Metamodel.cql +136 -93
  19. data/examples/CQL/MultiInheritance.cql +2 -2
  20. data/examples/CQL/OilSupply.cql +14 -10
  21. data/examples/CQL/Orienteering.cql +22 -19
  22. data/examples/CQL/PersonPlaysGame.cql +3 -2
  23. data/examples/CQL/SchoolActivities.cql +4 -2
  24. data/examples/CQL/SimplestUnary.cql +1 -1
  25. data/examples/CQL/SubtypePI.cql +6 -7
  26. data/examples/CQL/Warehousing.cql +16 -19
  27. data/examples/CQL/unit.cql +584 -0
  28. data/examples/index.html +276 -0
  29. data/examples/intro.html +497 -0
  30. data/examples/local.css +20 -0
  31. data/index.html +96 -0
  32. data/lib/activefacts/api/concept.rb +48 -46
  33. data/lib/activefacts/api/constellation.rb +43 -23
  34. data/lib/activefacts/api/entity.rb +2 -2
  35. data/lib/activefacts/api/instance.rb +6 -2
  36. data/lib/activefacts/api/instance_index.rb +5 -0
  37. data/lib/activefacts/api/value.rb +8 -2
  38. data/lib/activefacts/api/vocabulary.rb +15 -10
  39. data/lib/activefacts/cql/CQLParser.treetop +109 -88
  40. data/lib/activefacts/cql/Concepts.treetop +32 -10
  41. data/lib/activefacts/cql/Context.treetop +34 -0
  42. data/lib/activefacts/cql/Expressions.treetop +9 -9
  43. data/lib/activefacts/cql/FactTypes.treetop +30 -31
  44. data/lib/activefacts/cql/Language/English.treetop +50 -0
  45. data/lib/activefacts/cql/LexicalRules.treetop +2 -1
  46. data/lib/activefacts/cql/Terms.treetop +117 -0
  47. data/lib/activefacts/cql/ValueTypes.treetop +152 -0
  48. data/lib/activefacts/cql/compiler.rb +1718 -0
  49. data/lib/activefacts/cql/parser.rb +124 -57
  50. data/lib/activefacts/generate/absorption.rb +1 -1
  51. data/lib/activefacts/generate/cql.rb +111 -100
  52. data/lib/activefacts/generate/cql/html.rb +5 -5
  53. data/lib/activefacts/generate/oo.rb +3 -3
  54. data/lib/activefacts/generate/ordered.rb +51 -19
  55. data/lib/activefacts/generate/ruby.rb +10 -8
  56. data/lib/activefacts/generate/sql/mysql.rb +14 -10
  57. data/lib/activefacts/generate/sql/server.rb +29 -24
  58. data/lib/activefacts/input/cql.rb +9 -1264
  59. data/lib/activefacts/input/orm.rb +213 -200
  60. data/lib/activefacts/persistence/columns.rb +11 -10
  61. data/lib/activefacts/persistence/index.rb +15 -18
  62. data/lib/activefacts/persistence/reference.rb +17 -17
  63. data/lib/activefacts/persistence/tables.rb +50 -51
  64. data/lib/activefacts/version.rb +1 -1
  65. data/lib/activefacts/vocabulary/extensions.rb +79 -8
  66. data/lib/activefacts/vocabulary/metamodel.rb +183 -114
  67. data/spec/absorption_ruby_spec.rb +99 -0
  68. data/spec/absorption_spec.rb +3 -4
  69. data/spec/api/constellation.rb +1 -1
  70. data/spec/api/entity_type.rb +3 -1
  71. data/spec/api/instance.rb +4 -2
  72. data/spec/api/roles.rb +8 -6
  73. data/spec/api_spec.rb +1 -2
  74. data/spec/cql/context_spec.rb +71 -0
  75. data/spec/cql/samples_spec.rb +154 -0
  76. data/spec/cql/unit_spec.rb +375 -0
  77. data/spec/cql_cql_spec.rb +31 -21
  78. data/spec/cql_mysql_spec.rb +70 -0
  79. data/spec/cql_parse_spec.rb +15 -9
  80. data/spec/cql_ruby_spec.rb +27 -13
  81. data/spec/cql_sql_spec.rb +42 -16
  82. data/spec/cql_symbol_tables_spec.rb +2 -3
  83. data/spec/cqldump_spec.rb +7 -7
  84. data/spec/helpers/file_matcher.rb +39 -0
  85. data/spec/norma_cql_spec.rb +20 -12
  86. data/spec/norma_ruby_spec.rb +6 -3
  87. data/spec/norma_sql_spec.rb +6 -3
  88. data/spec/norma_tables_spec.rb +6 -4
  89. data/spec/spec_helper.rb +27 -8
  90. data/status.html +69 -0
  91. data/why.html +60 -0
  92. metadata +34 -11
  93. data/lib/activefacts/cql/DataTypes.treetop +0 -81
  94. data/spec/cql_unit_spec.rb +0 -330
data/css/style.css ADDED
@@ -0,0 +1,387 @@
1
+ body
2
+ {
3
+ color : #000000;
4
+ background-color : #FFFFFF;
5
+ line-height : 1.5em;
6
+ font-family : Calibri, Verdana, sans-serif;
7
+ }
8
+
9
+ /* emphasis */
10
+
11
+ em,
12
+ blockquote
13
+ {
14
+ font-family : Cambria, Georgia, serif;
15
+ }
16
+
17
+ /* headings */
18
+
19
+ h1,
20
+ h2,
21
+ h3,
22
+ h4,
23
+ h5,
24
+ h6,
25
+ .title
26
+ {
27
+ font-weight : lighter;
28
+ font-family : Constantia, "Book Antiqua", "URW Bookman L", serif;
29
+ }
30
+
31
+ #lof h1,
32
+ #lof h2,
33
+ #lof h3,
34
+ #lof h4,
35
+ #lof h5,
36
+ #lof h6
37
+ {
38
+ margin-top : 1.25em;
39
+ }
40
+
41
+ #content h1,
42
+ #content h2,
43
+ #content h3,
44
+ #content h4,
45
+ #content h5,
46
+ #content h6
47
+ {
48
+ margin-top : 2.5em;
49
+ line-height : 1.25em;
50
+ }
51
+
52
+ #content h1
53
+ {
54
+ font-size : 2.0em;
55
+ }
56
+
57
+ #content h2
58
+ {
59
+ font-size : 1.8em;
60
+ }
61
+
62
+ #content h3
63
+ {
64
+ font-size : 1.6em;
65
+ }
66
+
67
+ #content h4
68
+ {
69
+ font-size : 1.4em;
70
+ }
71
+
72
+ #content h5
73
+ {
74
+ font-size : 1.2em;
75
+ }
76
+
77
+ #content h6
78
+ {
79
+ font-size : 1.0em;
80
+ }
81
+
82
+ /* tables */
83
+
84
+ table
85
+ {
86
+ border : none;
87
+ }
88
+
89
+ th,
90
+ td
91
+ {
92
+ padding : 1em;
93
+ border : 1px solid #C0C0C0;
94
+ vertical-align : top;
95
+ background-color : #FFFFFF;
96
+ }
97
+
98
+ th
99
+ {
100
+ background-color : #F5F5F5;
101
+ }
102
+
103
+ table
104
+ {
105
+ margin : auto;
106
+ }
107
+
108
+ /* document structure */
109
+
110
+ #header
111
+ {
112
+ margin-bottom : 5em;
113
+ text-align : center;
114
+ }
115
+
116
+ #abstract
117
+ {
118
+ margin-bottom : 5em;
119
+ }
120
+
121
+ #toc li
122
+ {
123
+ list-style-type : none;
124
+ }
125
+
126
+ #toc li ul
127
+ {
128
+ padding-bottom : 1em;
129
+ border-left : thick solid #F5F5F5;
130
+ _border-left : none; /* for IE6 */
131
+ }
132
+
133
+ #toc li ul:hover
134
+ {
135
+ border-color : #DCDCDC;
136
+ }
137
+
138
+ #toc > ul
139
+ {
140
+ padding-left : 1em;
141
+ }
142
+
143
+ #references
144
+ {
145
+ margin-top : 5em;
146
+ }
147
+
148
+ #footer
149
+ {
150
+ border-top : thick dotted #DCDCDC;
151
+ padding-top : 1em;
152
+ margin-top : 5em;
153
+ text-align : center;
154
+ }
155
+
156
+ /* document nodes */
157
+
158
+ .part > .title,
159
+ .chapter > .title
160
+ {
161
+ padding-bottom : 0.5em;
162
+ }
163
+
164
+ .part > .title > big,
165
+ .chapter > .title > big
166
+ {
167
+ display : block;
168
+ margin-top : 1.5em;
169
+ }
170
+
171
+ .part .title big,
172
+ .chapter .title big
173
+ {
174
+ _display : block; /* for IE6 */
175
+ _margin-top : 0.25em; /* for IE6 */
176
+ _margin-bottom : 0.75em; /* for IE6 */
177
+ }
178
+
179
+ .index
180
+ {
181
+ font-size: 0.9em;
182
+ line-height: 1.2em;
183
+ }
184
+
185
+ .index ul
186
+ {
187
+ margin: 4px;
188
+ font-size: 0.9em;
189
+ line-height: 1em;
190
+ }
191
+
192
+ .paragraph > .title,
193
+ .tip > .title,
194
+ .note > .title,
195
+ .caution > .title,
196
+ .warning > .title,
197
+ .important > .title,
198
+ .figure > .title,
199
+ .table > .title,
200
+ .example > .title,
201
+ .equation > .title,
202
+ .procedure > .title
203
+ {
204
+ font-size : large;
205
+ margin-top : 2em;
206
+ }
207
+
208
+ .paragraph .title,
209
+ .tip .title,
210
+ .note .title,
211
+ .caution .title,
212
+ .warning .title,
213
+ .important .title,
214
+ .figure .title,
215
+ .table .title,
216
+ .example .title,
217
+ .equation .title,
218
+ .procedure .title
219
+ {
220
+ _font-size : large; /* for IE6 */
221
+ _font-weight : bold; /* large is not bold in IE6 */
222
+ _margin-top : 2em; /* for IE6 */
223
+ }
224
+
225
+ .tip ,
226
+ .note ,
227
+ .caution ,
228
+ .warning ,
229
+ .important,
230
+ .figure ,
231
+ .table ,
232
+ .example ,
233
+ .equation ,
234
+ .procedure
235
+ {
236
+ margin : 3em;
237
+ }
238
+
239
+ .tip > .icon,
240
+ .note > .icon,
241
+ .caution > .icon,
242
+ .warning > .icon,
243
+ .important > .icon
244
+ {
245
+ float : left;
246
+ margin : 0 1em 1em 0; /* top right bottom left */
247
+ }
248
+
249
+ .tip .icon,
250
+ .note .icon,
251
+ .caution .icon,
252
+ .warning .icon,
253
+ .important .icon
254
+ {
255
+ _display : none; /* IE6 cannot display embedded images */
256
+ }
257
+
258
+ .figure > .title
259
+ {
260
+ text-align : center;
261
+ }
262
+
263
+ .figure .title
264
+ {
265
+ _text-align : center; /* for IE6 */
266
+ }
267
+
268
+ .figure > .content > img
269
+ {
270
+ display : block;
271
+ margin : auto;
272
+ }
273
+
274
+ .figure .content img
275
+ {
276
+ _display : block; /* for IE6 */
277
+ _margin : auto; /* for IE6 */
278
+ }
279
+
280
+ body
281
+ {
282
+ margin : auto;
283
+ padding : 0.5em;
284
+ XXmax-width : 40em;
285
+ max-width : 70%;
286
+ }
287
+
288
+ /* hyperlinks */
289
+
290
+ a
291
+ {
292
+ color : #0000FF;
293
+ text-decoration : none;
294
+ }
295
+
296
+ a:visited
297
+ {
298
+ color : #800080;
299
+ }
300
+
301
+ a:hover
302
+ {
303
+ color : #FF0000;
304
+ text-decoration : underline;
305
+ }
306
+
307
+ a:target
308
+ {
309
+ color : #FF0000;
310
+ text-decoration : underline;
311
+ }
312
+
313
+ a.toc:link,
314
+ a.toc:visited
315
+ {
316
+ text-decoration : none;
317
+ z-index : 1;
318
+ }
319
+
320
+ a img
321
+ {
322
+ border : none;
323
+ }
324
+
325
+ /* source code */
326
+
327
+ tt,
328
+ code,
329
+ pre
330
+ {
331
+ font-family : Consolas, "Lucida Console", monospace;
332
+ }
333
+
334
+ tt
335
+ {
336
+ font-weight : bold;
337
+ color : #A52A2A;
338
+ background-color : #FFFAF0;
339
+ }
340
+
341
+ /* output of syntax colorizer */
342
+ .code
343
+ {
344
+ background-color : #FFFFF0;
345
+ }
346
+
347
+ pre
348
+ {
349
+ line-height : normal;
350
+ border : 1px dashed #C0C0C0;
351
+ background-color : #F5FFDF;
352
+ padding : 1em;
353
+ overflow : auto;
354
+ cursor : text;
355
+ }
356
+
357
+ /*
358
+ pre:hover
359
+ {
360
+ border : none;
361
+ position : fixed;
362
+ z-index : 1;
363
+ margin : 0;
364
+ top : 0;
365
+ left : 0;
366
+ right : 0;
367
+ bottom : 0;
368
+ overflow : auto;
369
+ cursor : text;
370
+ }
371
+ */
372
+
373
+ /* emphasis */
374
+
375
+ blockquote
376
+ {
377
+ margin : 1em;
378
+ border : 5px dotted #C0C0C0;
379
+ padding : 1em;
380
+ color : #444;
381
+ }
382
+
383
+ hr
384
+ {
385
+ color : #FF0000; /* for IE6 */
386
+ background-color : #FF0000; /* for Firefox */
387
+ }
data/download.html ADDED
@@ -0,0 +1,85 @@
1
+ <!--#include virtual="/header.html" -->
2
+ <!--#include virtual="navbar.html" -->
3
+
4
+ <link rel="stylesheet" href="css/offline.css" media="screen" type="text/css" />
5
+
6
+ <div id="sidebar"></div>
7
+
8
+ <div id="top" class="content">
9
+
10
+ <a name="download"></a>
11
+ <h2 class="title">
12
+ Download
13
+ </h2>
14
+
15
+ <p>
16
+ ActiveFacts is <a href="http://rubygems.rubyforge.org/">packaged</a>
17
+ as a <a href="http://www.ruby-lang.org/">Ruby</a> <a href="http://gems.rubyforge.org/">GEM</a>.
18
+ You should install Ruby, and say
19
+ </p>
20
+
21
+ <pre>
22
+ sudo gem install activefacts
23
+ </pre>
24
+
25
+ <p>
26
+ After installing, you can read the Ruby API documentation by visiting
27
+ <a href="http://localhost:8808/">http://localhost:8808/</a> in your browser after starting
28
+ </p>
29
+ <pre>
30
+ gem server
31
+ </pre>
32
+
33
+ <p>
34
+ CQL Examples are provided in a directory under your gem directory, and you can generate
35
+ code from them using commands like the following (change the path to your gem repository):
36
+ </p>
37
+
38
+ <pre>
39
+ afgen --ruby /opt/local/lib/ruby/gems/1.8/gems/activefacts-0.6.0/examples/CQL/OilSupply.cql
40
+ afgen --sql/server /opt/local/lib/ruby/gems/1.8/gems/activefacts-0.6.0/examples/CQL/Warehousing.cql
41
+ </pre>
42
+
43
+ <p>
44
+ <em>afgen</em> also reads <em>.orm</em> files from <a href="http://ormfoundation.org/files">NORMA</a>.
45
+ </p>
46
+
47
+ <h3>Source Code Repository</h3>
48
+ <p>
49
+ The <a href="http://subversion.tigris.org/">Subversion</a> repository is also available
50
+ at <a href="http://rubyforge.org/projects/activefacts/">RubyForge</a>.
51
+ If you're on Windows and don't have Subversion installed, you can also
52
+ get a client like Tortoise or cygwin. If you use a command-line <em>svn</em> client, say:
53
+ </p>
54
+ <pre>
55
+ svn checkout http://activefacts.rubyforge.org/svn/
56
+
57
+ or
58
+
59
+ svn checkout svn://rubyforge.org/var/svn/activefacts
60
+ </pre>
61
+
62
+ <h3>Object Role Modeling</h3>
63
+ <p>
64
+ If you want to draw your own <a href="www.orm.net">Object Role Modeling</a>
65
+ diagrams and have a copy of Windows Visual Studio (pro only, not Express),
66
+ you can freely download and install the <a href="http://www.ormfoundation.com/files/">Neumont ORM Architect</a>.
67
+ The example models are available in the correct format from the SVN repository.
68
+ The ActiveFacts generator <em>afgen</em> can process ORM files as easily as
69
+ CQL files, though a little slower due to the volume of XML to be parsed.
70
+ </p>
71
+
72
+ <a name="information"></a>
73
+ <h3>More information and discussion</h3>
74
+
75
+ <p>
76
+ Status messages go to the Yahoo
77
+ <a href="http://tech.groups.yahoo.com/group/information_modeling">information_modeling</a>
78
+ group, which is also available as an
79
+ <a href="news:gmane.comp.programming.modeling.information">NNTP feed on Gmane</a>.
80
+ Subscribe today and share your thoughts!
81
+ </p>
82
+
83
+ </div>
84
+
85
+ <!--#include virtual="/footer.html" -->