UltipaDocs
Try Playground
  • Introduction
    • Installation
    • Connection
      • Overview and Request Configuration
      • UQL Execution
      • GQL Execution
      • Graph
      • Schema and Property
      • Data Insertion
      • Query Acceleration
      • HDC Graph and Algorithm
      • Data Export
      • Process and Job
      • Access Control
    • Result Processing
    • Driver Data Classes
    • Installation
    • Connection
      • Overview and Request Configuration
      • UQL Execution
      • GQL Execution
      • Graph
      • Schema and Property
      • Data Insertion
      • Query Acceleration
      • HDC Graph and Algorithm
      • Data Export
      • Process and Job
      • Access Control
    • Result Processing
    • Driver Data Classes
    • Quick Start
    • Connect to Database
    • Query the Database
      • Graph
      • Schema and Property
      • Data Insertion
      • Query Acceleration
      • HDC Graph and Algorithm
      • Data Export
      • Process and Job
      • Access Control
    • Process Query Results
    • Data Structures
    • Quick Start
    • Connect to Database
    • Query the Database
      • Graph
      • Schema and Property
      • Data Insertion
      • Query Acceleration
      • HDC Graph and Algorithm
      • Data Export
      • Process and Job
      • Access Control
    • Process Query Results
    • Data Structures
    • Installation
    • Connection
    • Request Configuration
    • UQL Execution
    • GQL Execution
    • Graphset Management
    • Schema and Property Management
    • Data Insertion and Deletion
    • Query Acceleration
    • Algorithm Management
    • Downloads and Exports
    • Process and Task Management
    • Access Management
    • Server Statistics
    • Result Processing
    • Types Mapping Ultipa and C#
  • RESTful API
  1. Docs
  2. /
  3. Ultipa Drivers
  4. /
  5. C#

Result Processing

The output of the driver depends on the specific request made. Some methods, like Uql(), return a Response object, which requires you to extract the data and cast it into the corresponding driver type to serve the C# application. Other methods, like ShowGraph(), ShowSchema(), and ShowProperty(), return data of the driver type (GraphSet, Schema, Property, etc.) directly. Please read Types Mapping Ultipa and C# for a list of the core driver types.

Response

The Uql() and some other methods return a Response object. Response has the following fields:

Field
Type
Description
UqlReplyUqlReplyReply of the request execution.
StatusStatusExecution status of the request.
StatisticsStatisticsStatistics of the request execution, including NodeAffected, EdgeAffected, TotalCost, EngineCost, etc.
ExplainList<PlanNode>Explanation tree for the UQL statement.

If the query returns data, you can extract each item by its alias using the Get() or Alias() method. Both methods return a DataItem object, which embeds the query result. To map the DataItem to the corresponding driver type, please read Types Mapping Ultipa and C#.

Get()

Retrieves data by the alias index.

Parameters:

  • int: Index of the alias.

Returns:

  • DataItem: The retrieved data.
C#
var res = await ultipa.Uql("find().nodes() as n return n._id, n._uuid limit 3");
Console.WriteLine(JsonConvert.SerializeObject(res.Get(0)));

The UQL statement returns two aliases n._id and n._uuid; the Get() method retrieves the alias n._id at index 0.

Output
{"Data":{"Alias":"n._id","Attr":{"ValueType":7,"Values":[[85,76,84,73,80,65,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,49],[85,76,84,73,80,65,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,50],[85,76,84,73,80,65,56,48,48,48,48,48,48,48,48,48,48,48,48,48,48,51]]}},"AliasName":"n._id","OriginalResultType":4}

Alias()

Retrieves data by the alias name.

Parameters:

  • string: Name of the alias.

Returns:

  • DataItem: The retrieved data.
C#
var res = await ultipa.Uql("find().nodes() as n return n._id, n._uuid limit 3");
Console.WriteLine(JsonConvert.SerializeObject(res.Alias("n._uuid")));

The UQL statement returns two aliases n._id and n._uuid; the Alias() method retrieves the alias n._uuid by its name.

Output
{"Data":{"Alias":"n._uuid","Attr":{"ValueType":4,"Values":[[0,0,0,0,0,0,0,1],[0,0,0,0,0,0,0,2],[0,0,0,0,0,0,0,3]]}},"AliasName":"n._uuid","OriginalResultType":4}