Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
v4.0

Query

Node Query

  • The Connection object provides method searchNode to find nodes.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    # Find any nodes
    ret = conn.searchNode(ULTIPA_REQUEST.SearchNode(select=ULTIPA_REQUEST.Return(alias="nodes",
      				allProperties=True, limit=10)))
    # Find nodes by specifying filtering conditions
    nodeFilter = ULTIPA_REQUEST.UltipaFilter(schema='default', filterType=FilterEnum.EQ,
      				property='name', value="test1")
    ret = conn.searchNode(ULTIPA_REQUEST.SearchNode(select=ULTIPA_REQUEST.Return(alias="nodes",
      				allProperties=True, limit=10), filter=nodeFilter))
    
  • Query by composing uQL

    ret = conn.uql("find().nodes({@default.name == 'test1'}) as nodes return nodes{*} limit 10")
    print(ret.toJSON())
    

Edge Query

  • The Connection object provides method searchEdge to find edges.

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    # Find any edges
    ret = conn.searchEdge(ULTIPA_REQUEST.SearchEdge(select=ULTIPA_REQUEST.Return(alias="edges",
      				allProperties=True, limit=10)))
    # Find edges by specifying filtering conditions
    edgeFilter = ULTIPA_REQUEST.UltipaFilter(schema='default', filterType=FilterEnum.EQ,
      				 property="name",value="test2")
    ret = conn.searchEdge(ULTIPA_REQUEST.SearchEdge(select=ULTIPA_REQUEST.Return(alias="edges",
      				allProperties=True, limit=10), filter=edgeFilter))
    
  • Query by composing uQL

    ret = conn.uql("find().edges({@default.name == 'test'}) as edges return edges{*} limit 10")
    print(ret.toJSON())
    

AB Path

  • AB path query by composing uQL

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("ab().src({_id == 'U001'}).dest({_id == 'U002'}).depth(:3) as paths 
                   return paths{*}{*} limit 5")
    print(ret.toJSON())
    

Khop

  • Khop query by composing uQL

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("khop().src({_id == 'U001'}).depth(1).edge_filter({@own}) as nodes 
                   return count(nodes)")
    print(ret.toJSON())
    

Template

  • Template query by composing uQL

    • path template
    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("n({_id == 'U001'}).re({@own}).n({@card}).re({@transaction}).n({@card})
                   .le({@own}).n({_id == 'U002'}) as paths return paths")
    print(ret.toJSON())
    
    • subgraph tempalte
    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("graph([
                   n({_id == 'U001'}).re().n({@card}).re({@transaction}).n({@card} as cards),
                   n({_id == 'U002'}).re().n({@card}).re({@transaction}).n({@card} as cards)]) 
    				return cards")
    print(ret.toJSON())
    
    • khop template
    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("khop().n({_id == 'U001'}).re().n({@card}).e({@transaction}).nf({@card})[2]
                   .n({@card}).le().n({@account}) as nodes return count(distinct(nodes))")
    print(ret.toJSON())
    

Autonet

  • Autonet query by composing uQL

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("autonet().src({_id in ['U001','U002']}).dest({_id in ['U003','U004']}).depth(:5) 
                   as path return path limit 1")
    print(ret.toJSON())
    

Spread

  • Spread query by composing uQL

    from ultipa import Connection, ULTIPA_REQUEST, ULTIPA
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.uql("spread().src({_id == 'U001'}).depth(3).node_filter({@card})
                   .edge_filter({@transaction || @card}).direction(right) as path 
                   return path limit 100")
    print(ret.toJSON())
    
Please complete the following information to download this book
*
公司名称不能为空
*
公司邮箱必须填写
*
你的名字必须填写
*
你的电话必须填写
*
你的电话必须填写