Search Predicates and Data Types
This page lists all of the comparison predicates that JanusGraph supports in global graph search and local traversals.
Compare enum specifies the following comparison predicates used for index query construction and used in the examples above:
gte(greater than or equal)
lte(less than or equal)
All comparison predicates are supported by String, numeric, Date and Instant data types.
Boolean and UUID data types support the
neq comparison predicates.
neq can be used on Boolean and UUID.
Text enum specifies the Text Search used to query for matching text or string values. We differentiate between two types of predicates:
- Text search predicates which match against the individual words inside a text string after it has been tokenized. These predicates are not case sensitive.
textContains: is true if (at least) one word inside the text string matches the query string
textContainsPrefix: is true if (at least) one word inside the text string begins with the query string
textContainsRegex: is true if (at least) one word inside the text string matches the given regular expression
textContainsFuzzy: is true if (at least) one word inside the text string is similar to the query String (based on Levenshtein edit distance)
- String search predicates which match against the entire string value
textPrefix: if the string value starts with the given query string
textRegex: if the string value matches the given regular expression in its entirety
textFuzzy: if the string value is similar to the given query string (based on Levenshtein edit distance)
See Text Search for more information about full-text and string search.
Geo enum specifies geo-location predicates.
geoIntersectwhich holds true if the two geometric objects have at least one point in common (opposite of
geoWithinwhich holds true if one geometric object contains the other.
geoDisjointwhich holds true if the two geometric objects have no points in common (opposite of
geoContainswhich holds true if one geometric object is contained by the other.
See Geo Mapping for more information about geo search.
The following query examples demonstrate some of the predicates on the tutorial graph.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
Data Type Support
While JanusGraph's composite indexes support any data type that can be stored in JanusGraph, the mixed indexes are limited to the following data types.
Additional data types will be supported in the future.
Geoshape Data Type
The Geoshape data type supports representing a point, circle, box, line, polygon, multi-point, multi-line and multi-polygon. Index backends currently support indexing points, circles, boxes, lines, polygons, multi-point, multi-line, multi-polygon and geometry collection. Geospatial index lookups are only supported via mixed indexes.
To construct a Geoshape use the following methods:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
In addition, when importing a graph via GraphSON the geometry may be represented by GeoJSON:
1 2 3 4 5 6 7 8 9 10
1 2 3 4
GeoJSON may be specified as Point, Circle, LineString or Polygon. Polygons must be closed. Note that unlike the JanusGraph API GeoJSON specifies coordinates as lng lat.
If you are using Elasticsearch then you can index properties with SET and LIST cardinality. For instance:
1 2 3 4 5 6 7 8 9 10 11 12