load all-g
load ../../PLALib/load-jpla-parts

**** from scratch *************************************************************

(seq
(g2dexe graphics2d (supdate "g2d.pla.PLA" "developmental" (boolean true)))
(loadg2dlib graphics2d ../../PLALib/load-jg2dlib.lsp)

(initPLAeset maude graphics2d graphics2d)
(initKBManagerD graphics2d QQQ)            ---- puts up progress bar
(initDishes QQQ)

(initDKBnet RKB QQQ allDish)
(initKBgraph RKB)
(initOccMap RKB)

**** save kb and its graph
(save RKB-tkb-g.txt  C  entry tval tkb RKB)
(saveKBG RKB QQQ RKB-graph-g.txt)
(save RKB-occmap-g.txt  C  entry qval occmap RKB)


**** restore hand crafted evidence
(restore evidence.txt tmp entry)
(g2dexe graphics2d (seq (define evidencePath "") (invoke java.lang.System.err "println" (concat "evidencePath: " evidencePath))))
**** uncomeent if evidence is in datum files
***(g2dexe graphics2d (seq (define evidencePath (concat "file://" (sinvoke "g2d.util.IO" "resolveLinks" "./evidence"))) (invoke java.lang.System.err "println" (concat "evidencePath: " evidencePath))))


**** user preferences
(g2dexe graphics2d (seq (define useChattyLabels (boolean true))(invoke java.lang.System.err "println" useChattyLabels)))
(g2dexe graphics2d (seq (define explorerCheckBoxDefault (boolean true))(invoke java.lang.System.err "println" explorerCheckBoxDefault)))


**** initialize viewer kb
(createDefBasicUJKB JSONU-g RKB PROTEINOPS CHEMICALOPS GLYCANOPS)

**** use the second line if STM style model
(g2dexe graphics2d (seq (apply initJKB "RKB") (apply loadbasicjkb "RKB" "JSONU-g")))

(g2dexe graphics2d (seq (apply setModelName "RKB" "GlycoSTM")(apply logDev (concat "ModelName: " (apply getModelName "RKB"))) ))

(g2dexe graphics2d (seq (apply setGlycanLabelsKB "RKB") (invoke java.lang.System.err "println" "setGlycanLabelsKB")))

(startListener RKB graphreq graphics2d)
(defineKBGraph RKB graphics2d)              ---- stops progress bar

*** needed while Maude is in control of nids
(g2dexe graphics2d  (apply fixNids "RKB"))

)

