Statement autonet().src().dest().depth()
can find and return paths from a group of initial-nodes to a group of terminal-nodes. It is a batch processing of A-B path query by paring initial-nodes and terminal-nodes for each query, hence its parameter limit()
is limiting the maximum returns of each A-B query other than the Autonet query.
Determined by the usage of parameter dest()
, autonet query works in two modes:
a) Inter-group Networking (when setting dest()
)
N
nodes from one group pairing withM
nodes from another groupN * M
times of A-B path query- When the parameter
limit(n)
is carried and the value of n is not -1, maximumn
*N * M
paths will be found
b) Intra-group Networking (when omitting dest()
)
- N nodes from one group pairing with each other:
N(N-1)/2
times of A-B path query- When the parameter
limit(n)
is carried and the value of n is not -1, maximumn
*N(N-1)/2
paths will be found
Syntax:
- Statement alias: supported (PATH)
- All parameters:
Parameter | Type | Specification | Description | Structure of Custom Alias |
---|---|---|---|---|
src() |
Filter | Mandatory | The filtering rules of the start node | NODE |
dest() |
Filter | The filtering rules of the end node | NODE | |
depth() |
Range | Mandatory | To set the depth of the path depth(N) : N edges depth(:N) : 1~N edges depth(M:N) : M~N edges depth(N).shortest() : the shortest path within N edges |
Not supported |
shortest() |
/ | / | To return the shortest paths | Not supported |
node_filter() |
Filter | The filtering rules that nodes other than src and dest need to satisfy |
Not supported | |
edge_filter() |
Filter | The filtering rules that all edges need to satisfy | Not supported | |
direction() |
String | left, right | To specify the direction of the edge | Not supported |
no_circle() |
/ | / | To dismiss the paths with circles; see Basic Concept - Terminologies for the definition of circle | Not supported |
limit() |
Int | -1 or >=0 | Number of results of each A-B query to return, -1 means to return all results | Not supported |
Inter-group Networking
N steps
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return two 5-step paths for each node pair
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(5)
.limit(2) as p
return p{*}
1~N steps
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 2 paths for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(:5)
.limit(2) as p
return p{*}
M~N steps
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 2 paths for each node pair within 3~5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(3:5)
.limit(2) as p
return p{*}
Non-weighted Shortest Path
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 2 shortest paths for each node pair within 5 edges
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(5)
.shortest().limit(2) as p
return p{*}
node_filter()
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 2 paths that do not contain @card nodes for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(:5)
.node_filter({!@card}).limit(2) as p
return p{*}
edge_filter()
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 2 paths that do not contain @transfer edges for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(:5)
.edge_filter({!@transfer}).limit(2) as p
return p{*}
direction(right)
Example: Autonet Card CA001, CA002, and CA003, to Card CA022 and CA029, return 2 paths in the right direction (outbound) for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CA022","CA029"]}).depth(:5)
.direction(right).limit(2) as p
return p
direction(left)
Example: Autonet Card CA001, CA002, and CA003, to Card CA022 and CA029, return 2 paths in the left direction (inbound) for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CA022","CA029"]}).depth(:5)
.direction(left).limit(2) as p
return p
no_circle()
Example: Autonet Card CA001, CA002, and CA003, to Card CA022 and CA029, return 2 non-circular paths for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CA022","CA029"]}).depth(:5)
.no_circle().limit(2) as p
return p
limit
Example: Autonet Card CA001, CA002, and CA003, to Customer CU001 and CU002, return 10 paths within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).dest({_id in ["CU001","CU002"]}).depth(5) as p
limit 10
return p{*}
Intra-group Networking
N steps
Example: Autonet Card CA001, CA002, and CA003 to each other, return two 5-step paths for each node pair
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(5)
.limit(2) as p
return p{*}
1~N steps
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths for each node pair within 1~5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.limit(2) as p
return p{*}
M~N steps
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths for each node pair within 3~5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(3:5)
.limit(2) as p
return p{*}
Non-weighted Shortest Path
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 shortest paths for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(5)
.shortest().limit(2) as p
return p{*}
node_filter()
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths that do not contain @card nodes for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.node_filter({!@card}).limit(2) as p
return p{*}
edge_filter()
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths that do not contain @transfer edges for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.edge_filter({!@transfer}).limit(2) as p
return p{*}
direction(right)
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths in the right direction (outbound) for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.direction(right).limit(2) as p
return p
direction(left)
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 paths in the left direction (inbound) for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.direction(left).limit(2) as p
return p
no_circle()
Example: Autonet Card CA001, CA002, and CA003 to each other, return 2 non-circular paths for each node pair within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(:5)
.no_circle().limit(2) as p
return p
limit
Example: Autonet Card CA001, CA002, and CA003 to each other, return 10 paths within 5 steps
autonet()
.src({_id in ["CA001","CA002","CA003"]}).depth(5) as p
limit 10
return p{*}