Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
Search
v4.0
    v4.0

    A-to-B Query

    A-to-B query or shorted as A-B query is to find paths between a pair of nodes by the specified depth, the depth can be from 1 to N; or the depth can be set to the shortest.

    Syntax:

    • Command: ab()
    • Parameter: (see the table below)
    • Statement Alias: Custom alias supported, structure type is PATH
    Parameter Type Specification Description Structure Type of Custom Alias
    src() Filter Mandatory The filtering rules of the start node; error will occur if multiple nodes are found NODE
    dest() Filter Mandatory The filtering rules of the end node; error will occur if multiple nodes are found 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 (or the least weighted) paths within N edges
    Not supported
    shortest() / or @<schema>.<property> Numeric edge property; LTE is required When no edge property is specified, return the shortest path; when edge property is specified, return the least weighted paths using the specified property as the weight factor (edges without the property do not form the path). When shortest() is used, value inside depth() should be a constant, that is, depth(N).shortest(<>), means the shortest (or the least weighted) paths within N edges 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
    path_ascend() @<schema>.<property> Numeric edge property; LTE is required To return paths where the specified property ascends (edges without the property do not form the path) Not supported
    path_descend() @<schema>.<property> Numeric edge property; LTE is required To return paths where the specified property descends (edges without the property do not form the path) Not supported
    direction() String left, right To specify the direction of the edge Not supported
    no_circle() / / To dismiss the paths with circles; see chapter Basic Concept for the definition of circle under Terminologies Not supported
    limit() Int -1 or >=0 Number of results to return, -1 means to return all results Not supported

    N steps

    Example: Find ten 4-step paths from Card CA001 to Card CA002, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(4) as p
    limit 10 
    return p{*}
    

    1~N steps

    Example: Find 10 paths from Card CA001 to Card CA002 within 4 steps, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4) as p
    limit 10
    return p{*}
    

    M~N steps

    Example: Find 10 paths from Card CA001 to Card CA002 within 2~4 steps, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(2:4) as p
    limit 10
    return p{*}
    

    Non-weighted Shortest Path

    Example: Find 10 shortest 4-step paths from Card CA001 to Card CA002, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(4)
      .shortest() as p
    limit 10
    return p{*}
    

    Weighted Shortest Path

    Example: Find 10 shortest 4-step paths weighted by @transfer.amount from Card CA001 to Card CA002, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(4)
      .shortest(@transfer.amount) as p
    limit 10
    return p{*}
    

    node_filter()

    Example: Find 10 paths from Card CA001 to Card CA002 within 4 steps return all non-@card node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .node_filter({!@card}) as p
    limit 10
    return p{*}
    

    edge_filter()

    Example: Find 10 paths from Card CA001 to Card CA002 within 4 steps, return all node and non-@transaction edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .edge_filter({!@transfer}) as p
    limit 10
    return p{*}
    

    path_ascend()

    Example: Find 10 paths from Card CA001 to Card CA002 within 4 steps, return all node and @transfer edge properties in an ascending order of time

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .path_ascend(@transfer.time) as p
    limit 10
    return p{*}
    

    path_descend()

    Example: Find 10 paths from Card CA001 to Card CA002 within 4 steps, return all node and @transfer edge properties in a descending order of time

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .path_descend(@transfer.time) as p
    limit 10
    return p{*}
    

    direction(right)

    Example: Find 10 paths with a right direction from Card CA001 to Card CA002 within 4 steps, return all node and @transfer edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .edge_filter({@transfer}).direction(right) as p
    limit 10
    return p{*}
    

    direction(left)

    Example: Find 10 paths with a left direction from Card CA001 to Card CA002 within 4 steps, return all node and @transfer edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(:4)
      .edge_filter({@transfer}).direction(left) as p
    limit 10
    return p{*}
    

    no_circle()

    Example: Find ten 5-step paths that must not contain circled paths and are from Card CA001 to Card CA002, return all node and edge properties

    ab().src({_id == "CA001"}).dest({_id == "CA002"}).depth(5)
      .no_circle() as p
    limit 10
    return p{*}
    

    limit()

    Example: Find 5-step paths from Card CA001 to Card CA002 to Node 10 respectively, return 3 paths from each set with all node and edge properties

    uncollect ["CA001","CA002"] as n
    ab().src({_id == n}).dest({_id == "CA005"}).depth(5)
      .limit(3) as p
    return p{*}
    
    Please complete the following information to download this book
    *
    公司名称不能为空
    *
    公司邮箱必须填写
    *
    你的名字必须填写
    *
    你的电话必须填写
    *
    你的电话必须填写