修改密码

请输入密码
请输入密码 请输入8-64长度密码 和 email 地址不相同 至少包括数字、大写字母、小写字母、半角符号中的 3 个
请输入密码
提交

修改昵称

当前昵称:
提交

申请证书

证书详情

Please complete this required field.

  • Ultipa Graph V4

Standalone

Please complete this required field.

Please complete this required field.

服务器的MAC地址

Please complete this required field.

Please complete this required field.

取消
申请
ID
产品
状态
核数
申请天数
审批时间
过期时间
MAC地址
申请理由
审核信息
关闭
基础信息
  • 用户昵称:
  • 手机号:
  • 公司名称:
  • 公司邮箱:
  • 地区:
  • 语言:
修改密码
申请证书

当前未申请证书.

申请证书
Certificate Issued at Valid until Serial No. File
Serial No. Valid until File

Not having one? Apply now! >>>

ProductName CreateTime ID Price File
ProductName CreateTime ID Price File

No Invoice

搜索
    中文

      返回值的结构化

      DataItem

      使用UQLReply的get()alias()方法时将获得DataItem类。

      DataItem的方法:

      方法 类型 说明
      asNodes() Node[] 将NODE类型的DataItem转为Node[]
      asEdges() Edge[] 将EDGE类型的DataItem转为Edge[]
      asPaths() Path[] 将PATH类型的DataItem转为Path[]
      asGraphs() ResponseType.Graph[] 将默认别名_graph的DataItem转为Graph[]
      asSchemas() ResponseType.Graph[] 将默认别名_nodeSchema、_edgeSchema 的DataItem转为Schema[]
      asProperties() ResponseType.Graph[] 将默认别名_nodeProperty、_edgeProperty的DataItem转为Property[]
      asAlgos() ResponseType.Graph[] 将默认别名_algoList的DataItem转为Algo[]
      asTable() Table 将TABLE类型的DataItem转为Table
      asArray() any[][] 将ARRAY类型的DataItem转为any[][]
      asAttrs() AttrAlias 将ATTR类型的DataItem转为AttrAlias
      toJSONString() string 将任意类型的DataItem转为json格式的字符串

      也可以使用方法asTable()将默认别名 _graph、_nodeSchema、_edgeSchema等的DataItem转为Table。

      Node

      Node 类的字段:

      字段 类型 说明
      id string Node的ID
      uuid string Node的UUID
      schema string Node的Schema
      values object Node的自定义属性

      Node 类的方法:

      方法 类型 说明
      getID() string 获取当前Node的ID
      getUUID() string 获取当前Node的UUID
      getSchema() string 获取当前Node的Schema
      getValues() object 获取当前Node的Values(自定义属性)
      get(prop_name: string) any 获取当前Node的某个自定义属性
      set(prop_name: string, value: any) void 设置当前Node的某个自定义属性,属性名不存在时将则添加该键值对

      示例:发送嬴图GQL语句查询一列点,获取第二个点的ID,同时将第一个点的rating改为8并输出

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("find().nodes({@movie}) as nodes return nodes{*} limit 5");
        printers.DataItem.node(resp.data?.alias("nodes"));
      
        console.log("ID of 2nd node is: " + resp.data?.alias("nodes").asNodes()[1].getID());
        console.log("rating of 1st node was: " + resp.data?.alias("nodes").asNodes()[0].get("rating"));
        resp.data?.alias("nodes").asNodes()[0].set("rating",8)
        console.log("rating of 1st node now is: " + resp.data?.alias("nodes").asNodes()[0].get("rating"));
        
      };
      
      sdkUsage();
      

      输出:

      Alias: nodes Type: RESULT_TYPE_NODE
       @movie
      ┌─────────┬─────────┬──────────────────────────┬────────┬────────┬──────┐
      │ (index) │ @schema │           _id            │ _uuid  │ rating │ year │
      ├─────────┼─────────┼──────────────────────────┼────────┼────────┼──────┤
      │    0    │ 'movie' │ 'ULTIPA80000000000003E9' │ '1001' │   9    │ 1994 │
      │    1    │ 'movie' │ 'ULTIPA80000000000003EA' │ '1002' │   7    │ 1993 │
      │    2    │ 'movie' │ 'ULTIPA80000000000003EB' │ '1003' │   6    │ 1998 │
      │    3    │ 'movie' │ 'ULTIPA80000000000003EC' │ '1004' │   9    │ 1994 │
      │    4    │ 'movie' │ 'ULTIPA80000000000003ED' │ '1005' │   9    │ 1997 │
      └─────────┴─────────┴──────────────────────────┴────────┴────────┴──────┘
      ID of 2nd node is: ULTIPA80000000000003EA
      rating of 1st node was: 9
      rating of 1st node now is: 8
      

      Edge

      Edge类的字段:

      字段 类型 说明
      uuid string Edge的UUID
      from_uuid string Edge起点的UUID
      to_uuid string Edge终点的UUID
      from string Edge起点的ID
      to string Edge终点的ID
      schema string Edge的Schema
      values object Edge的自定义属性

      Edge类的方法:

      方法 类型 说明
      getUUID() string 获取当前Edge的UUID
      getFromUUID() string 获取当前Edge起点的UUID
      getToUUID() string 获取当前Edge终点的UUID
      getFrom() string 获取当前Edge起点的ID
      getTo() string 获取当前Edge终点的ID
      getSchema() string 获取当前Edge的Schema
      getValues() object 获取当前Edge的Values(自定义属性)
      get(prop_name: string) any 获取当前Edge的某个自定义属性
      set(prop_name: string, value: any) void 设置当前Edge的某个自定义属性,属性名不存在时将则添加该键值对

      示例:发送嬴图GQL语句查询一列边,获取第二个边的起点的ID,为第一个边添加属性value并设置为8

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("find().edges({@default}) as edges return edges{*} limit 5");
        printers.DataItem.edge(resp.data?.alias("edges"));
      
        console.log("ID of start node of 2nd edge is: " + resp.data?.alias("edges").asEdges()[1].getFrom());
        console.log("value of 1st edge was: " + resp.data?.alias("edges").asEdges()[0].get("value"));
        resp.data?.alias("edges").asEdges()[0].set("value",8)
        console.log("value of 1st edge now is: " + resp.data?.alias("edges").asEdges()[0].get("value"));
        
      };
      
      sdkUsage();
      

      输出:

      Alias: edges Type: RESULT_TYPE_EDGE
       @default
      ┌─────────┬───────────┬───────┬──────────────────────────┬──────────────────────────┬────────────┬──────────┐
      │ (index) │  @schema  │ _uuid │          _from           │           _to            │ _from_uuid │ _to_uuid │
      ├─────────┼───────────┼───────┼──────────────────────────┼──────────────────────────┼────────────┼──────────┤
      │    0    │ 'default' │ '21'  │     'ULTIPA0000003'      │      'ULTIPA0000004'     │    '20'    │   '21'   │
      │    1    │ 'default' │ '24'  │ 'ULTIPA8000000000000001' │ 'ULTIPA8000000000000002' │    '56'    │   '34'   │
      │    2    │ 'default' │ '29'  │ 'ULTIPA800000000000001A' │ 'ULTIPA800000000000001B' │    '24'    │   '65'   │
      └─────────┴───────────┴───────┴──────────────────────────┴──────────────────────────┴────────────┴──────────┘
      ID of start node of 2nd edge is: ULTIPA8000000000000001
      value of 1st edge was: undefined
      value of 1st edge now is: 8
      

      Path

      Path类的字段:

      字段 类型 说明
      nodes Node[] Path中的Node列表
      edges Edge[] Path中的Edge列表
      length number Path的长度,即Edge的数量

      Path 类的方法:

      方法 类型 说明
      getLength() number 获取当前Path的长度,即Edge的数量
      getNodes() Node[] 获取当前Path的Node列表
      getEdges() Edge[] 获取当前Path的Edge列表

      示例:发送嬴图GQL语句查询一列路径,获取第一个路径的第二个点

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("n().e()[2].n() as paths return paths{*} limit 3");
        printers.DataItem.path(resp.data?.alias("paths"));
      
        console.log("the 2nd node in the 1st path:");
        console.log(resp.data?.alias("paths").asPaths()[0].getNodes()[1]);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: paths Type: RESULT_TYPE_PATH
      ┌─────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────┐
      │ (index) │                                                Values                                             
         │
      ├─────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────┤
      │    0    │ '(ULTIPA80000000000003E9) <- [1475] - (ULTIPA8000000000000014) - [1350] -> (ULTIPA8000000000000066)'  │
      │    1    │ '(ULTIPA80000000000003E9) <- [1363] - (ULTIPA8000000000000018) - [1353] -> (ULTIPA800000000000005F)'  │
      │    2    │ '(ULTIPA80000000000003E9) <- [1645] - (ULTIPA8000000000000016) - [1374] -> (ULTIPA80000000000003FB)' │
      └─────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────┘
      the 2nd node in the 1st path:
      Node {
        id: 'ULTIPA8000000000000014',
        uuid: '20',
        schema: 'account',
        values: { name: 'Meng', industry: 'Construction', gender: 'female', year: 1982 }
      }
      

      Graph

      Graph类的字段:

      字段 类型 说明
      id string Graph的ID
      name string Graph的名称
      description string Graph的描述
      totalNodes string Graph的点数量
      totalEdges string Graph的边数量
      status string Graph的状态(MOUNTED、UNMOUNTED)
      clusterID string 集群ID

      示例:发送嬴图GQL语句查询图集列表,获取第三个图集的名称

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("show().graph()");
        printers.DataItem.table(resp.data?.alias("_graph"));
      
        console.log("name of 3rd graph is: " + resp.data?.alias("_graph").asGraphs()[2].name);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: _graph Type: RESULT_TYPE_TABLE
      ┌─────────┬────────┬────────────────────┬────────────┬────────────┬─────────────┬─────────────┐
      │ (index) │   id   │        name        │ totalNodes │ totalEdges │ description │   status    │
      ├─────────┼────────┼────────────────────┼────────────┼────────────┼─────────────┼─────────────┤
      │    0    │ '1172' │  'DeliveryCenter'  │    '30'    │    '77'    │      ''     │  'MOUNTED'  │
      │    1    │ '1208' │   'GithubSocial'   │  '37700'   │  '289003'  │      ''     │  'MOUNTED'  │
      │    2    │ '1116' │      'HB_POC'      │    '0'     │    '0'     │      ''     │ 'UNMOUNTED' │
      │    3    │ '1601' │     'Industry'     │    '0'     │    '0'     │      ''     │  'MOUNTED'  │
      └─────────┴────────┴────────────────────┴────────────┴────────────┴─────────────┴─────────────┘
      name of 3rd graph is: HB_POC
      

      Schema

      Schema类的字段:

      字段 类型 说明
      name string Schema的名称
      description string Schema的描述
      properties Property[] Schema的所有Property
      totalNodes string Schema的点数量
      totalEdges string Schema的边数量

      示例:发送嬴图GQL语句查询当前图集的点schema列表,获取第三个点schema的点的数量

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("show().node_schema()");
        printers.DataItem.table(resp.data?.alias("_nodeSchema"));
      
        console.log("number of nodes of 3rd node schema is: " + resp.data?.alias("_nodeSchema").asSchemas()[2].totalNodes);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: _nodeSchema Type: RESULT_TYPE_TABLE
      ┌─────────┬─────────────┬──────────────────┬────────────────────────────────────────────────────────────────────┬────────────┐
      │ (index) │    name     │   description    │                             properties                             │ totalNodes │
      ├─────────┼─────────────┼──────────────────┼────────────────────────────────────────────────────────────────────┼────────────┤
      │    0    │  'default'  │ 'default schema' │                                '[]'                                │    '0'     │
      │    1    │  'country'  │        ''        │ '[{"name":"name","type":"string","description":"","lte":"false"}]' │    '23'    │
      │    2    │ 'celebrity' │        ''        │ '[{"name":"name","type":"string","description":"","lte":"false"}]' │    '78'    │
      └─────────┴─────────────┴──────────────────┴────────────────────────────────────────────────────────────────────┴────────────┘
      number of nodes of 3rd node schema is: 78
      

      Property

      Property类的字段:

      字段 类型 说明
      name string Property的名称
      description string Property的描述
      schema string Property的Schema
      type string Property的数据类型
      lte string Property的LTE状态(true、false、creating)

      示例:发送嬴图GQL语句查询当前图集的点schema account的属性列表,获取第四个点属性的LTE信息

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("show().node_property(@account)");
        printers.DataItem.table(resp.data?.alias("_nodeProperty"));
      
        console.log("lte of 4th node property is: " + resp.data?.alias("_nodeProperty").asProperties()[3].lte);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: _nodeProperty Type: RESULT_TYPE_TABLE
       @account
      ┌─────────┬────────────┬──────────┬─────────┬───────────┬─────────────┐
      │ (index) │    name    │   type   │   lte   │  schema   │ description │
      ├─────────┼────────────┼──────────┼─────────┼───────────┼─────────────┤
      │    0    │   'name'   │ 'string' │ 'false' │ 'account' │     ''      │
      │    1    │ 'industry' │ 'string' │ 'false' │ 'account' │     ''      │
      │    2    │  'gender'  │ 'string' │ 'false' │ 'account' │     ''      │
      │    3    │   'year'   │ 'int32'  │ 'true'  │ 'account' │     ''      │
      └─────────┴────────────┴──────────┴─────────┴───────────┴─────────────┘
      lte of 4th node property is: true
      

      Algo

      Algo类的字段:

      字段 类型 说明
      name string Algo的名称
      param object Algo的参数,包括算法名、描述、参数列表、版本号等信息
      result_opt object Algo的结果选项
      clusterId string 集群ID

      示例:发送嬴图GQL语句查询已安装的算法列表,获取第三个算法的名称及版本

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("show().algo()");
        printers.DataItem.table(resp.data?.alias("_algoList"));
      
        console.log("name of 3rd algo is: " + resp.data?.alias("_algoList").asAlgos()[2].name);
        console.log("version of 3rd algo is: " + resp.data?.alias("_algoList").asAlgos()[2].param.version);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: _algoList Type: RESULT_TYPE_TABLE
      ┌─────────┬────────────────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────┐
      │ (index) │          name          │                                                 param                                                     │                  detail                    │
      ├─────────┼────────────────────────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────┤
      │    0    │         'celf'         │               '{"name":"celf","description":"celf","version":"1.0.0","parameters":...}'                   │ 'base:\r\n  category: Centrality\r\n  ...' │
      │    1    │ 'harmonic_centrality'  │  '{"name":"harmonic_centrality","description":"harmonic_centrality","version":"1.0.0","parameters":...}'  │ 'base:\r\n  category: Centrality\r\n  ...' │
      │    2    │ 'closeness_centrality' │ '{"name":"closeness centrality","description":"closeness centrality","version":"1.0.1","parameters":...}' │ 'base:\r\n  category: Centrality\r\n  ...' │
      │    3    │        'degree'        │    '{"name":"degree centrality","description":"degree centrality","version":"1.0.3","parameters":...}'    │ 'base:\r\n  category: Centrality\r\n  ...' │
      │    4    │       'khop_all'       │        '{"name":"khop_all","description":"khop_all","version":"1.0.2","parameters":...}'                  │   'base:\r\n  category: General\r\n  ...'  │
      └─────────┴────────────────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────┘
      name of 3rd algo is: closeness_centrality
      version of 3rd algo is: 1.0.1
      

      Table

      Table类的字段:

      字段 类型 说明
      name string Table的别名
      alias string Table的别名
      headers string[] Table的表头
      rows any[][] Table的所有行

      Table类的方法:

      方法 类型 说明
      getHeaders() string[] 获取当前Table的表头
      getRows() any[][] 获取当前Table的所有行
      toKV() any[] 将当前Table转换成KV列表

      示例:发送嬴图GQL语句查询一个表格,获取该表格的表头及第二行数据

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("find().nodes({@account}) limit 5 return table(nodes.gender, nodes.year) as myTable");
        printers.DataItem.table(resp.data?.alias("myTable"));
      
        console.log("headers are: " + resp.data?.alias("myTable").asTable().getHeaders());
        console.log("2nd row is: " + resp.data?.alias("myTable").asTable().getRows()[1]);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: myTable Type: RESULT_TYPE_TABLE
      ┌─────────┬──────────────┬────────────┐
      │ (index) │ nodes.gender │ nodes.year │
      ├─────────┼──────────────┼────────────┤
      │    0    │   'female'   │    1978    │
      │    1    │   'female'   │    1989    │
      │    2    │    'male'    │    1982    │
      │    3    │   'female'   │    2007    │
      │    4    │    'male'    │    1973    │
      └─────────┴──────────────┴────────────┘
      headers are: nodes.gender,nodes.year
      2nd row is: female,1989
      

      any[][] (ARRAY)

      示例:发送嬴图GQL语句查询一列数组,获取第二个数组的第三个元素

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("find().nodes({@account}) as nodes group by nodes.industry return collect(nodes.name) as myArray limit 3");
        printers.DataItem.attr(resp.data?.alias("myArray"));
      
        console.log("3rd element of 2nd array is: " + resp.data?.alias("myArray").asAttrs()[1][2]);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: myArray Type: RESULT_TYPE_ATTR
      [ 'jibber-jabber', 'jo', 'CR.', 'laofung', 'pepe' ]
      [ 'Meng', 'HolyC', 'pixiedust', 'Blair_self', 'sadmov' ]
      [ 'Unbeliever', 'Ivo', 'Nannobrycon', 'auric', 'Blair_self' ]
      3rd element of 2nd array is: pixiedust
      

      AttrAlias

      AttrAlias的字段:

      字段 类型 说明
      alias string AttrAlias的别名
      values any[] AttrAlias的所有行
      type PropertyType AttrAlias的类型代号
      type_desc string AttrAlias的类型名称

      示例:发送嬴图GQL语句查询一列属性,获取第二个属性

      import { ConnectionPool, printers } from "@ultipa-graph/ultipa-node-sdk";
      
      let sdkUsage = async () => {
      
        // 创建名为conn的连接,此部分代码省略
        
        let resp = await conn.uql("find().nodes({@account}) as nodes return nodes.industry as myAttr limit 5");
        printers.DataItem.attr(resp.data?.alias("myAttr"));
      
        console.log("2nd attribute is: " + resp.data?.alias("myAttr").asAttrs().values[1]);
        
      };
      
      sdkUsage();
      

      输出:

      Alias: myAttr Type: RESULT_TYPE_ATTR
      {
        alias: 'myAttr',
        type: 7,
        type_desc: 'string',
        values: [ 'Manufacturing', 'Health', 'Other', 'Education', 'Publishing' ]
      }
      2nd attribute is: Health
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写