public abstract class AbstractVertexCentricQueryBuilder<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 | Class and Description |
|---|---|
protected class |
AbstractVertexCentricQueryBuilder.RelationConstructor |
protected static interface |
AbstractVertexCentricQueryBuilder.ResultConstructor<Q> |
protected class |
AbstractVertexCentricQueryBuilder.VertexConstructor |
protected class |
AbstractVertexCentricQueryBuilder.VertexIdConstructor |
| Modifier and Type | Field and Description |
|---|---|
protected StandardTitanTx |
tx
Transaction in which this query is executed
|
| Constructor and Description |
|---|
AbstractVertexCentricQueryBuilder(StandardTitanTx tx) |
| Modifier and Type | Method and Description |
|---|---|
Q |
adjacent(TitanVertex vertex)
Restricts this query to only those edges that point to the given vertex.
|
protected List<InternalVertex> |
allRepresentatives(InternalVertex partitionedVertex) |
protected VertexCentricQuery |
constructQuery(InternalVertex vertex,
BaseVertexCentricQuery baseQuery)
Constructs a
VertexCentricQuery for this query builder. |
protected BaseVertexCentricQuery |
constructQuery(RelationCategory returnType) |
protected QueryDescription |
describe(int numVertices,
RelationCategory returnType) |
QueryDescription |
describeForEdges()
Returns a description of this query for edges as a
QueryDescription object. |
QueryDescription |
describeForProperties()
Returns a description of this query for properties as a
QueryDescription object. |
QueryDescription |
describeForRelations() |
Q |
direction(com.tinkerpop.blueprints.Direction d)
Query only for relations in the given direction.
|
protected VertexList |
edges2VertexIds(Iterable<TitanEdge> edges,
TitanVertex other) |
protected static Iterable<TitanVertex> |
edges2Vertices(Iterable<TitanEdge> edges,
TitanVertex other) |
protected Iterable<TitanRelation> |
executeImplicitKeyQuery(InternalVertex v)
If
isImplicitKeyQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory) is true,
this method provides the result set for the query based on the evaluation of the ImplicitKey. |
protected Iterable<TitanRelation> |
executeRelations(InternalVertex vertex,
BaseVertexCentricQuery baseQuery) |
VertexList |
executeVertexIds(InternalVertex vertex,
BaseVertexCentricQuery baseQuery) |
Iterable<TitanVertex> |
executeVertices(InternalVertex vertex,
BaseVertexCentricQuery baseQuery) |
protected RelationType |
getSingleType() |
protected abstract Q |
getThis() |
Q |
has(EdgeLabel label,
TitanVertex vertex)
Query only for edges or properties that have a unidirected edge pointing to the given vertex
It is expected that this label is unidirected (
EdgeLabel.isUnidirected()
and the query is restricted to edges or properties having an incident unidirectional edge pointing to the given vertex. |
Q |
has(PropertyKey key,
Object value)
Query only for edges or properties that have an incident property matching the given value.
|
Q |
has(PropertyKey key,
com.tinkerpop.blueprints.Predicate predicate,
Object value)
Query only for those edges or properties which have a property for the given key that satisfies the specified
predicate relationship to the provided value.
|
Q |
has(String key)
Query for edges or properties that have defined property with the given key
|
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 |
has(String key,
com.tinkerpop.blueprints.Predicate predicate,
Object value)
Query only for those edges or properties which have a property for the given key that satisfies the specified
predicate relationship to the provided value.
|
<T extends Comparable<T>> |
has(String key,
T value,
com.tinkerpop.blueprints.Query.Compare compare)
Deprecated.
|
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(PropertyKey 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).
|
<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. |
protected boolean |
isPartitionedVertex(InternalVertex vertex) |
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 |
noPartitionRestriction()
Removes any query partition restriction for this query
|
Q |
orderBy(PropertyKey key,
Order order)
Orders the relation results of this query according
to their property for the given key in the given order (increasing/decreasing).
|
Q |
orderBy(String key,
Order order)
Orders the relation results of this query according
to their property for the given key in the given order (increasing/decreasing).
|
Q |
queryOnlyLoaded()
Calling this method will cause this query to only included loaded (i.e.
|
Q |
system()
Restricts the result set of this query to only system types.
|
Q |
type(RelationType type) |
Q |
types(RelationType... types)
Query for only those relations matching one of the given relation types.
|
protected boolean |
useSimpleQueryProcessor(BaseVertexCentricQuery query,
InternalVertex... vertices) |
protected final StandardTitanTx tx
public AbstractVertexCentricQueryBuilder(StandardTitanTx tx)
protected abstract Q getThis()
public Q noPartitionRestriction()
public Q system()
public Q queryOnlyLoaded()
public Q adjacent(TitanVertex vertex)
BaseVertexQueryadjacent in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>public Q has(PropertyKey key, Object value)
BaseVertexQueryhas in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>key - keyvalue - Value for the property of the given key to matchpublic Q has(EdgeLabel label, TitanVertex vertex)
BaseVertexQueryEdgeLabel.isUnidirected()
and the query is restricted to edges or properties having an incident unidirectional edge pointing to the given vertex.has in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>label - Labelvertex - Vertex to point unidirectional edge topublic Q has(String type, Object value)
BaseVertexQueryEdgeLabel.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 TitanVertex.has in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>type - TitanType namevalue - Value for the property of the given key to match, or vertex to point unidirectional edge topublic Q hasNot(String key, Object value)
BaseVertexQueryBaseVertexQuery.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, com.tinkerpop.blueprints.Predicate predicate, Object value)
BaseVertexQueryhas in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>key - property keypredicate - boolean relationship to satisfy with the given valuevalue - valuepublic Q has(PropertyKey key, com.tinkerpop.blueprints.Predicate predicate, Object value)
BaseVertexQueryhas in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>key - property keypredicate - boolean relationship to satisfy with the given valuevalue - valuepublic Q has(String key)
BaseVertexQueryhas in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>public Q hasNot(String key)
BaseVertexQueryhasNot in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>public <T extends Comparable<?>> Q interval(PropertyKey key, T start, T end)
BaseVertexQueryinterval 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 <T extends Comparable<?>> Q interval(String key, T start, T end)
BaseVertexQueryinterval 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)@Deprecated public <T extends Comparable<T>> Q has(String key, T value, com.tinkerpop.blueprints.Query.Compare compare)
public Q types(RelationType... types)
BaseVertexQuerytypes in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>types - relation types to query forpublic Q labels(String... labels)
BaseVertexQuerylabels in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>labels - edge labels to query forpublic Q keys(String... keys)
BaseVertexQuerykeys in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>keys - property keys to query forpublic Q type(RelationType type)
public Q direction(com.tinkerpop.blueprints.Direction d)
BaseVertexQuerydirection in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>d - Direction to query forpublic Q limit(int limit)
BaseVertexQuerylimit in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>limit - maximum number of relations to retrieve for this querypublic Q orderBy(String key, Order order)
BaseVertexQueryorderBy in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>key - The key of the properties on which to orderorder - the ordering directionpublic Q orderBy(PropertyKey key, Order order)
BaseVertexQueryorderBy in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>key - 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 - protected static Iterable<TitanVertex> edges2Vertices(Iterable<TitanEdge> edges, TitanVertex other)
protected VertexList edges2VertexIds(Iterable<TitanEdge> edges, TitanVertex other)
protected Iterable<TitanRelation> executeImplicitKeyQuery(InternalVertex v)
isImplicitKeyQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory) is true,
this method provides the result set for the query based on the evaluation of the ImplicitKey.
Handling of implicit keys is completely distinct from "normal" query execution and handled extra
for completeness reasons.v - protected List<InternalVertex> allRepresentatives(InternalVertex partitionedVertex)
protected final boolean isPartitionedVertex(InternalVertex vertex)
protected boolean useSimpleQueryProcessor(BaseVertexCentricQuery query, InternalVertex... vertices)
protected Iterable<TitanRelation> executeRelations(InternalVertex vertex, BaseVertexCentricQuery baseQuery)
public Iterable<TitanVertex> executeVertices(InternalVertex vertex, BaseVertexCentricQuery baseQuery)
public VertexList executeVertexIds(InternalVertex vertex, BaseVertexCentricQuery baseQuery)
public QueryDescription describeForEdges()
BaseVertexQueryQueryDescription object.
This can be used to inspect the query plan for this query. Note, that calling this method
does not actually execute the query but only optimizes it and constructs a query plan.describeForEdges in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>public QueryDescription describeForProperties()
BaseVertexQueryQueryDescription object.
This can be used to inspect the query plan for this query. Note, that calling this method
does not actually execute the query but only optimizes it and constructs a query plan.describeForProperties in interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>public QueryDescription describeForRelations()
protected QueryDescription describe(int numVertices, RelationCategory returnType)
protected VertexCentricQuery constructQuery(InternalVertex vertex, BaseVertexCentricQuery baseQuery)
VertexCentricQuery for this query builder. The query construction and optimization
logic is taken from constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory)
This method only adds the additional conditions that are based on the base vertex.vertex - for which to construct this querybaseQuery - as constructed by constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory)protected BaseVertexCentricQuery constructQuery(RelationCategory returnType)
Copyright © 2012–2014. All rights reserved.