图引擎服务 GES-Filtered-query V2(2.3.6):请求示例

时间:2024-07-26 17:14:16

请求示例

  • 请求样例1:列出满足过滤条件的第k跳节点或边,查询类型是出点,作用在下一跳的点上。
    POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=path-query
     {
       "repeat":[
         {
           "operator":"outV",
           "vertex_filter":{
             "property_filter":{
               "leftvalue":{
                 "label_name":"labelName"
               },
               "predicate":"=",
               "rightvalue":{
                 "value":"rate"
               }
             }
           }
         }
       ],
       "times":2,
       "vertices":[
         "1","2"
       ]
     }

    以上请求等价于gremlin语句:g.V('1','2').repeat(out().hasLabel('rate')).times(2).dedup()

  • 请求样例2:列出满足过滤条件的第k跳节点或边,查询类型是出点,作用在下一跳的点上。
    POST /ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=path-query
     {
       "repeat":[
         {
           "operator":"outV",
           "vertex_filter":{
             "property_filter":{
               "leftvalue":{
                 "label_name":"labelName"
               },
               "predicate":"=",
               "rightvalue":{
                 "value":"rate"
               }
             }
           }
         }
       ],
       "until":[
         {
           "vertex_filter":{
             "property_filter":{
               "leftvalue":{
                 "property_name":"movieid"
               },
               "predicate":"=",
               "rightvalue":{
                 "value":"1"
               }
             }
           }
         }
       ],
       "vertices":[
         "v1","v2"
       ]
     }

    以上请求等价于gremlin语句:

    g.V('v1','v2').repeat(out().hasLabel('rate')).until(has('movieid','1')).dedup()

support.huaweicloud.com/api-ges/ges_03_0331.html