The open graph is schema-free, requiring no explicit schema definitions before data insertion. You can directly insert nodes and edges into the graph, and their labels and properties are created on the fly. This offers maximum flexibility for early-stage data exploration.
In an open graph,
Open graphs do not require explicit definitions of labels and properties; they are automatically created as you insert nodes and edges into the graph. However, you still have the option to manually create labels beforehand if desired.
To create an open graph g1:
GQLCREATE GRAPH g1 ANY
The ANY keyword identifies an open graph.
To show labels in the current graph:
GQLSHOW LABEL
The plural form SHOW LABELS is also supported.
To show node labels in the current graph:
GQLSHOW NODE LABEL
To show edge labels in the current graph:
GQLSHOW EDGE LABEL
Each label provides the following essential metadata:
Field | Description |
|---|---|
label_name | The name of the label. |
label_id | The ID of the label. |
You can create new labels within an open graph.
To create a node label User within the current graph:
GQLCREATE NODE LABEL User
To create an edge label Transfers within the current graph:
GQLCREATE EDGE LABEL Transfers
You can delete labels from a graph. Deleting a label will not remove the nodes or edges that use it.
To drop the node label Person from the current graph:
GQLDROP NODE LABEL Person
To drop the edge label LINKS from the current graph:
GQLDROP EDGE LABEL LINKS