Property Management

7.1 Get Property

  • Get node properties

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.getProperty(ULTIPA_REQUEST.GetProperty(type=ULTIPA.DBType.DBNODE))
    print(ret.toJSON())
    
  • Get edge properties

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.getProperty(ULTIPA_REQUEST.GetProperty(type=ULTIPA.DBType.DBEDGE))
    print(ret.toJSON())
    
  • List all node and edge properties

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.listProperty()
    print(ret.toJSON())
    

7.2 Create Property

  • Users can create properties for node and edge by specifying the property's name and data type. The properties will be created in the disk.

  • Create node property

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.createProperty(ULTIPA_REQUEST.CreatProperty(type=ULTIPA.DBType.DBNODE,
    name='test',property_type=ULTIPA.CreatePropertyType.PROPERTY_STRING))
    print(ret.toJSON())
    
  • Create edge property

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.createProperty(ULTIPA_REQUEST.CreatProperty(type=ULTIPA.DBType.DBEDGE,
    name='test',property_type=ULTIPA.CreatePropertyType.PROPERTY_STRING))
    print(ret.toJSON())
    

7.3 Drop Property

  • Users can delete properties of node or edge by specifying the property's type and name.

  • Drop node property

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.dropProperty(ULTIPA_REQUEST.DropProperty(type=ULTIPA.DBType.DBNODE,
    		name='test'))
    print(ret.toJSON())
    
  • Drop edge property

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.dropProperty(ULTIPA_REQUEST.DropProperty(type=ULTIPA.DBType.DBEDGE,
    		name='test'))
    print(ret.toJSON())
    

7.4 Property LTE

  • LTE, abbreviation for 'Load to Engine', loads disk-based properties into Ultipa's high performance graph computing engine for filtering purposes in various types of queries. LTE requires sufficient RAM space for stable operation.

  • Load node property to engine

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.lte(ULTIPA_REQUEST.LTE(type=ULTIPA.DBType.DBNODE,property='name'))
    print(ret.toJSON())
    
  • Load edge property to engine

from ultipa import Connection,ULTIPA_REQUEST
conn = Connection(host='host:port', username="root", password="root")
ret = conn.lte(ULTIPA_REQUEST.LTE(type=ULTIPA.DBType.DBEDGE,property='name'))
print(ret.toJSON())

7.5 Property UFE

  • UFE stands for 'Unload From Engine', and unloads the properties that are no longer needed for filtering operations from the RAM hence saves memory space. The unloaded properties will still exist in the disk until being dropped by the user. The deletion of a property that has been loaded to engine will also trigger the execution of UFE.

  • Unload node property from engine

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.ufe(ULTIPA_REQUEST.UFE(property='name',type=ULTIPA.DBType.DBNODE))
    print(ret.toJSON())
    
  • Unload edge property from engine

    from ultipa import Connection,ULTIPA_REQUEST
    conn = Connection(host='host:port', username="root", password="root")
    ret = conn.ufe(ULTIPA_REQUEST.UFE(property='name',type=ULTIPA.DBType.DBEDGE))
    print(ret.toJSON())