4 This is a specification of the interface between the middle-end and
5 back-end of the arxana system.
9 The dispatcher is an applicaton layer which mediates interactions
10 between the middle end and the back-end(s).
14 These commands and variables implement the plexus registry.
18 variable type-registry
20 This is where the dispatcher maintains information about different
21 types of supported backends is stored.
25 This is where the dispatcher maintains information about the plexi
26 currently defined in the system is stored.
30 function storage-types ()
32 Return a list of types of databases which the system currently
37 predicate storage-type-p (type)
39 Query whhether a particular type is currently supported.
47 Remove a certain type of handler from the type registry.
49 *** show-plexus-registry
51 function show-plexus-registry ()
53 List the plexi currently open in the system.
55 *** set-current-plexus
57 function set-current-plexus (plex)
59 Define the default plexus to which subsequent commands will apply.
61 *** show-current-plexus
63 function show-current-plexus ()
65 Return the plexus currently being examined.
67 *** with-current-plexus
69 macro with-current-plexus (plex &rest expr)
71 Evaluate the enclosed code in the context of a specified plexus.
76 For the convenience of the user, the system allows one to label nemata
77 and plexi with descriptive names which can be used in place of the
78 identifiers which it assigns to them.
82 function label-nema (uid label)
84 Assign the label to the given object.
88 function label2uid (label)
90 Return the unique identifier corresponding to a label.
94 function uid2label (uid)
96 Return the label associated to a unique identifier.
101 Honey is the protocol whereby arxana communicates with the database
102 routines in which the triples reside. Standardizing the form of
103 this interface makes it possible to swap out one type of database (say
104 hash tables) for another type (say a relational database) without
105 making any changes to the middle-end code or changing the functionality.
107 Wth a few exceptions which will be noted below, the commands here come
108 in two versions --- a system version which is called by the
109 dispatcher and which directly interacts with the appropriate database
110 and a user version which is a wrapper around the system-level form
111 in which the dispatcher adds convenience and bookkeeping.
113 ** Instance operations
115 These operations create, initialize, and destroy instances of plexi.
117 *** initialize-handler
121 system: initialize-handler ()
123 Initialize the handler for a certain type the first time that that
124 type is added to the type registry.
130 system: finalize-handler ()
132 Clean up whatever data structures the handler was using whien it is
133 removed from the type registry or when arxana shuts down.
139 system: add-plexus ()
148 system: reset-plexus (plex)
149 user: reset-plexus (plex)
151 Restore a plexus to its original state.
155 system: remove-plexus (plex)
156 user: remove-plexus (plex)
160 function reset-plexus ()
164 These operations act on the database as a whole.
166 *** download-en-masse
170 system: download-en-masse (plex)
171 user: download-en-masse ()
173 Produce a serialization of the database as quintuples.
179 system: upload-en-masse (plex)
180 user: upload-en-masse (plex)
182 Load a representation of a database as quintuples into memory.
188 system: add-en-masse (plex)
189 user: add-en-masse (plex)
191 Add multiple nemata given as list of quartuplets.
193 ** Individual operations
195 These operations act on individual items in the database.
201 system add-nema (plex src txt snk)
202 user: add-nema (src txt snk)
204 Enter a new nema to the database.
210 system: get-content (plex nema)
211 user: get-content (uid)
213 Return the content of the nema.
219 system: get-source (plex nema)
220 user: get-source (uid)
222 Return the source of the nema.
228 system: get-sink (plex nema)
231 Return the sink of the nema.
233 *** get-forward-links
237 system: get-forward-links (plex nema)
238 user: get-forward-links (uid)
240 Return all links having given object as source.
242 *** get-backward-links
246 system: get-backward-links (plex nema)
247 user: get-backward-links (uid)
249 Return all links having given object as sink.
255 system: update-content (plex nema txt)
256 user: update-content (uid txt)
258 Replace the content of the nema.
264 system: update-source (plex nema new-src)
265 user: update-source (uid new-src)
267 Replace the source of the nema.
273 system: update-sink (plex nema new-snk)
274 user: update-sink (uid new-snk)
276 Change the sink of the nema.
282 system: remove-nema (plex nema)
283 user: remove-nema (uid)
285 Remove this nema from the database.
289 These are commands for querying the database.
305 List of all valid uid's.
311 system: ground-p (plex nema)
314 Is this nema the ground?
320 system: source-p (plex x y)
323 Is the former nema the sink of the latter?
329 system: sink-p (plex x y)
332 Is the former nema the sink of the latter?
338 system: links-from (plex x y)
339 user: links-from (x y)
341 Return all links from nema x to nema y.
347 system: links-p (plex x y)
350 Does nema x link to nema y?"
356 system: triple-p (plex x y z)
357 user: triple-p (x y z)
359 Do the three items form a triplet?
367 Is this object a plexus?
371 These commands allow the end user to run loops over the database
372 without having to interact directly with the backend structures.
378 system: do-plexus (plex var body res)
379 user: do-plexus (var body res)
381 Loop over the current plexus binding var to each nema in turn,
382 evaluating the body, and returning res.
388 system: map-plexus (plex func)
389 user: map-plexus (func)
391 Evaluate func over all nemata in the plexus and return a list of the
398 system: filter-plexus (plex pred)
399 user: filter-plexus (pred)
401 Return a list of all nemata satisfying the condition pred.