public interface BaseVertexQuery<Q extends BaseVertexQuery<Q>>
Query by some Titan specific convenience methods
for querying for incident edges or properties.
Using VertexQuery proceeds in two steps:
1) Define the query by specifying what to retrieve and
2) execute the query for the elements to retrieve.
This is the base interface for the specific implementations of a VertexQuery. Calling TitanVertex.query()
returns a TitanVertexQuery for querying a single vertex.
Calling TitanTransaction.multiQuery(java.util.Collection) returns a TitanMultiVertexQuery to execute
the same query against multiple vertices at the same time which is typically faster.TitanVertexQuery,
TitanMultiVertexQuery| Modifier and Type | Method and Description |
|---|---|
Q |
adjacent(TitanVertex vertex)
Restricts this query to only those edges that point to the given vertex.
|
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. |
Q |
direction(com.tinkerpop.blueprints.Direction d)
Query only for relations in the given direction.
|
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.
|
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
has(String, Object) but negates the condition, i.e. |
<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).
|
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(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 |
types(RelationType... type)
Query for only those relations matching one of the given relation types.
|
Q adjacent(TitanVertex vertex)
vertex - Q types(RelationType... type)
type - relation types to query forQ labels(String... labels)
labels - edge labels to query forQ keys(String... keys)
keys - property keys to query forQ direction(com.tinkerpop.blueprints.Direction d)
d - Direction to query forQ has(PropertyKey key, Object value)
key - keyvalue - Value for the property of the given key to matchQ has(EdgeLabel label, TitanVertex vertex)
EdgeLabel.isUnidirected()
and the query is restricted to edges or properties having an incident unidirectional edge pointing to the given vertex.label - Labelvertex - Vertex to point unidirectional edge toQ has(String key)
key - Q hasNot(String key)
key - Q has(String type, Object value)
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 TitanVertex.type - TitanType namevalue - Value for the property of the given key to match, or vertex to point unidirectional edge toQ hasNot(String key, Object value)
has(String, Object) but negates the condition, i.e. matches those edges or properties
that DO NOT satisfy this property condition.key - value - Q has(PropertyKey key, com.tinkerpop.blueprints.Predicate predicate, Object value)
key - property keypredicate - boolean relationship to satisfy with the given valuevalue - valueQ has(String key, com.tinkerpop.blueprints.Predicate predicate, Object value)
key - property keypredicate - boolean relationship to satisfy with the given valuevalue - value<T extends Comparable<?>> Q interval(String key, T start, T end)
key - property keystart - value defining the start of the interval (inclusive)end - value defining the end of the interval (exclusive)<T extends Comparable<?>> Q interval(PropertyKey key, T start, T end)
key - property keystart - value defining the start of the interval (inclusive)end - value defining the end of the interval (exclusive)Q limit(int limit)
limit - maximum number of relations to retrieve for this queryQ orderBy(String key, Order order)
key - The key of the properties on which to orderorder - the ordering directionQ orderBy(PropertyKey key, Order order)
key - The key of the properties on which to orderorder - the ordering directionQueryDescription describeForEdges()
QueryDescription 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.QueryDescription describeForProperties()
QueryDescription 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.Copyright © 2012–2014. All rights reserved.