showProperty()
Method and class:
def showProperty(self,
requestConfig: ULTIPA_REQUEST.RequestConfig = ULTIPA_REQUEST.RequestConfig()
) -> ULTIPA_RESPONSE.ResponseListProperty
Example: Acquire the information of all properties of graphset 'test'
from ultipa import Connection, UltipaConfig, RequestConfig
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.showProperty(requestConfig = RequestConfig("test"))
print(req.toJSON())
getProperty()
Method and class:
def getProperty(self,
request: ULTIPA_REQUEST.GetProperty,
requestConfig: ULTIPA_REQUEST.RequestConfig = ULTIPA_REQUEST.RequestConfig()
) -> ULTIPA_RESPONSE.ResponseGetProperty
class GetProperty:
def __init__(self, type: ULTIPA.DBType, schema: str = None)
Example: Acquire the information of all edge properties of of graphset 'test'
from ultipa import Connection, UltipaConfig, RequestConfig
from ultipa import ULTIPA_REQUEST, ULTIPA
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.getProperty(
ULTIPA_REQUEST.GetProperty(ULTIPA.DBType.DBEDGE),
RequestConfig("test"))
req.Print()
Example: Acquire the information of all properties of node schema 'customer' of graphset 'test'
from ultipa import Connection, UltipaConfig, RequestConfig
from ultipa import ULTIPA_REQUEST, ULTIPA
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.getProperty(
ULTIPA_REQUEST.GetProperty(ULTIPA.DBType.DBNODE, "customer"),
RequestConfig("test"))
req.Print()
createProperty()
Method and class:
def createProperty(self,
request: ULTIPA_REQUEST.CreateProperty,
requestConfig: ULTIPA_REQUEST.RequestConfig = ULTIPA_REQUEST.RequestConfig()
) -> ULTIPA_RESPONSE.UltipaResponse
class CreateProperty:
def __init__(self,
type: ULTIPA.DBType,
commonSchema: CommonSchema,
propertyType: ULTIPA.CreatePropertyType = ULTIPA.CreatePropertyType.PROPERTY_STRING,
description: str = ''
)
class CommonSchema:
def __init__(self, schema: str, property: str)
Example: Craete edge property @transfer.amount
for graphset 'test', with data type 'float' and description 'transaction amount'
from ultipa import Connection, UltipaConfig, RequestConfig
from ultipa import ULTIPA_REQUEST, ULTIPA
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.createProperty(
ULTIPA_REQUEST.CreateProperty(
ULTIPA.DBType.DBEDGE,
ULTIPA_REQUEST.CommonSchema("transfer", "amount"),
ULTIPA.CreatePropertyType.PROPERTY_FLOAT,
"transaction amount"
),
RequestConfig("test"))
req.Print()
alterProperty()
Method and class:
def alterProperty(self,
request: ULTIPA_REQUEST.AlterProperty,
requestConfig: ULTIPA_REQUEST.RequestConfig = ULTIPA_REQUEST.RequestConfig()
) -> ULTIPA_RESPONSE.UltipaResponse
class AlterProperty:
def __init__(self,
type: ULTIPA.DBType,
commonSchema: CommonSchema,
newName: str,
newDescription: str = ''
)
class CommonSchema:
def __init__(self, schema: str, property: str)
Example: Modify edge property @transfer.type
of graphset 'test' with new name 'TYPE' and new description 'transfer type'
from ultipa import Connection, UltipaConfig, RequestConfig
from ultipa import ULTIPA_REQUEST, ULTIPA
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.alterProperty(
ULTIPA_REQUEST.AlterProperty(
ULTIPA.DBType.DBEDGE,
ULTIPA_REQUEST.CommonSchema("transfer", "type"),
"TYPE",
"transfer type"
),
RequestConfig("test"))
req.Print()
dropProperty()
Method and class:
def dropProperty(self,
request: ULTIPA_REQUEST.DropProperty,
requestConfig: ULTIPA_REQUEST.RequestConfig = ULTIPA_REQUEST.RequestConfig()
) -> ULTIPA_RESPONSE.UltipaResponse
class DropProperty:
def __init__(self, type: ULTIPA.DBType, commonSchema: CommonSchema)
class CommonSchema:
def __init__(self, schema: str, property: str)
Example: Delete node property @card.level
from graphset 'test'
from ultipa import Connection, UltipaConfig, RequestConfig
from ultipa import ULTIPA_REQUEST, ULTIPA
# omit code of establishing server connection 'conn' using graphset 'default'
req = conn.dropProperty(
ULTIPA_REQUEST.DropProperty(
ULTIPA.DBType.DBNODE,
ULTIPA_REQUEST.CommonSchema("card", "level")
),
RequestConfig("test"))
req.Print()