CREATE GRAPH Syntax
Parameters
OR REPLACE
OR REPLACE
Any existing graph with the same name will be dropped before creating this one
DIRECTED
DIRECTED
Optional keyword used to create the graph as directed
<schema name>
<schema name>
Name of the schema that will contain the created graph; if no schema is specified, the graph will be
created in the calling user’s default schema
<graph name>
<graph name>
Name of the graph, which can be referenced in subsequent commands
EDGES
EDGES
Graph component, provided as table column names, expressions, or constants using the SQL
INPUT_TABLE or
INPUT_TABLES function, to use for identifying the edges of the graph; review Components and Identifiers and
Identifier Combinations for more informationThe input can be either the name of a table with appropriately named columns; or a query, to use
specific columns or other SQL features).
NODES
NODES
Optional graph component, provided as column names, expressions, or constants using the SQL
INPUT_TABLE or
INPUT_TABLES function, to use for identifying the nodes of the graph; review Components and Identifiers and
Identifier Combinations for more informationThe input can be either the name of a table with appropriately named columns; or a query, to use
specific columns or other SQL features).
WEIGHTS
WEIGHTS
Optional graph component, provided as column names, expressions, or constants using the SQL
INPUT_TABLE or
INPUT_TABLES function, to use for identifying the weights of the graph; review Components and Identifiers and
Identifier Combinations for more informationThe input can be either the name of a table with appropriately named columns; or a query, to use
specific columns or other SQL features).
RESTRICTIONS
RESTRICTIONS
Optional graph component, provided as column names, expressions, or constants using the SQL
INPUT_TABLE or
INPUT_TABLES function, to use for identifying the restrictions of the graph; review
Components and Identifiers and Identifier Combinations for more informationThe input can be either the name of a table with appropriately named columns; or a query, to use
specific columns or other SQL features).
OPTIONS
OPTIONS
Optional indicator that a list of connection option/value assignments will follow, passed as a comma-delimited
list of key/value pairs to the
KV_PAIRS function| Option | Description |
|---|---|
add_table_monitor | Adds a table monitor to every table used in the creation of the graph; this table monitor will trigger the graph to update dynamically upon inserts to the source table(s). Note that upon database restart, if save_persist is also set to true, the graph will be fully reconstructed and the table monitors will be reattached. For more details on table monitors, see Table Monitors. The default value is false. |
add_turns | Adds dummy “pillowed” edges around intersection nodes where there are more than three edges so that additional weight penalties can be imposed by the solve endpoints (increases the total number of edges). The default value is false. |
allow_multiple_edges | Enables multigraph capability—pairs of nodes can be connected by more than one edge. Without this option, undirected graphs can only have one edge between each pair of nodes, and directed graphs can have one edge in each direction between each pair of nodes—“duplicate” edges are discarded. |
cluster_graph_schema | If export_graph_schema is true, outputs the graph’s schema into a table named <graph_name>_clusters |
export_graph_schema | Exports a graph’s schema in Graphviz DOT format. The schema is a conversion of the graph into a label-based ontology, done by grouping the nodes using the Louvain clustering algorithm. This schema is made available in two ways:
|
graph_table | If specified, the created graph is also created as a table with the given name, in [schema_name.]table_name format, using standard name resolution rules and meeting table naming criteria. The table will have the following identifier columns: EDGE_ID, EDGE_NODE1_ID, EDGE_NODE2_ID. If left blank, no table is created. The default value is blank. |
is_partitioned | If set to true, the graph will be partitioned across the servers specified in server_id; if false, the graph will be replicated across those servers. The default value is false. |
label_delimiter | If specified, the delimiter to use when parsing edge labels. All labels separated by this delimiter will be applied to the corresponding edge. |
merge_tolerance | If node geospatial positions are input (e.g., POINT(X Y)), determines the minimum separation allowed between unique nodes. If nodes are within the tolerance of each other, they will be merged as a single node. The default value is 1.0E-5. |
recreate | If set to true and the graph already exists, the graph is deleted and recreated. The default value is false. |
save_persist | If set to true, the graph will be saved in the persist directory (see the config reference for more information). If set to false, the graph will be removed when the graph server is shutdown. The default value is false. |
schema_edge_labelkeys | If export_graph_schema is true, generates the label-based schema by collapsing edges based on the their label keys; otherwise, schema edges are created from the edge labels. |
schema_node_labelkeys | If export_graph_schema is true, generates the label-based schema by collapsing nodes based on the their label keys; otherwise, schema nodes are created from the node labels. |
server_id | Indicates on which graph server(s) to create the graph. Default is to create on the server with the most available memory. Can be a single server ID, a comma-separated list of IDs, or all for all servers. |
simplify | Simplifies the graph topology at 2-valence by collapsing edge. |
use_rtree | Use a range tree structure to accelerate and improve the accuracy of snapping, especially to edges. |