1. Value Conditions
# A value condition is a 2-tuple: (pyvgx.V_<x>, <value_or_range>)
# Conditions may use single-ended values or value ranges.
# Single-ended conditions are 2-tuples where the second item is
# a number or a string.
(pyvgx.V_*, n)
# Range conditions are 2-tuples where the second item is another
# 2-tuple of numbers representing the range.
(pyvgx.V_RANGE, (a, b))
(pyvgx.V_DYN_DELTA, (a, b))
(pyvgx.V_DYN_RATIO, (p, q))
Value conditions may be static or dynamic.
A static value condition compares the evaluated value directly to the constant given in the condition.
A dynamic value condition compares the evaluated value to the corresponding value one level earlier in the parent neighborhood during recursive neighborhood traversal.
2. Value Condition Comparison Constants
These constants are used to control the evaluation of value conditions in value filters.
| Constant | Description | Numeric Comparison | Comment |
|---|---|---|---|
Less-than or equal (≤) |
V_LTE, n |
||
Less-than (<) |
V_LT, n |
||
Greater-than or equal (≥) |
V_GTE, n |
||
Greater-than (>) |
V_GT, n |
||
Equal (=) |
V_EQ, n V_EQ, str |
Numeric String |
|
Not equal (≠) |
V_NEQ, n V_NEQ, str |
Numeric String |
|
Within set / interval ( ∈ [a,b] ) |
V_RANGE, (a, b) |
Both endpoints included |
|
Outside set / interval ( ∉ [a,b] ) |
V_NRANGE, (a, b) |
Both endpoints excluded |
|
Dynamic less-than or equal (≤) |
V_DYN_LTE [, n] |
See * note below |
|
Dynamic less-than (<) |
V_DYN_LT [, n] |
See * note below |
|
Dynamic greater-than or equal (≥) |
V_DYN_GTE [, n] |
See * note below |
|
Dynamic greater-than (>) |
V_DYN_GT [, n] |
See * note below |
|
Dynamic equal (=) |
V_DYN_EQ [, n] |
See * note below |
|
Dynamic not equal (≠) |
V_DYN_NEQ [, n] |
See * note below |
|
Dynamic value deviation (±) by delta |
V_DYN_DELTA, (a, b) |
See * note below |
|
Dynamic value deviation (±) by ratio |
V_DYN_RATIO, (p, q) |
See * note below |
| *) Dynamic value comparison matches the evaluated value against another corresponding value previously found during multi-level neighborhood traversal. A corresponding value is a value of the same kind (e.g. arc value). The current corresponding values which are made available for dynamic comparison are updated and in effect every time graph traversal continues in an extended (next) neighborhood. Dynamic matching is always performed against the current corresponding value from the immediate previous neighborhood. The optional [, n] is an offset (positive or negative) added to the dynamic value from the previous neighborhood before evaluating the condition. |
2.1. pyvgx.V_LTE
pyvgx.V_LTE = 4
Less-than or equal-to value condition.
Match if inspected value ≤ n.
Example:
<value> = ( pyvgx.V_LTE, n ) # value <= n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_LTE, n ) # arc value <= n
# Does "A" connect to anything with an integer value
# less than or equal to 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_LTE, 1000) )
2.2. pyvgx.V_LT
pyvgx.V_LT = 10
Less-than value condition.
Match if inspected value < n.
Example:
<value> = ( pyvgx.V_LT, n ) # value < n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_LT, n ) # arc value < n
# Does "A" connect to anything with an integer value
# less than 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_LT, 1000) )
2.3. pyvgx.V_GTE
pyvgx.V_GTE = 8
Greater-than or equal-to value condition.
Match if inspected value ≥ n.
Example:
<value> = ( pyvgx.V_GTE, n ) # value >= n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_GTE, n ) # arc value >= n
# Does "A" connect to anything with an integer value
# greater than or equal to 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_GTE, 1000) )
2.4. pyvgx.V_GT
pyvgx.V_GT = 6
Greater-than value condition.
Match if inspected value > n.
Example:
<value> = ( pyvgx.V_GT, n ) # value > n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_GT, n ) # arc value > n
# Does "A" connect to anything with an integer value
# greater than 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_GT, 1000) )
2.5. pyvgx.V_EQ
pyvgx.V_EQ = 12
Equal-to value condition.
Match if inspected value = n.
Example:
<value> = ( pyvgx.V_EQ, n ) # value == n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_EQ, n ) # arc value == n
# Does "A" connect to anything with an integer value
# equal to 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_EQ, 1000) )
2.6. pyvgx.V_NEQ
pyvgx.V_NEQ = 14
Not-equal-to value condition.
Match if inspected value ≠ n.
Example:
<value> = ( pyvgx.V_NEQ, n ) # value != n
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_NEQ, n ) # arc value != n
# Does "A" connect to anything with an integer value
# not equal to 1000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_NEQ, 1000) )
2.7. pyvgx.V_RANGE
pyvgx.V_RANGE = 16
Value within range condition.
Match if inspected value ∈ [a, b]. (Both endpoints included.)
Example:
# value in interval [a, b]
<value> = ( pyvgx.V_RANGE, (a, b) )
# arc value in interval [a, b]
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_RANGE, (a, b) )
# Does "A" connect to anything with an integer value
# between 1000 and 2000, both included?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_RANGE, (1000,2000)) )
2.8. pyvgx.V_NRANGE
pyvgx.V_NRANGE = 18
Value outside range condition.
Match if inspected value ∉ [a, b]. (Both endpoints excluded.)
Example:
# value outside interval [a, b]
<value> = ( pyvgx.V_NRANGE, (a, b) )
# arc value outside interval [a, b]
<arc> = ( <rel>, <dir>, <mod>, pyvgx.V_NRANGE, (a, b) )
# Does "A" connect to anything with an integer value
# less than 1000 or greater than 2000?
graph.Adjacent( "A", arc=("*", D_OUT, M_INT, V_NRANGE, (1000,2000)) )
2.9. pyvgx.V_DYN_LTE
pyvgx.V_DYN_LTE = 26
Dynamically less-than or equal-to value comparison.
# arc value <= previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_LTE )
# arc value <= previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_LTE, n )
Match if the inspected arc value v is less than or equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v ≤ p, or optionally v ≤ p + n.
2.10. pyvgx.V_DYN_LT
pyvgx.V_DYN_LT = 29
Dynamically less-than value comparison.
# arc value < previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_LT )
# arc value < previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_LT, n )
Match if the inspected arc value v is less than the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v < p, or optionally v < p + n.
2.11. pyvgx.V_DYN_GTE
pyvgx.V_DYN_GTE = 28
Dynamically greater-than or equal-to value comparison.
# arc value >= previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_GTE )
# arc value >= previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_GTE, n )
Match if the inspected arc value v is greater than or equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v ≥ p, or optionally v ≥ p + n.
2.12. pyvgx.V_DYN_GT
pyvgx.V_DYN_GT = 27
Dynamically greater-than value comparison.
# arc value > previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_GT )
# arc value > previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_GT, n )
Match if the inspected arc value v is greater than the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v > p, or optionally v > p + n.
2.13. pyvgx.V_DYN_EQ
pyvgx.V_DYN_EQ = 30
Dynamically equal-to value comparison.
# arc value == previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_EQ )
# arc value == previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_EQ, n )
Match if the inspected arc value v is equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v = p, or optionally v = p + n.
2.14. pyvgx.V_DYN_NEQ
pyvgx.V_DYN_NEQ = 31
Dynamically not-equal-to value comparison.
# arc value != previous neighborhood's arc value
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_NEQ )
# arc value != previous neighborhood's arc value + n
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_NEQ, n )
Match if the inspected arc value v is not equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal, with optional offset n.
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v ≠ p, or optionally v ≠ p + n.
2.15. pyvgx.V_DYN_DELTA
pyvgx.V_DYN_DELTA = 24
Dynamically-within value deviation (additive).
# arc value v matches previous neighborhood's arc value p
# if v in the interval [p+a, p+b]
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_DELTA, (a, b) )
Match if the inspected arc value v is approximately equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal. The approximation interval is defined as [p+a, p+b].
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v ∈ [p+a, p+b], end points included.
2.16. pyvgx.V_DYN_RATIO
pyvgx.V_DYN_RATIO = 25
Dynamically-within value deviation (multiplicative).
# arc value v matches previous neighborhood's arc value p
# if v in the interval [p*a, p*b]
<arc value> = ( <rel>, <dir>, <mod>, pyvgx.V_DYN_DELTA, (a, b) )
Match if the inspected arc value v is approximately equal to the arc value p that led to the previous neighborhood during recursive neighborhood traversal. The approximation interval is defined as [p•a, p•b].
Modifiers must be the same for value comparison to evaluate to true.
If mod1 = mod2 dynamically match:
(A) -[ <rel>, mod2, v ]→ (B)
with previous arc:
(*) -[ <rel>, mod1, p ]→ (A)
if v ∈ [p•a, p•b], end points included.
