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 Graph V4

Standalone

Please complete this required field.

Please complete this required field.

The MAC address of the server you want to deploy.

Please complete this required field.

Please complete this required field.

Cancel
Apply
ID
Product
Status
Cores
Applied Validity Period(days)
Effective Date
Excpired Date
Mac Address
Apply Comment
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

      HDC Graph Queries

      Overview

      To execute a UQL query on an HDC graph, use the syntax:

      exec{
        <query>
      } on <hdcGraphName>
      

      HDC graphs support queries that retrieve data from the database with enhanced efficiency. However, remember that any query attempting to write data will fail on HDC graphs.

      Example Graph

      To create the graph, execute each of the following UQL queries sequentially in an empty graphset:

      create().node_schema("entity").edge_schema("link")
      create().edge_property(@link, "weight", float)
      insert().into(@entity).nodes([{_id:"A"},{_id:"B"},{_id:"C"},{_id:"D"}])
      insert().into(@link).edges([{_from:"A", _to:"B", weight:1},{_from:"A", _to:"C", weight:1.5},{_from:"A", _to:"D", weight:0.5},{_from:"B", _to:"C", weight:2},{_from:"C", _to:"D", weight:0.5}])
      

      Queries on HDC Graphs

      To create an HDC graph hdcGraph of the entire graph:

      hdc.graph.create("hdcGraph", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      To run the ab() query on hdcGraph:

      exec{
        ab().src({_id == "A"}).dest({_id == "C"}).depth(2) as p
        return p
      } on hdcGraph
      

      Result: p

      To run the khop() query on hdcGraph:

      exec{
        khop().src({_id == "A"}).depth(1).direction(right) as n
        return count(n)
      } on hdcGraph
      

      Result:

      count(n)
      3

      Limited Graph Traversal Direction

      If an HDC graph is created with the direction option set to in or out, graph traversal is restricted to incoming or outgoing edges, respectively. Queries attempting to traverse in the missing direction throws errors or yields empty results.

      To create an HDC graph hdcGraph_in_edges of the graph with nodes and incoming edges:

      hdc.graph.create("hdcGraph_in_edges", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "in",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      This khop() query attempts to follow the outgoing (right) edges on hdcGraph_in_edges, no result will be returned.

      exec{
        khop().src({_id == "A"}).depth(1).direction(right) as n
        return count(n)
      } on hdcGraph_in_edges
      

      Result:

      count(n)
      0

      Exclusion of Node IDs

      If an HDC graph is created with the load_id option set to false, it does not contain the _id values for nodes. Queries referencing _id throws errors or yields empty results.

      To create an HDC graph hdcGraph_no_id of the graph without nodes' _id values:

      hdc.graph.create("hdcGraph_no_id", {
        nodes: {"*": ["*"]},
        edges: {"*": ["*"]},
        direction: "undirected",
        load_id: false,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      The ab() query utilizes _id to filter nodes on hdcGraph_no_id, error occurs as the HDC graph lacks nodes' _id:

      exec{
        ab().src({_id == "A"}).dest({_id == "C"}).depth(2) as p
        return p{*}
      } on hdcGraph_no_id
      

      Exclusion of Properties

      If an HDC graph is created without certain properties, queries referencing those properties throws errors or yields empty results.

      To create an HDC graph hdcGraph_no_weight of the graph containing nodes and only system properties of @link edges:

      hdc.graph.create("hdcGraph_no_weight", {
        nodes: {"*": ["*"]},
        edges: {"link": []},
        direction: "undirected",
        load_id: true,
        update: "static",
        query: "query",
        default: false
      }).to("hdc-server-1")
      

      The ab() query finds shortest path between two nodes on hdcGraph_no_weight, weighted by the edge property @link.weight, error occurs as the weight property is missing:

      exec{
        ab().src({_id == "A"}).dest({_id == "C"}).depth(2).shortest(@link.weight) as p
        return p
      } on hdcGraph_no_weight
      

      Unsupported Data Modifications

      The following query results in an error indicating that node insertion is not supported on HDC graphs:

      exec{
        insert().into(@entity).nodes([{_id: "E"}])
      } on hdcGraph
      
      Please complete the following information to download this book
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写