Constraint uses
Constraints compare one vertex or edge in the query to another vertex or edge.
Constraints apply to the query as a whole, rather than to a specific vertex, edge, or subquery.
Identity constraints compare the identity of the corresponding database objects.
Attribute constraints compare attribute values for the corresponding database objects.
Constraints can compare either identity or attributes; mixing is not allowed.
Identity constraints
Identity constraints can use the comparison operators
=, <>,
<, <=,
>, and >=.
Identity constraints are commonly used to ensure that the same database element does not match two different query elements.
Another typical use for identity constraints is to remove equivalent subgraphs (mirror matches) from a query’s results.
Attribute constraints
Attribute constraints can use the comparison operators
=, <>,
<, <=,
>, and >=.
The attributes on both sides of a constraint must be comparable types, but need not be the same attribute.
A constraint is satisfied if any member of the set of attribute values for the corresponding database entities satisfies the constraint.
When an object or link has multiple values for an attribute, different constraints may match different values resulting in matching apparently contradictory constraints.
Constraints and annotations
QGraph prohibits constraints between two annotated query elements.
QGraph admits one exception to the prohibition against constraints between two annotated elements: Constraints between an annotated vertex and its adjacent annotated edge are permitted.
Implementation restrictions
Proximity does not permit comparing object and edge attributes in the same constraint.
Proximity limits the allowed boolean operations on
constraints. Multiple constraints are always ANDed
together. You cannot combine constraints with OR
or negate constraints with NOT in Proximity.
Proximity allows you to compare
DBL with FLT and INT, and
FLT with INT.
Proximity does not permit any constraint between annotated elements, even those between an annotated vertex and its adjacent annotated edge, which are allowed in QGraph.
Proximity prohibits constraints between two edges if one of
them is annotated, with the exception that such constraints are
allowed if the vertex adjacent to the annotated edge is itself
annotated with [0..] or
[0...
j]