Skip to content

Defining a Property Graph

okram edited this page Sep 13, 2010 · 23 revisions

Gremlin was designed specifically for the analysis and manipulation of key/value-based, directed, multi-relational graphs. This long term refers to a type of graph data structure that has certain properties. These properties are described as follows. The first term, key/value, refers to the fact that both vertices and edges can have any number of properties associated with them. The second term, directed, refers to the fact that the edges in the graph have a directionality — that is, there is a tail and head to each edge. Finally, the third term, multi-relational, refers to the fact that there can many types of edges and thus, many types of relationships can exist between the vertices. For the remainder of this documentation, and for the sake of brevity, these types of graphs will be called property graphs. A property graph is demonstrated in the following example.

A property graph has these elements:

  1. a set of vertices
    • each vertex has a unique identifier.
    • each vertex has a set of outgoing edges.
    • each vertex has a set of incoming edges.
    • each vertex has a collection of properties defined by a map from key to value.
  2. a set of edges
    • each edge has a unique identifier.
    • each edge has a outgoing tail vertex.
    • each edge has a incoming head vertex.
    • each edge has a label that denotes the type of relationship between its two vertices.
    • each edge has a collection of properties defined by a map from key to value.

Gremlin was designed specifically for this abstract data model called the property graph model. Many graph forms can be represented as a property graph. By implementing the property graph interfaces provided with Gremlin, it is possible to use Gremlin over other graph frameworks (and perhaps frameworks that are not specifically for graphs, but can be modeled as a graph).