An instance of the Ultipa graph database can host one or more graphs (or graphsets), each representing a unique dataset or domain of interconnected nodes and edges.
The data within a graph adheres to its graph structure. It defines the structural rules and constraints of a graph by outlining the permissible node schemas and edge schemas, along with the associated property types for each schema.
GQL Conformance Note
The Graph Structure, Node Schema, and Edge Schema align with the Graph Type, Node Type, and Edge Type defined in the ISO GQL standard.
Node Schema
A node schema defines a type of nodes allowed in the graph. It comprises a node schema name and a set of property types.
For example, a User
node schema includes properties name
(string
type) and age
(int32
type):
NODE User ({name string, age int32})
The schema name User
also serves as a label. This schema can be referenced using the label expression :User
.
Each graph comes with a built-in node schema named
default
. Thedefault
node schema is available for free use but cannot be be renamed or deleted.
Edge Schema
An edge schema defines a type of directed edges between nodes. It comprises an edge schema name and a set of property types.
For example, a Links
edge schema connects any two nodes and includes a property description
(string
type):
EDGE Links ()-[{description string}]->()
The schema name Links
also serves as a label. This schema can be referenced using the label expression :Links
.
Each graph comes with a built-in edge schema named
default
. Thedefault
edge schema is available for free use but cannot be be renamed or deleted.
Property Type
Properties are associated with a node or edge schema to describe attributes of nodes and edges. A property type is defined by a property name and its property value type. For example, a name
property with the value type string
.
Property Naming Conventions →
All Property Value Types →
System Property
Each node has two system properties serving as unique identifiers: _id
and _uuid
. The _id
value can be manually assigned, ensuring distinct identification of nodes, while the _uuid
value is always generated by the system.
System Property |
Value Type | Description |
---|---|---|
_id |
string |
A string-type (with a length of up to 128 bytes) unique identifier for a node. |
_uuid |
uint64 |
A numeric unique identifier for a node. |
Each edge has only the _uuid
as its unique identifier, also generated by the system. Each edge connects a source node to a destination node, its _from
/_to
and _from_uuid
/_to_uuid
identify its two end nodes.
System Property |
Value Type | Description |
---|---|---|
_uuid |
uint64 |
A numeric unique identifier for an edge. |
_from |
string |
The _id of the source node of an edge. |
_to |
string |
The _id of the destination node of an edge. |
_from_uuid |
uint64 |
The _uuid of the source node of an edge. |
_to_uuid |
uint64 |
The _uuid of the destination node of an edge. |
Naming Conventions
Graph
The names of all graphs in a database must be unique. Each graph name must:
- Contain 2 to 64 characters.
- Begin with a letter.
- Allowed characters: letters (A-Z, a-z), numbers (0-9) and underscores (
_
).
Node Schema and Edge Schema
Each node or edge schema name must:
- Contain 2 to 64 characters.
- Cannot start with a tilde (
~
). - Cannot contain backquotes (
`
). - Cannot use system property names or reserved keywords.
Node schema names must be unique among node schemas, and edge schema names must be unique among edge schemas. However, a node schema and an edge schema are allowed to share the same name.
Property
Each property name must:
- Contain 2 to 64 characters.
- Cannot start with a tilde (
~
). - Cannot contain backquotes (
`
). - Cannot use system property names or reserved keywords.
Property names must be unique among a node schema or an edge schema.