age
age copied to clipboard
Create Path
TODO: redefine
Syntax
ag_catalog.age_create_path(graph_name Name, n int, left_node agtype, right_node agtype,
vertex_label_name Name DEFAULT = NULL,
vertex_properties agtype DEFAULT = NULL,
edge_label_name Name DEAULT = NULL,
edge_properties agtype DEFAULT = NULL,
bidirectional bool DEFAULT = true)
Input:
- graph_name - Name of the graph to be created
- n - number of vertices in the path.
- vertex_label_name - Name of the label to assign each vertex to.
- vertex_properties - Property values to assign each vertex. Default is NULL
- edge_label_name - Name of the label to assign each edge to.
- edge_properties - Property values to assign each edge. Default is NULL
- bidirectional - Bidirectional True or False. Default True. TODO: Make an enum for left, right, or both
it looks great and I think these will allow for more clarity.
The vertex and edge label and property default parameters are currently set to NULL. It might be better to set default empty values like "" for strings and {} for dictionaries so the function will still work if these parameters are omitted.
The bidirectional parameter default is true, so the "dir" attribute is only set for non-bidirectional edges. It might be good to always set this attribute for clarity, with the value "both" for bidirectional edges.
The function currently requires an integer for n and will create vertices named "v0" through "vn-1". It might be better to allow n to be a string so the user can specify the vertex names themselves. This would make the function more flexible. or change the vertex_label_name to be a vector where each vertex may have its unique name.
Hello @JoshInnis, is it okay if I try to make this function? Asking because I don't know if it has been done already or if there is anyone working on it. And, just to confirm, the function must create a Path Graph, correct?