]> dreyeck.freedombox.rocks Git - topic-maps.git/blob - vendor/cxtm/tmcl/level-1/invalid/illegal-role-combination.ctm
examples: explore project work through native Topic Maps (slice 22U)
[topic-maps.git] / vendor / cxtm / tmcl / level-1 / invalid / illegal-role-combination.ctm
1 %prefix tmcl http://psi.topicmaps.org/tmcl/
2
3 def role-combination($at, $rt, $tt, $ort, $ott)
4 ?c isa tmcl:role-combination-constraint.
5 tmcl:constrained-statement(tmcl:constraint: ?c, tmcl:constrained: $at)
6 tmcl:constrained-role(tmcl:constraint: ?c, tmcl:constrained: $rt)
7 tmcl:constrained-topic-type(tmcl:constraint: ?c, tmcl:constrained: $tt)
8 tmcl:other-constrained-role(tmcl:constraint: ?c, tmcl:constrained: $ort)
9 tmcl:other-constrained-topic-type(tmcl:constraint: ?c, tmcl:constrained: $ott)
10 end
11
12 def has-role($at, $rt, $min, $max)
13 ?c isa tmcl:association-role-constraint;
14 tmcl:card-min: $min;
15 tmcl:card-max: $max.
16
17 tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $at)
18 tmcl:constrained-role(tmcl:constraint : ?c, tmcl:constrained : $rt)
19 end
20
21 def plays-role($tt, $rt, $at, $min, $max)
22 ?c isa tmcl:topic-role-constraint;
23 tmcl:card-min: $min;
24 tmcl:card-max: $max.
25
26 tmcl:constrained-topic-type(tmcl:constraint : ?c, tmcl:constrained : $tt)
27 tmcl:constrained-statement(tmcl:constraint : ?c, tmcl:constrained : $at)
28 tmcl:constrained-role(tmcl:constraint : ?c, tmcl:constrained : $rt)
29 end
30
31 contained-in isa tmcl:association-type;
32 has-role(containee, 1, 1);
33 has-role(container, 1, 1);
34 role-combination(containee, city, container, province);
35 role-combination(containee, province, container, country);
36 role-combination(containee, country, container, continent).
37
38 continent isa tmcl:topic-type;
39 plays-role(container, contained-in, 0, *).
40 country isa tmcl:topic-type;
41 plays-role(container, contained-in, 0, *);
42 plays-role(containee, contained-in, 0, *).
43 province isa tmcl:topic-type;
44 plays-role(container, contained-in, 0, *);
45 plays-role(containee, contained-in, 0, *).
46 city isa tmcl:topic-type;
47 plays-role(containee, contained-in, 0, *).
48
49 contained-in(containee: oslo, container: europe)
50
51 oslo isa city.
52 europe isa continent.
53
54 containee isa tmcl:role-type.
55 container isa tmcl:role-type.