public interface JanusGraphPredicate extends org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Object,Object>
PBiPredicate
which marks all the predicates that are natively supported by
JanusGraph and known to the query optimizer. Contains some custom methods that JanusGraph needs for
query answering and evaluation.
This class contains a subclass used to convert Tinkerpop's PBiPredicate
implementations to the corresponding JanusGraph predicates.
Modifier and Type | Method and Description |
---|---|
boolean |
hasNegation()
Whether this predicate has a predicate that is semantically its negation.
|
boolean |
isQNF()
Returns true if this predicate is in query normal form.
|
boolean |
isValidCondition(Object condition)
Whether the given condition is a valid condition for this predicate.
|
boolean |
isValidValueType(Class<?> clazz)
Whether the given class is a valid data type for a value to which this predicate may be applied.
|
JanusGraphPredicate |
negate()
Returns the negation of this predicate if it exists, otherwise an exception is thrown.
|
boolean |
test(Object value,
Object condition) |
getPredicateName
and, or
boolean isValidCondition(Object condition)
For instance, the Cmp.GREATER_THAN
would require that the condition is comparable and not null.
condition
- boolean isValidValueType(Class<?> clazz)
For instance, the Cmp.GREATER_THAN
can only be applied to Comparable
values.
clazz
- boolean hasNegation()
Cmp.EQUAL
and Cmp.NOT_EQUAL
are negatives of each other.JanusGraphPredicate negate()
hasNegation()
first.boolean isQNF()
Copyright © 2012–2023. All rights reserved.