Change Password

Please enter the password.
Please enter the password. Between 8-64 characters. Not identical to your email address. Contain at least 3 of: uppercase, lowercase, numbers, and special characters.
Please enter the password.
Submit

Change Nickname

Current Nickname:
Submit

Apply New License

License Detail

Please complete this required field.

  • Ultipa Blaze (v4)

Standalone

Please complete this required field.

Please complete this required field.

Please complete this required field.

Please complete this required field.

Leave it blank if an HDC service is not required.

Please complete this required field.

Leave it blank if an HDC service is not required.

Please complete this required field.

Please complete this required field.

Mac addresses of all servers, separated by line break or comma.

Please complete this required field.

Please complete this required field.

Cancel
Apply
ID
Product
Status
Cores
Maximum Shard Services
Maximum Total Cores for Shard Service
Maximum HDC Services
Maximum Total Cores for HDC Service
Applied Validity Period(days)
Effective Date
Expired Date
Mac Address
Reason for Application
Review Comment
Close
Profile
  • Full Name:
  • Phone:
  • Company:
  • Company Email:
  • Country:
  • Language:
Change Password
Apply

You have no license application record.

Apply
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

Product Created On ID Amount (USD) Invoice
Product Created On ID Amount (USD) Invoice

No Invoice

v5.0
Search
    English
    v5.0

      GQL Execution

      This section introduces the gql() and gqlStream() methods to execute GQL in the database.

      GQL (Graph Query Language) is the ISO-standard query language for graph databases. For detailed information on GQL, refer to the documentation.

      gql()

      Executes a GQL query in the database.

      Parameters

      • gql: string: The GQL query to be executed.
      • config: RequestConfig (Optional): Request configuration.

      Returns

      • Response: Response of the request.

      // Retrieves 5 movie nodes from the graph 'miniCircle' and prints their names
      
      const requestConfig: RequestConfig = {
        graph: "miniCircle",
      };
      
      let response = await conn.gql(
        "MATCH (n:movie) RETURN n LIMIT 5",
        requestConfig
      );
      const nodeList = response.items?.get("n")?.asNodes();
      nodeList?.forEach((node) => {
        console.log(node.get("name"));
      });
      

      The Shawshank Redemption
      Farewell My Concubine
      Léon: The Professional
      Titanic
      Life is Beautiful
      

      gqlStream()

      Executes a GQL query in the database and returns the results incrementally, allowing handling of large datasets without loading everything into memory at once.

      Parameters

      • gql: string: The GQL query to be executed.
      • cb: RequestType.QueryResponseListener: Listener for the streaming process.
      • config: RequestConfig (Optional): Request configuration.

      Returns

      • void

      // Retrieves all 1-step paths from the graph 'miniCircle'
      
      const requestConfig: RequestConfig = {
        graph: "miniCircle",
      };
      
      let count = 0;
      let response = await conn.gqlStream(
        "MATCH p = ()-[]-() RETURN p",
        // Define the event handler functions
        {
            onStart: () => {
                console.log("Stream started.")
            },
            onData: async (res) => {
                let paths = res.items?.get("p")?.asPaths();
                count = count + (paths?.length || 0);
                console.log(count);
            },
            onEnd: () => {
                console.log("Stream ended.");
            },
            onError: (err) => {
                console.log(err);
            }
        },
        requestConfig
      );
      

      Stream started.
      1024
      2048
      3072
      3227
      3464
      3895
      Stream ended.
      

      Full Example

      import { ConnectionPool } from "@ultipa-graph/ultipa-driver";
      import { ULTIPA } from "@ultipa-graph/ultipa-driver/dist/types";
      
      let sdkUsage = async () => {
        // URI example: ultipaConfig.hosts: ["mqj4zouys.us-east-1.cloud.ultipa.com:60010"]
        const ultipaConfig: ULTIPA.UltipaConfig = {
          hosts: ["192.168.1.85:60061", "192.168.1.87:60061", "192.168.1.88:60061"],
          username: "<username>",
          password: "<password>"
        };
      
        const conn = await new ConnectionPool(
          ultipaConfig.hosts,
          ultipaConfig.username,
          ultipaConfig.password
        ).getActive();
        const isSuccess = await conn.test();
        console.log(`Connection succeeds: ${isSuccess}`);
      
        // Retrieves 5 movie nodes from the graph 'miniCircle' and prints their names
      
        const requestConfig: ULTIPA.RequestConfig = {
          graph: "miniCircle",
        };
        const response = await conn.gql(
          "MATCH (n:movie) RETURN n LIMIT 5",
          requestConfig
        );
        let nodeList = response.items?.get("n")?.asNodes();
        nodeList?.forEach((node) => {
          console.log(node.get("name"));
        });
      };
      sdkUsage().catch(console.error);
      
      Please complete the following information to download this book
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写