com.thinkaurelius.titan.graphdb.query.vertex

## Class BasicVertexCentricQueryBuilder<Q extends BaseVertexQuery<Q>>

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

- All Implemented Interfaces:
    BaseVertexQuery<Q>
  Direct Known Subclasses:
    MultiVertexCentricQueryBuilder, VertexCentricQueryBuilder

      public abstract class BasicVertexCentricQueryBuilder<Q extends BaseVertexQuery<Q>>
      extends BaseVertexCentricQueryBuilder<Q>

  Builds a `BaseVertexQuery`, optimizes the query and compiles the result into a `BaseVertexCentricQuery` which is then executed by one of the extending classes.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected class` | `BasicVertexCentricQueryBuilder.RelationConstructor`
    `protected static interface` | `BasicVertexCentricQueryBuilder.ResultConstructor<Q>`
    `protected class` | `BasicVertexCentricQueryBuilder.VertexConstructor`
    `protected class` | `BasicVertexCentricQueryBuilder.VertexIdConstructor`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected StandardTitanTx` | `tx` Transaction in which this query is executed

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicVertexCentricQueryBuilder(StandardTitanTx tx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `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()`
    `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 `BaseVertexCentricQueryBuilder.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)`
    `TitanVertex` | `getVertex(long vertexid)`
    `protected boolean` | `isPartitionedVertex(InternalVertex vertex)`
    `Q` | `noPartitionRestriction()` Removes any query partition restriction for this query
    `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.
    `protected boolean` | `useSimpleQueryProcessor(BaseVertexCentricQuery query, InternalVertex... vertices)`

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

      `adjacent, direction, getSingleType, getThis, 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`

- - ### Field Detail

    - #### tx

          protected final StandardTitanTx tx

      Transaction in which this query is executed

  - ### Constructor Detail

    - #### BasicVertexCentricQueryBuilder

          public BasicVertexCentricQueryBuilder(StandardTitanTx tx)

  - ### Method Detail

    - #### getVertex

          public TitanVertex getVertex(long vertexid)

      Specified by:
        `getVertex` in class `BaseVertexCentricQueryBuilder<Q extends BaseVertexQuery<Q>>`

    - #### noPartitionRestriction

          public Q noPartitionRestriction()

      Removes any query partition restriction for this query
      Returns:

    - #### system

          public Q system()

      Restricts the result set of this query to only system types.
      Returns:

    - #### queryOnlyLoaded

          public Q queryOnlyLoaded()

      Calling this method will cause this query to only included loaded (i.e. unmodified) relations in the result set.
      Returns:

    - #### edges2Vertices

          protected static Iterable<TitanVertex> edges2Vertices(Iterable<TitanEdge> edges,
                                             TitanVertex other)

    - #### edges2VertexIds

          protected VertexList edges2VertexIds(Iterable<TitanEdge> edges,
                                   TitanVertex other)

    - #### executeImplicitKeyQuery

          protected Iterable<TitanRelation> executeImplicitKeyQuery(InternalVertex v)

      If `BaseVertexCentricQueryBuilder.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.
      Parameters:
        `v` -
      Returns:

    - #### allRepresentatives

          protected List<InternalVertex> allRepresentatives(InternalVertex partitionedVertex)

    - #### isPartitionedVertex

          protected final boolean isPartitionedVertex(InternalVertex vertex)

    - #### useSimpleQueryProcessor

          protected boolean useSimpleQueryProcessor(BaseVertexCentricQuery query,
                                        InternalVertex... vertices)

    - #### executeRelations

          protected Iterable<TitanRelation> executeRelations(InternalVertex vertex,
                                                 BaseVertexCentricQuery baseQuery)

    - #### executeVertices

          public Iterable<TitanVertex> executeVertices(InternalVertex vertex,
                                              BaseVertexCentricQuery baseQuery)

    - #### executeVertexIds

          public VertexList executeVertexIds(InternalVertex vertex,
                                    BaseVertexCentricQuery baseQuery)

    - #### describeForEdges

          public QueryDescription describeForEdges()

      Description copied from interface: `BaseVertexQuery`
      Returns a description of this query for edges as a `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.
      Returns:
        A description of this query for edges

    - #### describeForProperties

          public QueryDescription describeForProperties()

      Description copied from interface: `BaseVertexQuery`
      Returns a description of this query for properties as a `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.
      Returns:
        A description of this query for properties

    - #### describeForRelations

          public QueryDescription describeForRelations()

    - #### describe

          protected QueryDescription describe(int numVertices,
                                  RelationCategory returnType)

    - #### constructQuery

          protected VertexCentricQuery constructQuery(InternalVertex vertex,
                                          BaseVertexCentricQuery baseQuery)

      Constructs a `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.
      Parameters:
        `vertex` - for which to construct this query
        `baseQuery` - as constructed by `constructQuery(com.thinkaurelius.titan.graphdb.internal.RelationCategory)`
      Returns:

    - #### constructQuery

          protected BaseVertexCentricQuery constructQuery(RelationCategory returnType)

Copyright © 2012–2014. All rights reserved.