public enum Text extends Enum<Text> implements JanusGraphPredicate
Enum Constant and Description |
---|
CONTAINS
Whether the text contains a given term as a token in the text (case insensitive)
|
CONTAINS_FUZZY
Whether the text contains a token is at X Levenshtein of a token (case insensitive)
with X=:
- 0 for strings of one or two characters
- 1 for strings of three, four or five characters
- 2 for strings of more than five characters
|
CONTAINS_PHRASE
Whether the text contains a given token sequence in the text (case insensitive)
|
CONTAINS_PREFIX
Whether the text contains a token that starts with a given term (case insensitive)
|
CONTAINS_REGEX
Whether the text contains a token that matches a regular expression
|
FUZZY
Whether the text is at X Levenshtein of a token (case sensitive)
with X=:
- 0 for strings of one or two characters
- 1 for strings of three, four or five characters
- 2 for strings of more than five characters
|
NOT_CONTAINS
Whether the text doesnt contain a given term as a token in the text (case insensitive)
|
NOT_CONTAINS_FUZZY
Whether the text doesnt contain a token is at X Levenshtein of a token (case insensitive)
with X=:
- 0 for strings of one or two characters
- 1 for strings of three, four or five characters
- 2 for strings of more than five characters
|
NOT_CONTAINS_PHRASE
Whether the text does not contains a given token sequence in the text (case insensitive)
|
NOT_CONTAINS_PREFIX
Whether the text doesnt contain a token that starts with a given term (case insensitive)
|
NOT_CONTAINS_REGEX
Whether the text doesnt contain a token that matches a regular expression
|
NOT_FUZZY
Whether the text is not at X Levenshtein of a token (case sensitive)
with X=:
- 0 for strings of one or two characters
- 1 for strings of three, four or five characters
- 2 for strings of more than five characters
|
NOT_PREFIX
Whether the text doesnt start with a given prefix (case sensitive)
|
NOT_REGEX
Whether the text fails a regular expression (case sensitive)
|
PREFIX
Whether the text starts with a given prefix (case sensitive)
|
REGEX
Whether the text matches a regular expression (case sensitive)
|
Modifier and Type | Field and Description |
---|---|
static Set<Text> |
HAS_CONTAINS |
Modifier and Type | Method and Description |
---|---|
static int |
getMaxEditDistance(String term)
Calculates the max fuzzy edit distance for a term given its length
- 0 for strings of one or two characters
- 1 for strings of three, four or five characters
- 2 for strings of more than five characters
|
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 |
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.
|
void |
preevaluate(Object value,
Object condition) |
static <V> JanusGraphP |
textContains(V value) |
static <V> JanusGraphP |
textContainsFuzzy(V value) |
static <V> JanusGraphP |
textContainsPhrase(V value) |
static <V> JanusGraphP |
textContainsPrefix(V value) |
static <V> JanusGraphP |
textContainsRegex(V value) |
static <V> JanusGraphP |
textFuzzy(V value) |
static <V> JanusGraphP |
textNotContains(V value) |
static <V> JanusGraphP |
textNotContainsFuzzy(V value) |
static <V> JanusGraphP |
textNotContainsPhrase(V value) |
static <V> JanusGraphP |
textNotContainsPrefix(V value) |
static <V> JanusGraphP |
textNotContainsRegex(V value) |
static <V> JanusGraphP |
textNotFuzzy(V value) |
static <V> JanusGraphP |
textNotPrefix(V value) |
static <V> JanusGraphP |
textNotRegex(V value) |
static <V> JanusGraphP |
textPrefix(V value) |
static <V> JanusGraphP |
textRegex(V value) |
static List<String> |
tokenize(String str) |
static Text |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Text[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
isValidCondition, test
getPredicateName
and, or
public static final Text CONTAINS
public static final Text NOT_CONTAINS
public static final Text CONTAINS_PREFIX
public static final Text NOT_CONTAINS_PREFIX
public static final Text CONTAINS_REGEX
public static final Text NOT_CONTAINS_REGEX
public static final Text PREFIX
public static final Text NOT_PREFIX
public static final Text REGEX
public static final Text NOT_REGEX
public static final Text FUZZY
public static final Text NOT_FUZZY
public static final Text CONTAINS_FUZZY
public static final Text NOT_CONTAINS_FUZZY
public static final Text CONTAINS_PHRASE
public static final Text NOT_CONTAINS_PHRASE
public static Text[] values()
for (Text c : Text.values()) System.out.println(c);
public static Text valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static int getMaxEditDistance(String term)
term
- public boolean isValidValueType(Class<?> clazz)
JanusGraphPredicate
For instance, the Cmp.GREATER_THAN
can only be applied to Comparable
values.
isValidValueType
in interface JanusGraphPredicate
public boolean hasNegation()
JanusGraphPredicate
Cmp.EQUAL
and Cmp.NOT_EQUAL
are negatives of each other.hasNegation
in interface JanusGraphPredicate
public JanusGraphPredicate negate()
JanusGraphPredicate
JanusGraphPredicate.hasNegation()
first.negate
in interface BiPredicate<Object,Object>
negate
in interface org.apache.tinkerpop.gremlin.process.traversal.PBiPredicate<Object,Object>
negate
in interface JanusGraphPredicate
public boolean isQNF()
JanusGraphPredicate
isQNF
in interface JanusGraphPredicate
public static <V> JanusGraphP textContains(V value)
public static <V> JanusGraphP textNotContains(V value)
public static <V> JanusGraphP textContainsPrefix(V value)
public static <V> JanusGraphP textNotContainsPrefix(V value)
public static <V> JanusGraphP textContainsRegex(V value)
public static <V> JanusGraphP textNotContainsRegex(V value)
public static <V> JanusGraphP textPrefix(V value)
public static <V> JanusGraphP textNotPrefix(V value)
public static <V> JanusGraphP textRegex(V value)
public static <V> JanusGraphP textNotRegex(V value)
public static <V> JanusGraphP textContainsFuzzy(V value)
public static <V> JanusGraphP textNotContainsFuzzy(V value)
public static <V> JanusGraphP textFuzzy(V value)
public static <V> JanusGraphP textNotFuzzy(V value)
public static <V> JanusGraphP textContainsPhrase(V value)
public static <V> JanusGraphP textNotContainsPhrase(V value)
Copyright © 2012–2023. All rights reserved.