Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
Search
v4.0
    v4.0

    K-Hop Template

    K-Hop template query finds the K-hop neighbors by the filtering rules composed by path templates. Upon achieving the same query function, K-Hop template yields better performance than path template.

    Syntax:

    • Command: khop()
    • Parameter: Path templates, please note the following provisions
      • The start node template n() must have filtering rules
      • [<steps>] in multiple edges template can only be a definite value, which is [N]
      • It's not allowed to use preceding alias in the current path template, prev_n and prev_e are also denied
    • Statement Alias: Custom alias supported, structure type is NODE

    Common Usage

    Example: Find the cards that Customer CU001's card reaches in 2-step shortest transaction paths, return the count of card's owners with all properties

    khop()
      .n({_id == "CU001"}).re().n({@card})
      .le({@transfer})[2].n({@card})
      .le().n({@customer}) as n
    return n{*}
    

    Analysis: This example can be regarded as a K-Hop query as it queries the dest of the shortest path. For khop() command itself can not set different rules to filter the directions and properties for the edges that appear sequentially in the path, it's necessary to use template to implement the entire UQL statement.

    Example: as the path structure shown in the graph below, find the cards using the same phone numbers used by Customer CU013 and CU020's cards, count the number of these cards

    khop()
      .n({_id in ["CU013","CU020"]}).re().n({@card})
      .re().n({@phone})
      .le().n({@card}) as n
    return count(n)
    
    Please complete the following information to download this book
    *
    公司名称不能为空
    *
    公司邮箱必须填写
    *
    你的名字必须填写
    *
    你的电话必须填写
    *
    你的电话必须填写