Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 427 lines (284 sloc) 8.932 kb
15e9a1b Enrique Pérez Arnaud license
authored
1 # -*- coding: utf-8 -*-
2 # Copyright (c) 2007-2012 by Enrique Pérez Arnaud <enriquepablo@gmail.com>
3 #
4 # This file is part of nlproject.
5 #
6 # The nlproject is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # The nlproject is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with any part of the nlproject.
18 # If not, see <http://www.gnu.org/licenses/>.
19
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
20 person are thing.
21 content are thing.
22 document are content.
23 image are content.
24 context are thing.
25
26 john isa person.
27 sue isa person.
28 pete isa person.
29 mary isa person.
30 doc1 isa document.
31 doc2 isa document.
32 img1 isa image.
33 img2 isa image.
34 ctx1 isa context.
35 ctx2 isa context.
36
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
37 a person can content_action (exists) what a content.
38 a person can view (content_action).
39 a person can edit (content_action).
40 a person can owns (content_action).
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
41
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
42 a thing can located (exists) in a context.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
43
44 if:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
45 Thing1 [located in Context1] D1;
46 Context1 [located in Context2] D2;
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
47 then:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
48 Thing1 [located in Context2] until D1, D2.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
49
50
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
51 doc1 [located in ctx1] onwards.
52 ctx1 [located in ctx2] onwards.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
53
54 extend.
55
56 doc1 [located in ctx2]?
8db26c7 Enrique Pérez Arnaud macros
authored
57 doc1 \[located in ctx2\] since [0-9]+ onwards.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
58
59
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
60 a person can wants (exists) that a person, do a content_action.
61 a person can is_allowed (exists) to a content_action.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
62
63 if:
64 Person1 [wants that Person1, do [Content_action1]];
65 Person1 [is_allowed to [Content_action1]];
66 then:
67 Person1 [Content_action1].
68
69
70 sue [wants that sue, do [view what doc1]].
71 sue [is_allowed to [view what doc1]].
72
73 extend.
74
75 sue [view what doc1]?
8db26c7 Enrique Pérez Arnaud macros
authored
76 sue \[view what doc1\] at [0-9]+.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
77
78
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
79 a person can may (exists)
55178a9 Enrique Pérez Arnaud better definition of verbs
authored
80 what a verb,
81 where a context.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
82
83
84 if:
85 Person1 [wants that Person1, do [Content_actionVerb1 what Content1]];
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
86 Person1 [may what Content_actionVerb1, where Context1];
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
87 Content1 [located in Context1];
88 then:
89 Person1 [Content_actionVerb1 what Content1].
90
91
92 mary [wants that mary, do [view what doc1]].
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
93 mary [may what view, where ctx1].
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
94
95
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
96 a person can wf_action (content_action).
97 a person can publish (wf_action).
98 a person can hide (wf_action).
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
99
100
101 status are thing.
102 public isa status.
103 private isa status.
104
105
106 workflow are thing.
107
108
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
109 a workflow can is_assigned (exists)
55178a9 Enrique Pérez Arnaud better definition of verbs
authored
110 to a noun,
111 in a context.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
112
113
114 transition are thing.
115
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
116 a thing can has (exists) what a thing.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
117
118
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
119 a transition can executed (exists)
55178a9 Enrique Pérez Arnaud better definition of verbs
authored
120 by a verb,
121 fro_m a status,
122 to a status.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
123
124
125 role are thing.
126 manager isa role.
127 editor isa role.
128 visitor isa role.
129
130 permission are thing.
131 basic_perm isa permission.
132 edit_perm isa permission.
133 manage_perm isa permission.
134
51a4f6b Enrique Pérez Arnaud better definition of verbs
authored
135 a verb can is_protected (exists)
55178a9 Enrique Pérez Arnaud better definition of verbs
authored
136 by a permission,
137 in a context,
138 for a status.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
139
140 if:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
141 Person1 [wants that Person1, do [Content_actionVerb1 what Content1]] at I1;
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
142 Content1 [located in Context1] D1;
143 Content1 [has what Status1] D2;
144 Person1 [has what Role1] D3;
145 Role1 [has what Permission1] D4;
146 Content_actionVerb1 [is_protected by Permission1, in Context1, for Status1] D5;
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
147 I1 during D1, D2, D3, D4, D5;
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
148 then:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
149 Person1 [Content_actionVerb1 what Content1] at I1.
150
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
151 if:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
152 Person1 [Wf_actionVerb1 what Content1(ContentNoun1)] at I1;
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
153 Workflow1 [is_assigned to ContentNoun1, in Context1] D1;
154 Workflow1 [has what Transition1] D2;
155 Transition1 [executed by Wf_actionVerb1, fro_m Status1, to Status2] D3;
156 Content1 [has what Status1] D4;
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
157 I1 during D1, D2, D3, D4;
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
158 then:
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
159 finish D4 at I1;
160 Content1 [has what Status2] since I1 until D1, D2, D3.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
161
162
163 manager [has what manage_perm] onwards.
164 manager [has what edit_perm] onwards.
165 manager [has what basic_perm] onwards.
166 editor [has what edit_perm] onwards.
167 editor [has what basic_perm] onwards.
168 visitor [has what basic_perm] onwards.
169
170 publish [is_protected by manage_perm, in ctx1, for private] onwards.
171 hide [is_protected by edit_perm, in ctx1, for public] onwards.
172 edit [is_protected by edit_perm, in ctx1, for private] onwards.
173 edit [is_protected by manage_perm, in ctx1, for public] onwards.
174 view [is_protected by edit_perm, in ctx1, for private] onwards.
175 view [is_protected by basic_perm, in ctx1, for public] onwards.
176
177 wf1 isa workflow.
178
179 hide_tr isa transition.
180
181 wf1 [has what hide_tr] onwards.
182
183 publish_tr isa transition.
184
185 wf1 [has what publish_tr] onwards.
186
187 hide_tr [executed by hide, fro_m public, to private] onwards.
188 publish_tr [executed by publish, fro_m private, to public] onwards.
189
190 wf1 [is_assigned to document, in ctx1] onwards.
191
192 john [has what manager] onwards.
193 mary [has what editor] onwards.
194 pete [has what visitor] onwards.
195
196 doc1 [has what private] onwards.
197
198 pete [wants that pete, do [publish what doc1]].
199
200 extend.
201
202 pete [publish what doc1]?
8db26c7 Enrique Pérez Arnaud macros
authored
203 False.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
204
205 doc1 [has what Status1] D1?
8db26c7 Enrique Pérez Arnaud macros
authored
206 doc1 \[has what private\] since [0-9]+ onwards.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
207
208 john [wants that john, do [publish what doc1]].
209
210 extend.
211
212 john [publish what doc1]?
8db26c7 Enrique Pérez Arnaud macros
authored
213 john \[publish what doc1\] at [0-9]+.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
214
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
215 doc1 [has what public]?
8db26c7 Enrique Pérez Arnaud macros
authored
216 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
217
218 doc1 [has what public] now?
8db26c7 Enrique Pérez Arnaud macros
authored
219 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
220
221 doc1 [has what public] at I1?
8db26c7 Enrique Pérez Arnaud macros
authored
222 doc1 \[has what public\] since [0-9]+ onwards.
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
223
224 doc1 [has what public] D1?
8db26c7 Enrique Pérez Arnaud macros
authored
225 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
226
227 now.
228
229 john [wants that john, do [hide what doc1]].
230
231 extend.
232 now.
233
234 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
235 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
236
237 john [wants that john, do [publish what doc1]].
238
239 extend.
240 now.
241
242 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
243 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
244
245 john [wants that john, do [hide what doc1]].
246
247 extend.
248 now.
249
250 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
251 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
252
253 john [wants that john, do [publish what doc1]].
254
255 extend.
256 now.
257
258 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
259 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
260
261 john [wants that john, do [hide what doc1]].
262
263 extend.
264 now.
265
266 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
267 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
268
269 john [wants that john, do [publish what doc1]].
270
271 extend.
272 now.
273
274 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
275 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
276
277 john [wants that john, do [hide what doc1]].
278
279 extend.
280 now.
281
282 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
283 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
284
285 john [wants that john, do [publish what doc1]].
286
287 extend.
288 now.
289
290 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
291 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
292
293 john [wants that john, do [hide what doc1]].
294
295 extend.
296 now.
297
298 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
299 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
300
301 john [wants that john, do [publish what doc1]].
302
303 extend.
304 now.
305
306 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
307 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
308
309 john [wants that john, do [hide what doc1]].
310
311 extend.
312 now.
313
314 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
315 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
316
317 john [wants that john, do [publish what doc1]].
318
319 extend.
320 now.
321
322 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
323 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
324
325 john [wants that john, do [hide what doc1]].
326
327 extend.
328 now.
329
330 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
331 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
332
333 john [wants that john, do [publish what doc1]].
334
335 extend.
336 now.
337
338 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
339 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
340
341 john [wants that john, do [hide what doc1]].
342
343 extend.
344 now.
345
346 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
347 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
348
349 john [wants that john, do [publish what doc1]].
350
351 extend.
352 now.
353
354 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
355 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
356
357 john [wants that john, do [hide what doc1]].
358
359 extend.
360 now.
361
362 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
363 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
364
365 john [wants that john, do [publish what doc1]].
366
367 extend.
368 now.
369
370 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
371 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
372
373 john [wants that john, do [hide what doc1]].
374
375 extend.
376 now.
377
378 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
379 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
380
381 john [wants that john, do [publish what doc1]].
382
383 extend.
384 now.
385
386 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
387 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
388
389 pete [wants that pete, do [view what doc1]].
390
391 extend.
392
393 pete [view what doc1] now?
394 pete \[view what doc1\] at [0-9]+.
395
396 john [wants that john, do [hide what doc1]].
397
398 extend.
399 now.
400
401 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
402 doc1 \[has what private\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
403
404 pete [wants that pete, do [view what doc1]].
405
406 extend.
407
408 pete [view what doc1] now?
8db26c7 Enrique Pérez Arnaud macros
authored
409 False.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
410
411 john [wants that john, do [publish what doc1]].
412
413 extend.
414 now.
415
416 doc1 [has what Status1]?
8db26c7 Enrique Pérez Arnaud macros
authored
417 doc1 \[has what public\] since [0-9]+ onwards.
a5f75c5 Enrique Pérez Arnaud testing time in npl, and fixing it
authored
418
419 pete [wants that pete, do [view what doc1]].
420
421 extend.
422
423 pete [view what doc1] now?
424 pete \[view what doc1\] at [0-9]+.
425
23d4ac2 Enrique Pérez Arnaud some functional npl testing.
authored
426
Something went wrong with that request. Please try again.