Change Password

Input error
Input error
Input error
Submit
v2.x

Insertion

4.1 Insert Node

  • Single insertion:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.insertNode(ULTIPA_REQUEST.InsertNode(nodes = [{'name':'test1','age':13},{'name':'test2'}]))
    print(ret.toJSON())
    # node id will be returned if insertion is successful
    
  • Batch insertion:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    rows = [{"name": 'test1'}, {"name": 'test2'}]
    # each record to be inserted needs to have the same set of property values declared
    ret = conn.insertNodesBulk(ULTIPA_REQUEST.InsertNodeBulk(rows=rows),
                        ULTIPA_REQUEST.Common(graphSetName=self.gname))
    print(ret.toJSON())
    # node id will be returned if insertion is successful
    
  • Batch insertion in silent mode:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    rows = [{"name": 'test1'}, {"name": 'test2'}]
    # each record to be inserted needs to have the same set of property values declared
    ret = conn.insertNodesBulk(ULTIPA_REQUEST.InsertNodeBulk(rows=rows,
              silent=True),ULTIPA_REQUEST.Common(graphSetName=self.gname))
    print(ret.toJSON())
    # node id will not be returned
    

4.2 Insert Edge

  • Single insertion:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.insertEdge(ULTIPA_REQUEST.InsertEdge(edges =	
    		                  [{'_from_id':1,'_to_id':2,'name':'test'}, {'_from_id':2,'_to_id':5}]))
    print(ret.toJSON())
    
  • Batch insertion:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    results = [{"_from_id": 2,"_to_id":8,"name": 'Help'}, {"_from_id": 5,"_to_id":1,"name": 'Help'}]
    # each record to be inserted needs to have the same set of property values declared
    ret = conn.insertEdgesBulk(ULTIPA_REQUEST.InsertEdgeBulk(rows=results),
                                        ULTIPA_REQUEST.Common(self.gname))
    print(ret.toJSON())
    # edge id will be returned if insertion is successful
    
  • Batch insertion in silent mode:

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    results = [{"_from_id": 2,"_to_id":8,"name": 'Help'}, {"_from_id": 5,"_to_id":1,"name": 'Help'}]
    # each record to be inserted needs to have the same set of property values declared
    ret = conn.insertEdgesBulk(ULTIPA_REQUEST.InsertEdgeBulk(rows=results,
                            silent=True),ULTIPA_REQUEST.Common(self.gname))
    print(ret.toJSON())
    # edge id will not be returned