UltipaDocs
Try Playground
  • Introduction
  • GQL vs Other Languages
    • Overview
    • Node and Edge Patterns
    • Path Patterns
    • Quantified Paths
    • Shortest Paths
    • Graph Patterns
    • Overview
    • Closed Graph
    • Open Graph
    • Graph Sharding and Storage
    • Constraints
    • Unique Identifiers
    • INSERT
    • INSERT OVERWRITE
    • UPSERT
    • SET
    • REMOVE
    • DELETE
    • Query Composition
    • Result Table and Visualization
    • MATCH
    • OPTIONAL MATCH
    • FILTER
    • LET
    • FOR
    • ORDER BY
    • LIMIT
    • SKIP
    • CALL
    • RETURN
    • Composite Query
    • NEXT
    • All Functions
    • Scalar Functions
    • Path Functions
    • Aggregate Functions
    • Mathematical Functions
    • Trigonometric Functions
    • String Functions
    • List Functions
    • Datetime Functions
    • Spatial Functions
    • Type Conversion Functions
    • Table Functions
    • AI & Vector Functions
    • Database Functions
  • Operators
  • Predicates
  • Expressions
    • Index
    • Full-text Index
    • Vector Index
  • Transactions
  • Triggers
  • Query Management
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Syntactic Notation
  • GQL Conformance
  1. Docs
  2. /
  3. ISO GQL
  4. /
  5. Graph Management

Open Graph

Overview

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,

  • Each node or edge can have zero, one, or multiple labels.
  • Each node or edge has its own set of properties.

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.

Creating Open Graph

To create an open graph g1:

GQL
CREATE GRAPH g1 ANY

The ANY keyword identifies an open graph.

Showing Labels

To show labels in the current graph:

GQL
SHOW LABEL

The plural form SHOW LABELS is also supported.

To show node labels in the current graph:

GQL
SHOW NODE LABEL

To show edge labels in the current graph:

GQL
SHOW EDGE LABEL

Each label provides the following essential metadata:

Field
Description
label_nameThe name of the label.
label_idThe ID of the label.

Creating Label

You can create new labels within an open graph.

To create a node label User within the current graph:

GQL
CREATE NODE LABEL User

To create an edge label Transfers within the current graph:

GQL
CREATE EDGE LABEL Transfers

Dropping Label

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:

GQL
DROP NODE LABEL Person

To drop the edge label LINKS from the current graph:

GQL
DROP EDGE LABEL LINKS