com.thinkaurelius.titan.core

## Interface TitanRelation

- All Superinterfaces:
    com.tinkerpop.blueprints.Element, Idfiable, Removable, TitanElement
  All Known Subinterfaces:
    InternalRelation, StandardRelation, TitanEdge, TitanProperty
  All Known Implementing Classes:
    AbstractEdge, AbstractProperty, AbstractTypedRelation, CacheEdge, CacheProperty, StandardEdge, StandardProperty

      public interface TitanRelation
      extends TitanElement

  TitanRelation is the most abstract form of a relation between a vertex and some other entity, where relation is understood in its mathematical sense. It generalizes the notion of an edge and a property.
  A TitanRelation extends `TitanElement` which means it is an entity in its own right. This means, a TitanRelation can have properties and unidirectional edges connecting it to other vertices.
  A TitanRelation is an abstract concept. A TitanRelation is either a `TitanProperty` or a `TitanEdge`. A TitanRelation has a type which is either a label or key depending on the implementation.
  A TitanRelation is either directed, or unidirected. Properties are always directed (connecting a vertex with a value). A unidirected edge is a special type of directed edge where the connection is only established from the perspective of the outgoing vertex. In that sense, a unidirected edge is akin to a link.
  Author:
    Matthias Bröcheler (http://www.matthiasb.com)
  See Also:
    `TitanEdge`, `TitanProperty`

- - ### Property Summary

    Properties
    Type | Property and Description
    --- | ---
    `boolean` | `is` Checks whether this relation is a property.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.tinkerpop.blueprints.Direction` | `getDirection(TitanVertex vertex)` Returns the direction of this relation from the perspective of the specified vertex.
    `TitanVertex` | `getProperty(EdgeLabel label)` Returns the vertex associated to this relation by a unidirected edge of the given label or NULL if such does not exist.
    `RelationType` | `getType()` Returns the type of this relation.
    `boolean` | `isEdge()` Checks whether this relation is an edge.
    `boolean` | `isIncidentOn(TitanVertex vertex)` Checks whether this relation is incident on the specified vertex.
    `boolean` | `isLoop()` Checks whether this relation is a loop.
    `boolean` | `isProperty()` Checks whether this relation is a property.
    `void` | `setProperty(EdgeLabel label, TitanVertex vertex)` Establishes a unidirectional edge between this relation and the given vertex for the specified label.

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

      `getId, getLongId, getProperty, getProperty, hasId, isLoaded, isNew, isRemoved, remove, removeProperty, removeProperty, setProperty, setProperty`

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

      `getPropertyKeys`

- - ### Property Detail

    - #### is

      Checks whether this relation is a property.
      Returns:
        true, if this relation is a property, else false.
      See Also:
        `TitanProperty`

  - ### Method Detail

    - #### setProperty

          void setProperty(EdgeLabel label,
                         TitanVertex vertex)

      Establishes a unidirectional edge between this relation and the given vertex for the specified label. The label must be defined `EdgeLabel.isUnidirected()`.
      Parameters:
        `label` -
        `vertex` -

    - #### getProperty

          TitanVertex getProperty(EdgeLabel label)

      Returns the vertex associated to this relation by a unidirected edge of the given label or NULL if such does not exist.
      Parameters:
        `label` -
      Returns:

    - #### getType

          RelationType getType()

      Returns the type of this relation.

      The type is either a label (`EdgeLabel` if this relation is an edge or a key (`PropertyKey`) if this relation is a property.
      Returns:
        Type of this relation

    - #### getDirection

          com.tinkerpop.blueprints.Direction getDirection(TitanVertex vertex)

      Returns the direction of this relation from the perspective of the specified vertex.
      Parameters:
        `vertex` - vertex on which the relation is incident
      Returns:
        The direction of this relation from the perspective of the specified vertex.
      Throws:
        `InvalidElementException` - if this relation is not incident on the vertex

    - #### isIncidentOn

          boolean isIncidentOn(TitanVertex vertex)

      Checks whether this relation is incident on the specified vertex.
      Parameters:
        `vertex` - vertex to check incidence for
      Returns:
        true, if this relation is incident on the vertex, else false

    - #### isLoop

          boolean isLoop()

      Checks whether this relation is a loop. An relation is a loop if it connects a vertex with itself.
      Returns:
        true, if this relation is a loop, else false.

    - #### isProperty

          boolean isProperty()

      Checks whether this relation is a property.
      Returns:
        true, if this relation is a property, else false.
      See Also:
        `TitanProperty`

    - #### isEdge

          boolean isEdge()

      Checks whether this relation is an edge.
      Returns:
        true, if this relation is an edge, else false.
      See Also:
        `TitanEdge`

Copyright © 2012–2014. All rights reserved.