8 - `Edge Rules Location <#EdgeRules-EdgeRulesLocation>`__
10 - `How to Interpret an Edge
11 Rule <#EdgeRules-HowtoInterpretanEdgeRule>`__
13 - `Mentally Constructing an
14 Edge <#EdgeRules-MentallyConstructinganEdge>`__
16 - `Quick guide for which is your in node and which is your out
17 node <#EdgeRules-Quickguideforwhichisyourinnod>`__
19 - `How to Read Multiplicity <#EdgeRules-HowtoReadMultiplicity>`__
21 - `Internal Edge Properties <#EdgeRules-InternalEdgeProperties>`__
23 - `Quick guide to our direction
24 syntax: <#EdgeRules-Quickguidetoourdirectionsynta>`__
29 The edge rules json files are located in
30 aai-common/aai-core/src/main/resources/dbedgerules.
32 How to Interpret an Edge Rule
33 -----------------------------
35 Mentally Constructing an Edge
36 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 Read the from/to/direction as a recipe for how to construct the edge.
46 | "multiplicity": "One2Many",
47 | "contains-other-v": "${direction}",
48 | "delete-other-v": "NONE",
49 | "SVC-INFRA": "!${direction}",
50 | "prevent-delete": "${direction}"
54 1. Start by drawing the "from" node.
56 2. Draw an edge off this node in the specified. So if it's OUT, point
57 the edge out away from the from node, if it's IN, point it into the
60 3. Draw the "to" node on the empty end of that edge.
62 Essentially, "from" and "to" do not imply direction. Think of them as
63 more like "NodeA" and "NodeB".
65 Quick guide for which is your in node and which is your out node
66 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
68 +-----------------+---------------+----------------+
69 | **direction** | **in node** | **out node** |
70 +=================+===============+================+
72 +-----------------+---------------+----------------+
74 +-----------------+---------------+----------------+
76 How to Read Multiplicity
77 ------------------------
79 Multiplicity, by itself, has nothing to do with the edge direction or
80 the from/to nodes. Think of it as a property of the edge label. It
81 defines how many IN edges of this label and how many OUT edges of this
82 label are allowed. The format we use is defined by Titan to be In2Out.
84 Ex: One2Many means on a node, there may be only one IN edge, and many
87 The from and to node types come in on top of this at the A&AI layer.
88 A&AI's code defines which node types may have those IN and OUT edges of
97 | "multiplicity": "One2Many",
98 | "contains-other-v": "${direction}",
99 | "delete-other-v": "NONE",
100 | "SVC-INFRA": "!${direction}",
101 | "prevent-delete": "${direction}"
105 In this example, the vserver gets the IN edge, so it may have only one
106 edge from a tenant. The tenant gets the OUT edge, so it may get many
109 Internal Edge Properties
110 ------------------------
112 A&AI uses the following edge properties for internal processing.
116 - This property defines whether or not the other vertex is contained
117 within another when rendering the resources view
119 - This property was previously known as isParent
121 - If contains-other-v=OUT, this means that the outVertex contains
124 - Or in other words, you can read contains-other-v=OUT as "I am an
125 edge, my OUT vertex contains my IN vertex"
129 - defines whether or not the other vertex is automatically included
132 - this property was previously known as hasDelTarget
134 - if delete-other-v=IN, this means that when deleting the inVertex
135 also delete the outVertex
139 - what direction should the traverser continue in when running
142 - if SVC-INFRA=OUT, when on the outVertex traverse to the inVertex
147 - defines whether or not this edge can be deleted from a particular
150 - if prevent-delete=IN, prevent the deletion of the inVertex of the
151 edge, allow the outVertex to be deleted.
153 - Or in other words, you can read it as "I am an edge, my IN vertex
156 Quick guide to our direction syntax:
157 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
159 ${direction} = same as value of "direction" property
161 !${direction} = opposite