Functions for the definition and handling of the overarch model.
The loaded overarch working model is a map with these keys:
:input-elements -> the given data :nodes -> the set of nodes (incl. child nodes) :relations -> the set of relations (incl. contains relations) :views -> the set of views :themes -> the set of themes :id->element -> a map from id to element (nodes, relations and views) :id->parent -> a map from id to parent element :referrer-id->relations -> a map from id to set of relations where the id is the referrer (:from) :referred-id->relations -> a map from id to set of relations where the id is referred (:to)
Functions for the definition and handling of the overarch model. The loaded overarch working model is a map with these keys: :input-elements -> the given data :nodes -> the set of nodes (incl. child nodes) :relations -> the set of relations (incl. contains relations) :views -> the set of views :themes -> the set of themes :id->element -> a map from id to element (nodes, relations and views) :id->parent -> a map from id to parent element :referrer-id->relations -> a map from id to set of relations where the id is the referrer (:from) :referred-id->relations -> a map from id to set of relations where the id is referred (:to)
(->relational-model)
(->relational-model [res ctx])
(->relational-model [res ctx] e)
Step function for the conversion of the hierachical input model into a relational model of nodes, relations and views.
Step function for the conversion of the hierachical input model into a relational model of nodes, relations and views.
(aggregable-relation? model r1 r2)
Returns true, if the relations r1
and r2
are aggregable.
Returns true, if the relations `r1` and `r2` are aggregable.
(all-elements model)
Returns a set of all elements.
Returns a set of all elements.
(all-nodes model elements)
Returns the set of all nodes, including descendants, of the elements
.
Returns the set of all nodes, including descendants, of the `elements`.
(ancestor-node? model e c)
Returns true, if c
is an ancestor of node e
in the model
.
Returns true, if `c` is an ancestor of node `e` in the `model`.
(ancestor-nodes model e)
Returns the ancestor nodes of the model node e
in the model
.
Returns the ancestor nodes of the model node `e` in the `model`.
(ancestor-of? model v e)
Returns true, if e
is an ancestor of the node with id v
in the model
.
Returns true, if `e` is an ancestor of the node with id `v` in the `model`.
(build-model coll)
Builds the working model from the input coll
of elements.
Builds the working model from the input `coll` of elements.
(child-check? model v e)
Returns true, if the check for e
is a child in the model
equals the boolean value v
.
Returns true, if the check for `e` is a child in the `model` equals the boolean value `v`.
(child? model v e)
Returns true, if e
is a child of the node with id v
in the model
.
Returns true, if `e` is a child of the node with id `v` in the `model`.
(criteria-predicate model criteria)
Returns a filter predicate for the given criteria
.
The resulting predicate is a logical conjunction (and) of the predicates for
each criterium.
Returns a filter predicate for the given `criteria`. The resulting predicate is a logical conjunction (and) of the predicates for each criterium.
(criteria-predicates model criteria)
Returns a filter predicate for the given criteria
.
If a vector of criteria maps is given, the resulting predicate is a logical
disjunction (or) of the predicates.
Returns a filter predicate for the given `criteria`. If a vector of criteria maps is given, the resulting predicate is a logical disjunction (or) of the predicates.
(criterium-predicate model [k v])
Returns a predicate for the given criterium
.
Returns a predicate for the given `criterium`.
(descendant-node? model e c)
Returns true, if c
is a descendant of e
.
Returns true, if `c` is a descendant of `e`.
(descendant-nodes model e)
Returns the set of descendants of the node e
.
Returns the set of descendants of the node `e`.
(descendant-of? model v e)
Returns true, if e
is a descendant of the node with id v
in the model
.
Returns true, if `e` is a descendant of the node with id `v` in the `model`.
(filter-xf model criteria)
Returns a filter transducer for the given criteria
.
Returns a filter transducer for the given `criteria`.
(from-name model rel)
Returns the name of the from reference of the relation.
Returns the name of the from reference of the relation.
(input-elements model)
Returns the collection of elements.
Returns the collection of elements.
(model-element model id)
Returns the model element with the given id
.
Returns the model element with the given `id`.
(model-elements model)
Returns the collection of model elements.
Returns the collection of model elements.
(nodes model)
Returns the collection of model nodes.
Returns the collection of model nodes.
(parent model e)
Returns the parent of the model node e
.
Returns the parent of the model node `e`.
(parent-of-relation p-id e-id)
Returns a parent-of relation for parent p
and element e
.
Returns a parent-of relation for parent `p` and element `e`.
(parent? model v e)
Returns true if v
is the parent of e
Returns true if `v` is the parent of `e`
(referred-by? model v e)
Returns true, if e
is referred by the node with id v
in the model
.
Returns true, if `e` is referred by the node with id `v` in the `model`.
(referred-check? model v e)
Returns true if the check for e
as referred to equals the boolean value v
Returns true if the check for `e` as referred to equals the boolean value `v`
(refers-check? model v e)
Returns true if the check for e
as a referrer equals the boolean value v
Returns true if the check for `e` as a referrer equals the boolean value `v`
(refers-to? model v e)
Returns true, if the node with id v
refers to e
in the model
.
Returns true, if the node with id `v` refers to `e` in the `model`.
(related model coll)
Returns the related elements for the given collection of relations
Returns the related elements for the given collection of relations
(related-nodes model 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 model)
Returns the collection of model relations.
Returns the collection of model relations.
(relations-of-nodes model 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 model e)
Resolves the model element for the ref e
.
Resolves the model element for the ref `e`.
(resolve-id model id)
Resolves the model element for the id
Resolves the model element for the `id`
(resolve-ref model r)
Resolves the model element for the ref r
.
Resolves the model element for the ref `r`.
(root-nodes model elements)
Returns the set of root nodes of the elements
.
The root nodes are not contained as descendants in any of the element nodes.
Returns the set of root nodes of the `elements`. The root nodes are not contained as descendants in any of the element nodes.
(themes model)
Returns the set of themes from the model
.
Returns the set of themes from the `model`.
(to-name model rel)
Returns the name of the from reference of the relation.
Returns the name of the from reference of the relation.
(traverse-with-model model step-fn coll)
(traverse-with-model model select-fn step-fn coll)
Recursively traverses the coll
of elements and returns the elements (selected
by the optional 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.
Recursively traverses the `coll` of elements and returns the elements (selected by the optional `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.
(unresolved-refs-xf model)
Returns a transducer to extract unresolved refs
Returns a transducer to extract unresolved refs
(update-acc acc p e)
Update the accumulator acc
of the model with the element e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the element `e` in the context of the parent `p` (if given).
(views model)
Returns the set of views from the model
.
Returns the set of views from the `model`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close