Functions to read and build the working model from overarch input models.
The built model is a map with the following keys
Key | Description |
---|---|
Relation keys | |
:nodes | the set of all nodes |
:relations | the set of all relations |
:views | the set of views |
:themes | the set of themes |
Index keys | |
:id->element | a map from id to element (nodes, relations and views) |
:id->parent-id | a map from id to parent node id |
:id->children | a map from id to a vector of contained nodes (deprecated) |
: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) |
Problem keys | |
:problems | the set of problems found during model building |
The input model is transformed by
Functions to read and build the working model from overarch input models. The built model is a map with the following keys | Key | Description |-------------------------|------------- | **Relation keys** | | :nodes | the set of all nodes | :relations | the set of all relations | :views | the set of views | :themes | the set of themes | **Index keys** | | :id->element | a map from id to element (nodes, relations and views) | :id->parent-id | a map from id to parent node id | :id->children | a map from id to a vector of contained nodes (deprecated) | :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) | **Problem keys** | | :problems | the set of problems found during model building The input model is transformed by * computing missing ids, if possible * converting the node hierarchies to :contained-in relations
(->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.
res
accumulates the result and the context ctx
acts as the stack of the recusive calls.
Step function for the conversion of the hierachical input model into a relational model of nodes, relations and views. `res` accumulates the result and the context `ctx` acts as the stack of the recusive calls.
(add-node acc p e)
Update the accumulator acc
of the model with the node e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the node `e` in the context of the parent `p` (if given).
(add-reference acc p e)
Update the accumulator acc
of the model with the reference e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the reference `e` in the context of the parent `p` (if given).
(add-relation acc p e)
Update the accumulator acc
of the model with the relation e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the relation `e` in the context of the parent `p` (if given).
(add-theme acc p e)
Update the accumulator acc
of the model with the view e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the view `e` in the context of the parent `p` (if given).
(add-view acc p e)
Update the accumulator acc
of the model with the view e
in the context of the parent p
(if given).
Update the accumulator `acc` of the model with the view `e` in the context of the parent `p` (if given).
(contained-in-relation p-id e-id)
Returns a contained-in relation for parent p
and element e
.
Returns a contained-in relation for parent `p` and element `e`.
(input-child? e p)
Returns true, if element e
is a child of model element p
in the input model.
Returns true, if element `e` is a child of model element `p` in the input model.
(main-node? node)
Returns true if the node
is the main node.
Returns true if the `node` is the main node.
(merge-nodes)
(merge-nodes node)
(merge-nodes node new-node)
Returns a node that is the merge of node
and new-node
.
Returns a node that is the merge of `node` and `new-node`.
(merge-relations)
(merge-relations relation)
(merge-relations relation new-relation)
Returns a relation that is the merge of relation
and new-relation
.
Returns a relation that is the merge of `relation` and `new-relation`.
(merge-views)
(merge-views view)
(merge-views view new-view)
Returns a view that is the merge of view
and new-view
.
Returns a view that is the merge of `view` and `new-view`.
(prepare-node e p)
Returns the node e
with the id set. Generates the id from e
s name and the parent p
s id.
Returns the node `e` with the id set. Generates the id from `e`s name and the parent `p`s id.
(prepare-relation e)
Returns the relation e
with the id set. Generates the id from e
s name and the parent p
s id.
Returns the relation `e` with the id set. Generates the id from `e`s name and the parent `p`s id.
(prepare-view e)
Returns the prepered view e
with the id set. Generates the id from e
s name.
Returns the prepered view `e` with the id set. Generates the id from `e`s name.
(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).
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close