com.thinkaurelius.titan.graphdb.query.vertex

## Class VertexCentricQueryBuilder

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.query.vertex.BaseVertexCentricQueryBuilder<Q>
  - - com.thinkaurelius.titan.graphdb.query.vertex.BasicVertexCentricQueryBuilder<VertexCentricQueryBuilder>
    - - com.thinkaurelius.titan.graphdb.query.vertex.VertexCentricQueryBuilder

- All Implemented Interfaces:
    BaseVertexQuery<VertexCentricQueryBuilder>, TitanVertexQuery<VertexCentricQueryBuilder>, com.tinkerpop.blueprints.Query, com.tinkerpop.blueprints.VertexQuery

      public class VertexCentricQueryBuilder
      extends BasicVertexCentricQueryBuilder<VertexCentricQueryBuilder>
      implements TitanVertexQuery<VertexCentricQueryBuilder>

  Implementation of `TitanVertexQuery` that extends `BasicVertexCentricQueryBuilder` for all the query building and optimization and adds only the execution logic in `BasicVertexCentricQueryBuilder.constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory)`. However, there is one important special case: If the constructed query is simple (i.e. `com.thinkaurelius.titan.graphdb.query.vertex.VertexCentricQuery#isSimple()=true` then we use the `SimpleVertexQueryProcessor` to execute the query instead of the generic `QueryProcessor` for performance reasons and we compute the result sets differently to make things faster and more memory efficient. The simplified vertex processing only applies to loaded (i.e. non-mutated) vertices. The query can be configured to only included loaded relations in the result set (which is needed, for instance, when computing index deltas in `IndexSerializer`) via `BasicVertexCentricQueryBuilder.queryOnlyLoaded()`. All other methods just prepare or transform that result set to fit the particular method semantics.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.thinkaurelius.titan.graphdb.query.vertex.BasicVertexCentricQueryBuilder

      `BasicVertexCentricQueryBuilder.RelationConstructor, BasicVertexCentricQueryBuilder.ResultConstructor<Q>, BasicVertexCentricQueryBuilder.VertexConstructor, BasicVertexCentricQueryBuilder.VertexIdConstructor`

    - ### Nested classes/interfaces inherited from interface com.tinkerpop.blueprints.Query

      `com.tinkerpop.blueprints.Query.Compare`

  - ### Field Summary

    - ### Fields inherited from class com.thinkaurelius.titan.graphdb.query.vertex.BasicVertexCentricQueryBuilder

      `tx`

    - ### Fields inherited from class com.thinkaurelius.titan.graphdb.query.vertex.BaseVertexCentricQueryBuilder

      `adjacentVertex, constraints, dir, limit, orders, types`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `VertexCentricQueryBuilder(InternalVertex v)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `count()` Returns the number of edges that match this query
    `Iterable<com.tinkerpop.blueprints.Edge>` | `edges()` Returns an iterable over all incident edges that match this query
    `protected <Q> Q` | `execute(RelationCategory returnType, BasicVertexCentricQueryBuilder.ResultConstructor<Q> resultConstructor)`
    `protected VertexCentricQueryBuilder` | `getThis()`
    `Iterable<TitanProperty>` | `properties()` Returns an iterable over all incident properties that match this query
    `long` | `propertyCount()` Returns the number of properties that match this query
    `Iterable<TitanRelation>` | `relations()` Returns an iterable over all incident relations that match this query
    `Iterable<TitanEdge>` | `titanEdges()` Returns an iterable over all incident edges that match this query.
    `VertexList` | `vertexIds()` Retrieves all vertices connected to this query's base vertex by edges matching the conditions defined in this query.
    `Iterable<com.tinkerpop.blueprints.Vertex>` | `vertices()`

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.query.vertex.BasicVertexCentricQueryBuilder

      `allRepresentatives, constructQuery, constructQuery, describe, describeForEdges, describeForProperties, describeForRelations, edges2VertexIds, edges2Vertices, executeImplicitKeyQuery, executeRelations, executeVertexIds, executeVertices, getVertex, isPartitionedVertex, noPartitionRestriction, queryOnlyLoaded, system, useSimpleQueryProcessor`

    - ### Methods inherited from class com.thinkaurelius.titan.graphdb.query.vertex.BaseVertexCentricQueryBuilder

      `adjacent, direction, getSingleType, has, has, has, has, has, has, has, hasNot, hasNot, hasSingleType, hasTypes, interval, interval, isImplicitKeyQuery, keys, labels, limit, orderBy, orderBy, type, types, types`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.thinkaurelius.titan.core.TitanVertexQuery

      `adjacent, direction, has, has, has, has, has, has, hasNot, hasNot, interval, interval, keys, labels, limit, orderBy, orderBy, types`

    - ### Methods inherited from interface com.thinkaurelius.titan.core.BaseVertexQuery

      `describeForEdges, describeForProperties`

    - ### Methods inherited from interface com.tinkerpop.blueprints.VertexQuery

      `has`

- - ### Constructor Detail

    - #### VertexCentricQueryBuilder

          public VertexCentricQueryBuilder(InternalVertex v)

  - ### Method Detail

    - #### getThis

          protected VertexCentricQueryBuilder getThis()

      Specified by:
        `getThis` in class `BaseVertexCentricQueryBuilder<VertexCentricQueryBuilder>`

    - #### execute

          protected <Q> Q execute(RelationCategory returnType,
                      BasicVertexCentricQueryBuilder.ResultConstructor<Q> resultConstructor)

    - #### titanEdges

          public Iterable<TitanEdge> titanEdges()

      Description copied from interface: `TitanVertexQuery`
      Returns an iterable over all incident edges that match this query. Returns edges as `TitanEdge`.
      Specified by:
        `titanEdges` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Returns:
        Iterable over all incident edges that match this query

    - #### properties

          public Iterable<TitanProperty> properties()

      Description copied from interface: `TitanVertexQuery`
      Returns an iterable over all incident properties that match this query
      Specified by:
        `properties` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Returns:
        Iterable over all incident properties that match this query

    - #### relations

          public Iterable<TitanRelation> relations()

      Description copied from interface: `TitanVertexQuery`
      Returns an iterable over all incident relations that match this query
      Specified by:
        `relations` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Returns:
        Iterable over all incident relations that match this query

    - #### edges

          public Iterable<com.tinkerpop.blueprints.Edge> edges()

      Description copied from interface: `TitanVertexQuery`
      Returns an iterable over all incident edges that match this query
      Specified by:
        `edges` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Specified by:
        `edges` in interface `com.tinkerpop.blueprints.Query`
      Returns:
        Iterable over all incident edges that match this query

    - #### vertices

          public Iterable<com.tinkerpop.blueprints.Vertex> vertices()

      Specified by:
        `vertices` in interface `com.tinkerpop.blueprints.Query`

    - #### vertexIds

          public VertexList vertexIds()

      Description copied from interface: `TitanVertexQuery`
      Retrieves all vertices connected to this query's base vertex by edges matching the conditions defined in this query.

      The query engine will determine the most efficient way to retrieve the vertices that match this query.
      Specified by:
        `vertexIds` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Specified by:
        `vertexIds` in interface `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        A list of all vertices connected to this query's base vertex by matching edges

    - #### count

          public long count()

      Description copied from interface: `TitanVertexQuery`
      Returns the number of edges that match this query
      Specified by:
        `count` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Specified by:
        `count` in interface `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        Number of edges that match this query

    - #### propertyCount

          public long propertyCount()

      Description copied from interface: `TitanVertexQuery`
      Returns the number of properties that match this query
      Specified by:
        `propertyCount` in interface `TitanVertexQuery<VertexCentricQueryBuilder>`
      Returns:
        Number of properties that match this query

Copyright © 2012–2014. All rights reserved.