Functions for the definition and handling of the overarch model.
Functions for the definition and handling of the overarch model.
(aggregable-relation? m r1 r2)
Returns true, if the relations r1
and r2
are aggregable.
Returns true, if the relations `r1` and `r2` are aggregable.
(all-elements m)
Returns a set of all elements.
Returns a set of all elements.
(build-id->parent coll)
(build-id->parent m p coll)
Returns a map of child id to parent element for the elements in coll
.
Returns a map of child id to parent element for the elements in `coll`.
(build-registry elements)
Returns a map with the original elements
and a registry by id for lookups.
The map has the following shape:
:elements -> the given data :registry -> a map from id to element :parents -> a map from id to parent element :referrer -> a map from id to set of relations where the id is the referrer (:from) :referred -> a map from id to set of relations where the id is referred (:to)
Returns a map with the original `elements` and a registry by id for lookups. The map has the following shape: :elements -> the given data :registry -> a map from id to element :parents -> a map from id to parent element :referrer -> a map from id to set of relations where the id is the referrer (:from) :referred -> a map from id to set of relations where the id is referred (:to)
(children m e)
Returns the children of the element e
.
Returns the children of the element `e`.
(get-model-element m id)
Returns the model element with the given id
.
Returns the model element with the given `id`.
(get-model-elements m)
Returns the collection of model elements.
Returns the collection of model elements.
(get-parent-element m e)
Returns the parent of the element e
.
Returns the parent of the element `e`.
(id->element)
(id->element acc)
(id->element acc e)
Adds the association of the id of the element e
to the map acc
.
Adds the association of the id of the element `e` to the map `acc`.
(id->parent)
(id->parent acc)
(id->parent [res p] e)
Adds the association from the id of element e
to the parent p
to the map acc
.
Adds the association from the id of element `e` to the parent `p` to the map `acc`.
(id-set coll)
Returns a set of id's for the elements in coll
.
Returns a set of id's for the elements in `coll`.
(model-elements coll)
Filters the given collection of elements coll
for model elements.
Filters the given collection of elements `coll` for model elements.
(parent m e)
Returns the parent of the element e
.
Returns the parent of the element `e`.
(referred-id->rel)
(referred-id->rel acc)
(referred-id->rel acc r)
Adds the relation r
to the set associated with the id of the :to reference in the map acc
.
Adds the relation `r` to the set associated with the id of the :to reference in the map `acc`.
(referrer-id->rel)
(referrer-id->rel acc)
(referrer-id->rel acc e)
Adds the relation r
to the set associated with the id of the :from reference in the map acc
.
Adds the relation `r` to the set associated with the id of the :from reference in the map `acc`.
(related m coll)
Returns the related elements for the given collection of relations
Returns the related elements for the given collection of relations
(related-nodes m coll)
Returns the set of nodes of the model m
that are part of at least one relation in the coll
.
Returns the set of nodes of the model `m` that are part of at least one relation in the `coll`.
(relations-of-nodes m coll)
Returns the relations of the model m
connecting nodes from the given collection of model nodes.
Returns the relations of the model `m` connecting nodes from the given collection of model nodes.
(resolve-element m e)
Resolves the model element for the ref e
.
Resolves the model element for the ref `e`.
(resolve-ref m r)
Resolves the model element for the ref r
.
Resolves the model element for the ref `r`.
(traverse select-fn step-fn coll)
Traverses the coll
of elements and returns the elements selected by the select-fn
and transformed by the step-fn
.
select-fn - a predicate on the current element step-fn - a function with three signatures [], [acc] and [acc e]
The no args signature of the step-fn should return an empty accumulator, the one args signature extracts the result from the accumulator on return and the 2 args signature receives the accumulator and the current element and should add the transformed element to the accumulator.
Traverses the `coll` of elements and returns the elements selected by the `select-fn` and transformed by the `step-fn`. select-fn - a predicate on the current element step-fn - a function with three signatures [], [acc] and [acc e] The no args signature of the step-fn should return an empty accumulator, the one args signature extracts the result from the accumulator on return and the 2 args signature receives the accumulator and the current element and should add the transformed element to the accumulator.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close