How to create an edge label.


  [ single() | multiple() ].
  [ properties(property[, property]).[ add() | drop() ] ].
  [ connection( outVertex, inVertex) ].
  [ ttl ].
  [ ifNotExists() ].
  [ create() | add() | drop() | describe() | exists() ]


An edge label specifies a type of edge that can be stored in DSE Graph. An edge label can have cardinality specified (default is multiple), properties that an edge has defined, the connections that are defined between two types of vertices, and a time-to-live (TTL) to determine the lifecycle of an edge. The order that the options are added to the schema statement matter: cardinality, properties associated with the edge label, then connection.

single, multiple

Specify whether an edge label can have a single edge or multiple edges between the specified vertices.

Properties can be added to vertices and edges. A property key must be created prior to adding it to either type of element. Allowed characters for the name are alphabetical or underscore.

Set the two vertex labels that the edge label will connect.


Set a time-to-live for an edge label.

Creating an edge label can check for lack of current existence with ifNotExists() before creating a new edge label.


Create an edgeLabel made:
Note: Naming convention used to allow nearly unrestricted Unicode. Now the only allowed characters are [a-zA-Z0-9], underscore, hyphen, and period.
Create an edgeLabel included_in if the edge label doesn't already exist:
Create an edgeLabel with multiple cardinality:
Add properties to an edgeLabel:
Create an edge label isA specifying that the outgoing vertex label is ingredient and the incoming vertex label is fridge_item.
schema.edgeLabel('isA').connection('ingredient', 'fridge_item).create()
An adjacency between the vertexLabel person and person specifying the edgeLabel knows.
schema.edgeLabel('knows').connection('person', 'person').add()
Create an edgeLabel with both properties and a connection:
Note that the connection and the properties cannot be both specified during edge label creation. A best practice is to create the edge label, then add the properties and the connection.
Create a time-to-live (TTL) for an edgeLabel of 60 seconds. Setting a TTL will expire all edges inserted with the edgeLabel at the set TTL value:
Note: DSE Graph sets TTL differently from the DSE database. The DSE database sets TTL per mutation (insertion or update) or can inherit a default value from the table schema. DSE Graph sets TTL per vertex label or edge label, and all vertices or edges will be affected by the TTL setting. DSE Graph cannot set TTL for an individual vertex or edge.
Check if an edgeLabel exists:
Get the schema creation command for an edgeLabel using the describe() command:
Remove a edge label with the drop() command:
Remove a property make_date from an edge label: