Once the connection is established, you can send requests to query the database through various methods on the Connection
object, categorized as follows:
UQL Execution
|
|
Graphset Management
|
Schema and Property Management
|
Data Insertion and Deletion
|
Query Acceleration
|
Algorithm Management
|
Downloads and Exports
|
Process and Task Management
|
Access Management
|
Others
|
The task specific methods eliminate the need to explicitly write UQL. The following two examples use the uql()
and getNodeSchema()
methods respectively to retrieve the club-member
node schema and print its associated properties. Notice that the latter is easier to write and returns the result as a Schema
directly. While with uql()
, you need to extract the data from response:UltipaResponse
and cast it into Schema
.
# Uses the uql() method
response = Conn.uql("show().node_schema(@`club-member`)")
schemas = response.get(0).asSchemas()
for schema in schemas:
print(schema.properties)
# Uses the getNodeSchema() method
schema = Conn.getNodeSchema("club-member")
print(schema.properties)
However, the uql()
method serves all querying purposes and can be utilized when the task specific methods are not privided, such as for node, edge or path queries.
Lastly, if you are retrieving a large amount of data from the database, it is recommended to use the the uqlStream()
method to processes the result set incrementally.