Visit to a blind student's school🧑🦯🧑🦯(community medicine)
Triggers in Topic Maps
1. Triggers in Topic Maps TMRA 2009, November 13, Leipzig Lars Marius Garshol, <larsga@bouvet.no>
2. The use case Rani wants to be able to assign user-friendly name-based item identifiers to his topics ...
3. The solution An API where you can register a trigger A trigger consists of a tolog pattern a tolog update statement For every change to the topic map we test the changed topic against the pattern, if it matches, we run the update statement
4. Solving Rani’s problem The pattern topic-name(%topic%, $TN), not(item-identifier(%topic%, $II)) The update INSERT $topic ^ $ii . FROM topic-name(%topic%, $TN), value($TN, $VALUE), /* string transform to $ii */ $topic = %topic%
5. Implementation Register an event listener with the Ontopia event API For each change, find the topic affected The rest is just a trivial use of the tolog API
6. Issues How to register triggers? need to be persistent must be reliably present Interaction with transactions run all triggers on commit (before actual commit)? rollback commit if triggers fail? allow delay between commit and trigger execution?