UltipaDocs
Products
Solutions
Resources
Company
Start Free Trial
UltipaDocs
Start Free Trial
  • Introduction
    • Overview
    • Node and Edge Patterns
    • Path Patterns
    • Quantified Paths
    • Shortest Paths
    • Graph Patterns
    • Overview
    • Typed 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
    • Label Functions
    • Record Functions
    • Table Functions
  • Operators
  • Predicates
    • CASE
    • NULLIF
    • COALESCE
    • LET Value Expression
    • Value Query Expression
    • Index
    • Full-text Index
    • Vector Index
    • Spatial Index
    • Overview
    • Managing HDC Graphs
    • HDC Graph Queries
  • Transaction
  • Trigger
  • Stored Procedure
    • Process
    • Session
    • Job
    • Execution Plan
    • Variables
    • Values and Types
    • Comments
    • Reserved Words
    • Syntactic Notation
  • Access Control
  • 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 — no pre-definition required.
  • Labels support boolean expressions in queries (AND, OR, NOT, wildcard).
  • Labels can be added and removed dynamically after entity creation.
NOTE

Each graph can only be typed or open. The mode cannot be changed after creation.

Creating Open Graph

To create an open graph g1:

GQL
CREATE GRAPH g1 ANY

The ANY keyword identifies an open graph.

Modifying Labels

Adding Labels

GQL
MATCH (n:Person {_id: 'p1'}) SET n:VIP
MATCH (n {_id: 'p1'}) SET n:Experienced, n:Veteran

Adding labels to edges:

GQL
MATCH ()-[r {note: 'test'}]->() SET r:NEW_TYPE

Removing Labels

GQL
MATCH (n {_id: 'p3'}) REMOVE n:Employee
MATCH (n {_id: 'p4'}) REMOVE n:Person, n:Manager

Removing labels from edges:

GQL
MATCH ()-[r {since: 2021}]->() REMOVE r:WORKS_WITH
  • Removing a non-existent label is silently ignored.
  • Adding a label that already exists is idempotent.

Label DDL

Showing Labels

To show labels in the current graph:

GQL
SHOW LABELS

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

Dynamic Properties

In an open graph, properties are fully dynamic:

GQL
INSERT (:Person {_id: 'p1', name: 'Alice', age: 30, hobbies: 'reading', score: 95.5})
INSERT (:Person {_id: 'p2', name: 'Bob', department: 'IT'})

Different entities can have different property sets. Use property_exists() to check for a property:

GQL
MATCH (n {_id: 'p1'}) RETURN property_exists(n, name)

Limitations

  • Schema DDL operations are not supported in open graphs (ALTER GRAPH ... ADD/DROP NODE/EDGE, ALTER NODE/EDGE ... ADD/DROP/RENAME PROPERTY, CREATE INDEX, CREATE FULLTEXT, CREATE TRIGGER).
  • RPC batch import (insertNodesBatchBySchema / insertEdgesBatchBySchema) is not available for open graphs.
  • The mode cannot be switched after the graph is created.
  • Property types are inferred at write time. The same property name may have different types across different entities.