Expand description
The table clauses of CREATE PROPERTY GRAPH: SQL/PGQ’s element tables
(#295).
CREATE [OR REPLACE] PROPERTY GRAPH [IF NOT EXISTS] name
[VERTEX TABLES ( vertex_table [, …] )]
[EDGE TABLES ( edge_table [, …] )]
vertex_table := table [AS name] [KEY (column)] [labels]
edge_table := table [AS name] [KEY (column)]
SOURCE KEY (column) [REFERENCES vertex (column)]
DESTINATION KEY (column) [REFERENCES vertex (column)]
[labels]
labels := properties -- the default label
| DEFAULT LABEL [properties]
| LABEL name [properties] [LABEL name [properties] …]
| properties LABEL name [LABEL name …] (DuckPGQ's order)
properties := PROPERTIES (column [AS name], …)
| PROPERTIES [ARE] ALL COLUMNS [EXCEPT (column, …)]
| NO PROPERTIESAt least one of the two clauses is needed. Ursa’s relaxation stays: a graph
may have no vertex tables, and then its nodes are its edges’ endpoints. A
vertex KEY may be left out: the engine takes the table’s primary key, or
the column the edges’ REFERENCES name, as DuckPGQ does. REFERENCES
names a vertex table by its element name (its AS name, or else the table’s
name). Still refused, with a clear error: multi-column keys, SOURCE vertex
without KEY, and property expressions other than a column. NODE TABLES
and RELATIONSHIP TABLES, SQL/PGQ’s synonyms, are accepted.
Structs§
- Edge
Table Def - One entry of
EDGE TABLES (…). - Endpoint
Def KEY (key) [REFERENCES table (column)], afterSOURCEorDESTINATION.- Label
Def - One label of an element table and its properties.
name: Noneis the default label (writtenDEFAULT LABEL, or implied by a barePROPERTIESclause), which is the element table’s name. - References
REFERENCES vertex (column): a vertex table’s element name or table name.- Vertex
Table Def - One entry of
VERTEX TABLES (…).
Enums§
- Properties
Def - A label’s properties.