com.thinkaurelius.titan.core

## Interface TitanVertexQuery<Q extends TitanVertexQuery<Q>>

- All Superinterfaces:
    BaseVertexQuery<Q>, com.tinkerpop.blueprints.Query, com.tinkerpop.blueprints.VertexQuery
  All Known Implementing Classes:
    VertexCentricQueryBuilder

      public interface TitanVertexQuery<Q extends TitanVertexQuery<Q>>
      extends BaseVertexQuery<Q>, com.tinkerpop.blueprints.VertexQuery

  A TitanVertexQuery is a VertexQuery executed for a single vertex.

  Calling `TitanVertex.query()` builds such a query against the vertex this method is called on. This query builder provides the methods to specify which indicent edges or properties to query for.
  Author:
    Matthias Bröcheler (http://www.matthiasb.com)
  See Also:
    `BaseVertexQuery`

- - ### Nested Class Summary

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

      `com.tinkerpop.blueprints.Query.Compare`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Q` | `adjacent(TitanVertex vertex)` Restricts this query to only those edges that point to the given vertex.
    `long` | `count()` Returns the number of edges that match this query
    `Q` | `direction(com.tinkerpop.blueprints.Direction d)` Query only for relations in the given direction.
    `Iterable<com.tinkerpop.blueprints.Edge>` | `edges()` Returns an iterable over all incident edges that match this query
    `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 `BaseVertexQuery.has(String, Object)` but negates the condition, i.e.
    `<T extends Comparable<?>> Q` | `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<?>> Q` | `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).
    `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.
    `Q` | `types(RelationType... type)` Query for only those relations matching one of the given relation types.
    `VertexList` | `vertexIds()` Retrieves all vertices connected to this query's base vertex by edges matching the conditions defined in this query.

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

      `describeForEdges, describeForProperties`

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

      `has`

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

      `vertices`

- - ### Method Detail

    - #### adjacent

          Q adjacent(TitanVertex vertex)

      Description copied from interface: `BaseVertexQuery`
      Restricts this query to only those edges that point to the given vertex.
      Specified by:
        `adjacent` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Returns:
        this query builder

    - #### types

          Q types(RelationType... type)

      Description copied from interface: `BaseVertexQuery`
      Query for only those relations matching one of the given relation types. By default, a query includes all relations in the result set.
      Specified by:
        `types` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `type` - relation types to query for
      Returns:
        this query

    - #### labels

          Q labels(String... labels)

      Description copied from interface: `BaseVertexQuery`
      Query for only those edges matching one of the given edge labels. By default, an edge query includes all edges in the result set.
      Specified by:
        `labels` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `labels` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `labels` - edge labels to query for
      Returns:
        this query

    - #### keys

          Q keys(String... keys)

      Description copied from interface: `BaseVertexQuery`
      Query for only those properties having one of the given property keys. By default, a query includes all properties in the result set.
      Specified by:
        `keys` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `keys` - property keys to query for
      Returns:
        this query

    - #### direction

          Q direction(com.tinkerpop.blueprints.Direction d)

      Description copied from interface: `BaseVertexQuery`
      Query only for relations in the given direction. By default, both directions are queried.
      Specified by:
        `direction` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `direction` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `d` - Direction to query for
      Returns:
        this query

    - #### has

          Q has(PropertyKey key,
              Object value)

      Description copied from interface: `BaseVertexQuery`
      Query only for edges or properties that have an incident property matching the given value.

      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `key` - key
        `value` - Value for the property of the given key to match
      Returns:
        this query

    - #### has

          Q has(EdgeLabel label,
              TitanVertex vertex)

      Description copied from interface: `BaseVertexQuery`
      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.
      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `label` - Label
        `vertex` - Vertex to point unidirectional edge to
      Returns:
        this query

    - #### has

          Q has(String key)

      Description copied from interface: `BaseVertexQuery`
      Query for edges or properties that have defined property with the given key
      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        this query

    - #### hasNot

          Q hasNot(String key)

      Description copied from interface: `BaseVertexQuery`
      Query for edges or properties that DO NOT have a defined property with the given key
      Specified by:
        `hasNot` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `hasNot` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `hasNot` in interface `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        this query

    - #### has

          Q has(String type,
              Object value)

      Description copied from interface: `BaseVertexQuery`
      Query only for edges or properties that have an incident property or unidirected edge matching the given value.

      If type is a property key, then the query is restricted to edges or properties having an incident property matching this key-value pair. If type is an edge label, then 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 value which is expected to be a `TitanVertex`.
      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `type` - TitanType name
        `value` - Value for the property of the given key to match, or vertex to point unidirectional edge to
      Returns:
        this query

    - #### hasNot

          Q hasNot(String key,
                 Object value)

      Description copied from interface: `BaseVertexQuery`
      Identical to `BaseVertexQuery.has(String, Object)` but negates the condition, i.e. matches those edges or properties that DO NOT satisfy this property condition.
      Specified by:
        `hasNot` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `hasNot` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `hasNot` in interface `com.tinkerpop.blueprints.VertexQuery`

    - #### has

          Q has(PropertyKey key,
              com.tinkerpop.blueprints.Predicate predicate,
              Object value)

      Description copied from interface: `BaseVertexQuery`
      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.
      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `key` - property key
        `predicate` - boolean relationship to satisfy with the given value
        `value` - value
      Returns:

    - #### has

          Q has(String key,
              com.tinkerpop.blueprints.Predicate predicate,
              Object value)

      Description copied from interface: `BaseVertexQuery`
      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.
      Specified by:
        `has` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `has` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `key` - property key
        `predicate` - boolean relationship to satisfy with the given value
        `value` - value

    - #### interval

          <T extends Comparable<?>> Q interval(String key,
                                             T start,
                                             T end)

      Description copied from interface: `BaseVertexQuery`
      Query for those edges or properties that have a property for the given key whose values lies in the interval by [start,end).
      Specified by:
        `interval` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `interval` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `interval` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `key` - property key
        `start` - value defining the start of the interval (inclusive)
        `end` - value defining the end of the interval (exclusive)
      Returns:
        this query

    - #### interval

          <T extends Comparable<?>> Q interval(PropertyKey key,
                                             T start,
                                             T end)

      Description copied from interface: `BaseVertexQuery`
      Query for those edges or properties that have a property for the given key whose values lies in the interval by [start,end).
      Specified by:
        `interval` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `key` - property key
        `start` - value defining the start of the interval (inclusive)
        `end` - value defining the end of the interval (exclusive)
      Returns:
        this query

    - #### limit

          Q limit(int limit)

      Description copied from interface: `BaseVertexQuery`
      Sets the retrieval limit for this query.

      When setting a limit, executing this query will only retrieve the specified number of relations. Note, that this also applies to counts.
      Specified by:
        `limit` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Specified by:
        `limit` in interface `com.tinkerpop.blueprints.Query`
      Specified by:
        `limit` in interface `com.tinkerpop.blueprints.VertexQuery`
      Parameters:
        `limit` - maximum number of relations to retrieve for this query
      Returns:
        this query

    - #### orderBy

          Q orderBy(String key,
                  Order order)

      Description copied from interface: `BaseVertexQuery`
      Orders the relation results of this query according to their property for the given key in the given order (increasing/decreasing). Note, that the ordering always applies to the incident relations (edges/properties) and NOT to the adjacent vertices even if only vertices are being returned.
      Specified by:
        `orderBy` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `key` - The key of the properties on which to order
        `order` - the ordering direction
      Returns:

    - #### orderBy

          Q orderBy(PropertyKey key,
                  Order order)

      Description copied from interface: `BaseVertexQuery`
      Orders the relation results of this query according to their property for the given key in the given order (increasing/decreasing). Note, that the ordering always applies to the incident relations (edges/properties) and NOT to the adjacent vertices even if only vertices are being returned.
      Specified by:
        `orderBy` in interface `BaseVertexQuery<Q extends TitanVertexQuery<Q>>`
      Parameters:
        `key` - The key of the properties on which to order
        `order` - the ordering direction
      Returns:

    - #### edges

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

      Returns an iterable over all incident edges that match this query
      Specified by:
        `edges` in interface `com.tinkerpop.blueprints.Query`
      Returns:
        Iterable over all incident edges that match this query

    - #### titanEdges

          Iterable<TitanEdge> titanEdges()

      Returns an iterable over all incident edges that match this query. Returns edges as `TitanEdge`.
      Returns:
        Iterable over all incident edges that match this query

    - #### properties

          Iterable<TitanProperty> properties()

      Returns an iterable over all incident properties that match this query
      Returns:
        Iterable over all incident properties that match this query

    - #### relations

          Iterable<TitanRelation> relations()

      Returns an iterable over all incident relations that match this query
      Returns:
        Iterable over all incident relations that match this query

    - #### count

          long count()

      Returns the number of edges that match this query
      Specified by:
        `count` in interface `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        Number of edges that match this query

    - #### propertyCount

          long propertyCount()

      Returns the number of properties that match this query
      Returns:
        Number of properties that match this query

    - #### vertexIds

          VertexList vertexIds()

      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 `com.tinkerpop.blueprints.VertexQuery`
      Returns:
        A list of all vertices connected to this query's base vertex by matching edges

Copyright © 2012–2014. All rights reserved.