1 | ;;+----------------------------------------------------------------------------- |
---|
2 | ;;+ Isidorus |
---|
3 | ;;+ (c) 2008-2010 Marc Kuester, Christoph Ludwig, Lukas Georgieff |
---|
4 | ;;+ |
---|
5 | ;;+ Isidorus is freely distributable under the LLGPL license. |
---|
6 | ;;+ You can find a detailed description in trunk/docs/LLGPL-LICENSE.txt and |
---|
7 | ;;+ trunk/docs/LGPL-LICENSE.txt. |
---|
8 | ;;+----------------------------------------------------------------------------- |
---|
9 | |
---|
10 | |
---|
11 | (asdf:operate 'asdf:load-op 'elephant) |
---|
12 | (use-package :elephant) |
---|
13 | |
---|
14 | (defpclass VersionInfoC() |
---|
15 | ((start-revision :initarg :start-revision |
---|
16 | :accessor start-revision |
---|
17 | :type integer |
---|
18 | :initform 0) |
---|
19 | (end-revision :initarg :end-revision |
---|
20 | :accessor end-revision |
---|
21 | :type integer |
---|
22 | :initform 0) |
---|
23 | (versioned-construct :initarg :versioned-construct |
---|
24 | :accessor versioned-construct |
---|
25 | :associate VersionedConstructC))) |
---|
26 | |
---|
27 | (defpclass VersionedConstructC() |
---|
28 | ((versions :initarg :versions |
---|
29 | :accessor versions |
---|
30 | :inherit t |
---|
31 | :associate (VersionInfoC versioned-construct)))) |
---|
32 | |
---|
33 | |
---|
34 | (defpclass VersionedAssociationC(VersionedConstructC) |
---|
35 | ()) |
---|
36 | |
---|
37 | |
---|
38 | (defpclass PointerAssociationC (VersionedAssociationC) |
---|
39 | ((identifier :initarg :identifier |
---|
40 | :accessor identifier |
---|
41 | :inherit t |
---|
42 | :initform (error "From PointerAssociationC(): identifier must be set") |
---|
43 | :associate PointerC))) |
---|
44 | |
---|
45 | |
---|
46 | (defpclass ItemIdAssociationC(PointerAssociationC) |
---|
47 | ((parent-construct :initarg :parent-construct |
---|
48 | :accessor parent-construct |
---|
49 | :initform (error "From ItemIdAssociationC(): parent-construct must be set") |
---|
50 | :associate ReifiableConstructC))) |
---|
51 | |
---|
52 | |
---|
53 | (defpclass TopicMapConstructC() |
---|
54 | ()) |
---|
55 | |
---|
56 | |
---|
57 | (defpclass ReifiableConstructC(TopicMapConstructC) |
---|
58 | ((item-identifiers :associate (ItemIdAssociationC parent-construct) |
---|
59 | :inherit t))) |
---|
60 | |
---|
61 | |
---|
62 | (defpclass PointerC(TopicMapConstructC) |
---|
63 | ((uri :initarg :uri |
---|
64 | :accessor uri |
---|
65 | :inherit t |
---|
66 | :type string |
---|
67 | :initform (error "From PointerC(): uri must be set for a pointer") |
---|
68 | :index t) |
---|
69 | (identified-construct :associate (PointerAssociationC identifier) |
---|
70 | :inherit t))) |
---|
71 | |
---|
72 | |
---|
73 | (defpclass IdentifierC(PointerC) |
---|
74 | ()) |
---|
75 | |
---|
76 | |
---|
77 | (defpclass ItemIdentifierC(IdentifierC) |
---|
78 | () |
---|
79 | (:index t)) |
---|
80 | |
---|
81 | |
---|
82 | (open-store '(:BDB "data_base")) |
---|
83 | (defvar *p* (make-instance 'PointerC |
---|
84 | :uri "anyUri")) |
---|
85 | (defvar *pa* (make-instance 'PointerAssociationC |
---|
86 | :identifier *p*)) |
---|
87 | |
---|
88 | (defvar *ii* (make-instance 'ItemIdentifierC |
---|
89 | :uri "anyUri")) |
---|
90 | |
---|
91 | (defvar *pa-ii* (make-instance 'PointerAssociationC |
---|
92 | :identifier *ii*)) |
---|
93 | |
---|
94 | (defvar *ii-2* (make-instance 'ItemIdentifierC |
---|
95 | :uri "anyUri")) |
---|
96 | |
---|
97 | (defvar *rc* (make-instance 'ReifiableConstructC)) |
---|
98 | |
---|
99 | |
---|
100 | (defvar *ia* (make-instance 'ItemIdAssociationC |
---|
101 | :identifier *ii-2* |
---|
102 | :parent-construct *rc*)) |
---|
103 | |
---|
104 | |
---|
105 | (when (not (slot-value *p* 'identified-construct)) |
---|
106 | (error ">> 1")) |
---|
107 | |
---|
108 | (when (not (slot-value *pa* 'identifier)) |
---|
109 | (error ">> 2")) |
---|
110 | |
---|
111 | (when (not (slot-value *ii* 'identified-construct)) |
---|
112 | (error ">> 3")) |
---|
113 | |
---|
114 | (when (not (slot-value *pa-ii* 'identifier)) |
---|
115 | (error ">> 4")) |
---|
116 | |
---|
117 | (when (not (slot-value *ii-2* 'identified-construct)) |
---|
118 | (error ">> 5")) |
---|
119 | |
---|
120 | (when (not (slot-value *rc* 'item-identifiers)) |
---|
121 | (error ">> 6")) |
---|
122 | |
---|
123 | (when (not (slot-value *ia* 'parent-construct)) |
---|
124 | (error ">> 7")) |
---|
125 | |
---|
126 | (when (not (slot-value *ia* 'identifier)) |
---|
127 | (error ">> 8")) |
---|