1. Two Syntax Forms
2. Arc Insertion
Methods that create relationships between vertices accept a tuple of zero, one, two, or three elements in the arc= parameter.
Inserting or modifying a relationship will always create an outbound arc from the initial to the terminal vertex.
2.1. Arc Insertion Syntax
<arc> ::= ( [ <relationship> [, <modifier> [, <value> ] ] ] )
2.2. Arc Elements
| Parameter | Type | Default Value | Comment |
|---|---|---|---|
<relationship> |
<str> |
"__related__" |
Relationship type names are enumerated as integers internally in the graph, using a limited enumeration space. The maximum number of unique relationship types allowed per graph instance is 15616. An insertion attempt that exhausts the enumeration space will raise pyvgx.EnumerationError |
<modifier> |
Arc modifier constants are integer values. Although a method will perform the correct operation if the correct plain integer is used for the arc modifier, the method behavior is generally undefined if an invalid integer is passed. |
||
<value> |
<int> <float> |
<modifier> dependent |
The value type and range depend on the modifier. |
2.3. Shortcut Notation
arc = None
arc = ()
arc = ( None, <modifier>, <value> )
2.4. Automatic Value Assignment
arc = ( <relationship>, pyvgx.M_TMC )
arc = ( <relationship>, pyvgx.M_TMM )
# Increment arc value, or set it to <assign_value>
arc = ( <relationship>, pyvgx.M_CNT[, <assign_value>] )
# Accumulate arc value, or set it to <assign_value>
arc = ( <relationship>, pyvgx.M_ACC[, <assign_value>] )
3. Arc Filter
Query methods that support the arc= parameter accept a filter tuple of zero, one, two, three or five elements. (Four-element tuples are not valid since <condition> also requires <value>.)
The filter logic is inverted when wrapping the filter tuple within another tuple (False, filter).
3.1. Arc Filter Syntax
arcfilter ::= ( [ <relationship> [, <direction> [, <modifier> [, <condition>, <value> ] ] ] ] )
arcfilter ::= ( False, ( [ <relationship> [, <direction> [, <modifier> [, <condition>, <value> ] ] ] ] ) )
3.2. Arc Filter Elements
| Parameter | Type | Default Value | Comment |
|---|---|---|---|
<relationship> |
<str> |
None |
To match any relationship type use Wildcard syntax for partial string match is not supported. |
<direction> |
Query method dependent |
||
<modifier> |
|||
<condition> |
- |
Specifying a <condition> also requires <modifier> and <value> to be specified. The specified <modifier> cannot be pyvgx.M_ANY. |
|
<value> |
<numeric> or ( <numeric>, <numeric> ) |
- |
Depending on the <condition> code this may either be a single numeric value n or a 2-tuple (a, b). |
