public abstract class BaseVertexCentricQueryBuilder<Q extends BaseVertexQuery<Q>> extends Object implements BaseVertexQuery<Q>
BaseVertexQuery
, optimizes the query and compiles the result into a BaseVertexCentricQuery
which
is then executed by one of the extending classes.Modifier and Type | Field and Description |
---|---|
protected JanusGraphVertex |
adjacentVertex
The vertex to be used for the adjacent vertex constraint.
|
protected List<PredicateCondition<String,JanusGraphRelation>> |
constraints
The constraints added to this query.
|
protected org.apache.tinkerpop.gremlin.structure.Direction |
dir
The direction of this query.
|
protected int |
limit
The limit of this query.
|
protected OrderList |
orders
The order in which the relations should be returned.
|
protected String[] |
types
The relation types (labels or keys) to query for.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseVertexCentricQueryBuilder(SchemaInspector schemaInspector) |
Modifier and Type | Method and Description |
---|---|
Q |
adjacent(org.apache.tinkerpop.gremlin.structure.Vertex vertex)
Restricts this query to only those edges that point to the given vertex.
|
Q |
direction(org.apache.tinkerpop.gremlin.structure.Direction d)
Query only for relations in the given direction.
|
protected RelationType |
getSingleType() |
protected abstract Q |
getThis() |
protected abstract JanusGraphVertex |
getVertex(long vertexid) |
Q |
has(String key)
Query for edges or properties that have defined property with the given key
|
Q |
has(String key,
JanusGraphPredicate predicate,
Object value) |
Q |
has(String type,
Object value)
Query only for edges or properties that have an incident property or unidirected edge matching the given value.
|
Q |
hasNot(String key)
Query for edges or properties that DO NOT have a defined property with the given key
|
Q |
hasNot(String key,
Object value)
Identical to
BaseVertexQuery.has(String, Object) but negates the condition, i.e. |
protected boolean |
hasSingleType() |
protected boolean |
hasTypes() |
<T extends Comparable<?>> |
interval(String key,
T start,
T end)
Query for those edges or properties that have a property for the given key
whose values lies in the interval by [start,end).
|
protected boolean |
isImplicitKeyQuery(RelationCategory returnType)
Whether this query is asking for the value of an
ImplicitKey . |
Q |
keys(String... keys)
Query for only those properties having one of the given property keys.
|
Q |
labels(String... labels)
Query for only those edges matching one of the given edge labels.
|
Q |
limit(int limit)
Sets the retrieval limit for this query.
|
Q |
orderBy(String keyName,
org.apache.tinkerpop.gremlin.process.traversal.Order order)
Orders the relation results of this query according
to their property for the given key in the given order (increasing/decreasing).
|
Q |
type(RelationType type) |
Q |
types(RelationType... types)
Query for only those relations matching one of the given relation types.
|
Q |
types(String... types)
Query for only those relations matching one of the given relation types.
|
protected org.apache.tinkerpop.gremlin.structure.Direction dir
protected String[] types
protected List<PredicateCondition<String,JanusGraphRelation>> constraints
protected JanusGraphVertex adjacentVertex
protected OrderList orders
protected int limit
protected BaseVertexCentricQueryBuilder(SchemaInspector schemaInspector)
protected abstract Q getThis()
protected abstract JanusGraphVertex getVertex(long vertexid)
public Q adjacent(org.apache.tinkerpop.gremlin.structure.Vertex vertex)
BaseVertexQuery
adjacent
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
public Q has(String type, Object value)
BaseVertexQuery
EdgeLabel.isUnidirected()
and the query is restricted to edges or properties having an incident unidirectional edge pointing to the value which is
expected to be a JanusGraphVertex
.has
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
type
- JanusGraphType namevalue
- Value for the property of the given key to match, or vertex to point unidirectional edge topublic Q hasNot(String key, Object value)
BaseVertexQuery
BaseVertexQuery.has(String, Object)
but negates the condition, i.e. matches those edges or properties
that DO NOT satisfy this property condition.hasNot
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
public Q has(String key)
BaseVertexQuery
has
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
public Q hasNot(String key)
BaseVertexQuery
hasNot
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
public Q has(String key, JanusGraphPredicate predicate, Object value)
has
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
public <T extends Comparable<?>> Q interval(String key, T start, T end)
BaseVertexQuery
interval
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
key
- property keystart
- value defining the start of the interval (inclusive)end
- value defining the end of the interval (exclusive)public Q types(RelationType... types)
BaseVertexQuery
types
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
types
- relation types to query forpublic Q labels(String... labels)
BaseVertexQuery
labels
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
labels
- edge labels to query forpublic Q keys(String... keys)
BaseVertexQuery
keys
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
keys
- property keys to query forpublic Q type(RelationType type)
public Q types(String... types)
BaseVertexQuery
types
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
types
- relation types to query forpublic Q direction(org.apache.tinkerpop.gremlin.structure.Direction d)
BaseVertexQuery
direction
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
d
- Direction to query forpublic Q limit(int limit)
BaseVertexQuery
limit
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
limit
- maximum number of relations to retrieve for this querypublic Q orderBy(String keyName, org.apache.tinkerpop.gremlin.process.traversal.Order order)
BaseVertexQuery
orderBy
in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
keyName
- The key of the properties on which to orderorder
- the ordering directionprotected final boolean hasTypes()
protected final boolean hasSingleType()
protected final RelationType getSingleType()
protected final boolean isImplicitKeyQuery(RelationCategory returnType)
ImplicitKey
.
Handling of implicit keys is completely distinct from "normal" query execution and handled extra
for completeness reasons.returnType
- Copyright © 2012–2017. All rights reserved.