Class

unicorn.unibase.graph

ReadOnlyGraph

Related Doc: package graph

Permalink

class ReadOnlyGraph extends AnyRef

Graphs are mathematical structures used to model pairwise relations between objects. A graph is made up of vertices (nodes) which are connected by edges (arcs or lines). A graph may be undirected, meaning that there is no distinction between the two vertices associated with each edge, or its edges may be directed from one vertex to another. Directed graphs are also called digraphs and directed edges are also called arcs or arrows.

A multigraph is a graph which is permitted to have multiple edges (also called parallel edges), that is, edges that have the same end nodes. The ability to support parallel edges simplifies modeling scenarios where there can be multiple relationships (e.g., co-worker and friend) between the same vertices.

In a property graph, the generic mathematical graph is often extended to support user defined objects attached to each vertex and edge. The edges also have associated labels denoting the relationships, which are important in a multigraph.

Unicorn supports directed property multigraphs. Documents from different tables can be added as vertices to a multigraph. It is also okay to add vertices without corresponding to documents. Each relationship/edge has a label and optional data (any valid JsValue, default value JsInt(1)).

Unicorn stores graphs in adjacency lists. That is, a graph is stored as a BigTable whose rows are vertices with their adjacency list. The adjacency list of a vertex contains all of the vertex’s incident edges (in and out edges are in different column families).

Because large graphs are usually very sparse, an adjacency list is significantly more space-efficient than an adjacency matrix. Besides, the neighbors of each vertex may be listed efficiently with an adjacency list, which is important in graph traversals. With our design, it is also possible to test whether two vertices are adjacent to each other for a given relationship in constant time.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReadOnlyGraph
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ReadOnlyGraph(table: BigTable, documentVertexTable: BigTable)

    Permalink

    table

    Graph adjacency list table.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(from: Long, label: String, to: Long): Option[JsValue]

    Permalink

    Returns the edge between from and to with given label.

  5. def apply(table: String, key: JsValue, tenant: JsValue = JsUndefined, direction: Direction = Both): Vertex

    Permalink

    Returns the vertex of a document.

  6. def apply(key: String, direction: Direction): Vertex

    Permalink

    Returns a vertex by its string key.

  7. def apply(key: String): Vertex

    Permalink

    Returns a vertex by its string key.

  8. def apply(id: Long, direction: Direction): Vertex

    Permalink

    Returns the vertex properties and its adjacency list.

    Returns the vertex properties and its adjacency list.

    id

    vertex id

    direction

    what edges to load

  9. def apply(id: Long): Vertex

    Permalink

    Returns the vertex properties and its both outgoing and incoming edges.

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def contains(key: String): Boolean

    Permalink

    Returns true if the vertex exists.

  13. def contains(id: Long): Boolean

    Permalink

    Returns true if the vertex exists.

  14. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. def id(key: String): Option[Long]

    Permalink

    Translates a vertex string key to 64 bit id.

  20. def id(table: String, key: JsValue, tenant: JsValue = JsUndefined): Option[Long]

    Permalink

    Returns the vertex id of a document vertex.

    Returns the vertex id of a document vertex. Throws exception if the vertex doesn't exist.

  21. val idColumnQualifier: Array[Byte]

    Permalink

    The column qualifier of $id field.

  22. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  23. val name: String

    Permalink

    The graph name.

  24. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  25. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  27. val serializer: GraphSerializer

    Permalink

    Graph serializer.

  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  29. val table: BigTable

    Permalink

    Graph adjacency list table.

  30. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  31. def traversal: Gremlin

    Permalink

    Returns a Gremlin traversal machine.

  32. def v(id: Long): GremlinVertices

    Permalink

    Returns a Gremlin traversal machine starting at the given vertex.

  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped