Skip to content

Commit

Permalink
Improve docstring of delete-graph-element-class
Browse files Browse the repository at this point in the history
  • Loading branch information
tsdh committed Oct 1, 2015
1 parent 4a26085 commit 6b2d72a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/funnyqt/coevo/tg.clj
Expand Up @@ -152,15 +152,18 @@ with name `gcname`."

(defn delete-graph-element-class!
"Deletes the GraphElementClass with qualified name `qname` in the schema of
graph `g`. All its subclasses will be deleted, too, and likewise all
instances in the graph. Additionally, the traceability information
graph `g`. VertexClasses can only be deleted if there are no incident
EdgeClasses anymore. All its subclasses will be deleted, too, and likewise
all instances in the graph. Additionally, the traceability information
wrt. class and its subclasses is purged from `funnyqt.extensional/*arch*` and
`funnyqt.extensional/*img*`."
[g qname]
(let [aec (get-aec g qname)]
(if (or (tg/vertex-class? aec) (tg/edge-class? aec))
(let [els (vec (element-seq g aec))
all-subs (conj (seq (.getAllSubClasses ^GraphElementClass aec)) aec)]
;; JGraLab already takes care that one cannot delete a VC which still
;; has connected ECs.
(with-open-schema g
(.delete ^GraphElementClass aec))
(when (bound? #'e/*arch*)
Expand Down

0 comments on commit 6b2d72a

Please sign in to comment.