修改密码

请输入密码
请输入密码 请输入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

搜索
    中文

      Schema

      概述

      Schema(模式)是数据的某种结构定义,能更加直观地将真实世界还原到图之上,从而清晰方便地管理图数据。在嬴图系统中,一个schema代表真实世界中的一类实体(点),如自然人、银行卡、账户等;或一类行为或关系(边),如关注、转账、持有等。

      每个图集包含一个默认点schema(default)和一个默认边schema(default),它们不可删除。在一个图集中可以创建多个点、边schema。

      嬴图GQL中出现@符号时通常表示与schema有关的操作——使用@<schema>可以对图模型或元数据中的schema进行过滤。

      Schema命名规则

      Schema由用户命名,规则如下:

      • 2~64个字符
      • 不能以波浪号(~)开头
      • 不能包含反单引号(`)
      • 不能与系统保留字(包括系统属性、系统表名、系统别名等)重名

      一个图集中的点schema不能重名,边schema也不能重名,但点schema可以和边schema重名。

      Schema名称中含有数字、字母、下划线以外的字符时,在嬴图GQL语句中使用时需要用的一对反单引号(`)包裹。

      find().nodes({@`用户`}) as nodes return nodes{*} limit 10
      

      查看Schema

      返回的表名:_nodeSchema_edgeSchema
      返回的表头:name | description | properties | totalNodestotalEdges(Schema名、描述、属性列表、点数量或边数量)

      // 查看当前图集中的所有schema(结果分点、边两个表返回)
      show().schema()
      
      // 查看当前图集中的所有点schema
      show().node_schema()
      
      // 查看当前图集中的所有边schema
      show().edge_schema()
      
      // 查看当前图集中的一个指定点schema
      show().node_schema(@<schema>)
      
      // 查看当前图集中的一个指定边schema
      show().edge_schema(@<schema>)
      

      创建Schema

      // 在当前图集中创建一个点schema
      create().node_schema("<name>", "<desc?>")
      
      // 在当前图集中创建一个边schema
      create().edge_schema("<name>", "<desc?>")
      
      // 在当前图集中同时创建多个点或边schema
      create()
        .node_schema("<name>", "<desc?>")
        .edge_schema("<name>", "<desc?>")
        ...
      

      示例:创建点schema card、account和边schema own

      create()
        .node_schema("card", "Bank_Card")
        .node_schema("account", "Bank_Account")
        .edge_schema("own")
      

      示例:创建点schema card

      create().node_schema("card")
      

      如果点schema card已存在:

      Schema already exists!
      

      使用前缀TRY:

      • Schema名不存在时创建schema
      • Schema名已存在时不报错
      try create().node_schema("card")
      

      修改Schema

      // 修改当前图集中一个指定点schema的名称、描述
      alter().node_schema(@<schema>)
        .set({name: "<new_name?>", description: "<new_desc?>"})
      
      // 修改当前图集中一个指定边schema的名称、描述
      alter().edge_schema(@<schema>)
        .set({name: "<new_name?>", description: "<new_desc?>"})
      

      删除Schema

      删除一个schema时,会同时删除其关联的所有属性及元数据。

      // 从当前图集中删除一个指定点schema
      drop().node_schema(@<schema>)
                         
      // 从当前图集中删除一个指定边schema
      drop().edge_schema(@<schema>)
      
      // 同时删除多个点和/或边schema
      drop()
        .node_schema(@<schema>)
        .edge_schema(@<schema>)
        ...
      

      默认点、边schema(default)不允许删除。

      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写