Research Article
An Algorithm Tool for Atom Decomposition and Interaction: AD Visualiser
Input: An Ontology O | Output: A DAG g | (1) | ad←AtomicDecomposition(O); | (2) | ←DirectedGraph(ad); | (3) | graphNodes←0/; | (4) | topAtoms←topatoms ∈ ad | (5) | dep(atom)←atoms ∈ dependenciesofatom | (6) | foreachatom ∈ topAtoms do | (7) | graphNodes ← graphNodes ∪ atom; | (8) | end for | (9) | repeat | 10 | if atom/graphNodes then | (11) | graphNodes ← graphNodes ∪ atom; | (12) | endif | (13) | if dep(atom) = 0/then | (14) | for eachatomChild ∈ dep(atom)do | (15) | if atomChild/graphNodes then | (16) | graphNodes ← graphNodes ∪ atomChild; | (17) | endif | (18) | endfor | (19) | endif | (20) | until add all the atoms in graphNodes of ad | (21) | repeat | (22) | if ad.getDependencies(atom).size()! = 0then | (23) | foreachatomChild ∈ ad.getDependencies(atom)do | (24) | g.addEdge(atom, atomChild); | (25) | endfor | (26) | endif | (27) | until draw all the edges | (28) | show the result g; |
|