修改密码

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

v5.0
搜索
    v5.0

      属性

      概述

      属性与schema关联,用来描述点和边的不同特征。例如,点schemacard可能有属性balanceopenedDate,边schematransfers可能有属性amounttime

      UQL使用运算符.提取schema中的属性。使用表达式@<schema>.<property>指定schema下的属性,如@company.name

      系统属性

      每个携带两条系统属性_id_uuid,是点数据的唯一标识符。点的_id值可以手动指定,但需确保该值唯一,而_uuid值由系统自动生成。

      系统属性
      值类型
      描述
      _id string 点的字符串类型(最大长度为128字节)唯一标识符
      _uuid uint64 点的数值型唯一标识符

      每条仅携带一条系统属性_uuid,是边数据的唯一标识符,由系统自动生成。每条边连接一个起点和一个终点,_from/_to_from_uuid/_to_uuid可用来显示边的两个端点。

      系统属性
      值类型
      描述
      _uuid uint64 边的数值型唯一标识符
      _from string 边起点的_id
      _to string 边终点的_id
      _from_uuid uint64 边起点的_uuid
      _to_uuid uint64 边终点的_uuid

      显示属性

      获取当前图集中所有属性信息:

      // 显示所有属性
      show().property()
      
      // 显示所有点属性
      show().node_property()
      
      // 显示与指定点schema关联的属性
      show().node_property(@card)
      
      // 显示所有边属性
      show().edge_property()
      
      // 显示与指定边schema关联的属性
      show().edge_property(@transfers)
      

      属性信息展示在不同表格中:

      • 点属性:表_nodeProperty展示所有点属性信息,表_nodeProperty_shard_N展示分区N中的点属性信息。
      • 边属性:表_edgeProperty展示所有边属性信息,表_edgeProperty_shard_N展示分区N中的边属性信息。

      表中各字段提供了每个属性的基础信息:

      字段
      描述
      name 属性名
      type 属性值类型
      lte 属性是否已加载至分片内存以加速查询
      read 当前数据库用户能否读取该属性,1表示可以,0表示不可以
      write 当前数据库用户能否写入该属性,1表示可以,0表示不可以
      schema 属性关联的schema
      description 对属性的描述
      encrypt 属性加密方法

      创建属性

      使用单个create()语句创建一或多个属性。串联使用node_property()edge_property()方法可指定每个属性。使用encrypt()方法可以加密属性。

      create()
        .node_property(<schema>, "<propName>", <propValueType?>, "<propDesc?>").encrypt("<encMeth?>")
        .edge_property(<schema>, "<propName>", <propValueType?>, "<propDesc?>").encrypt("<encMeth?>")
        ...
      
      方法 参数 描述
      node_property()edge_property() <schema> 指定点schema或边schema,如@user@*指代所有点schema或边schema
      <propName> 属性名称。命名规范如下:
      • 2~64字符
      • 不能使用波浪号~开头
      • 不能包含反引号`,不能与任何系统属性、系统表别名或系统别名重名(请参阅保留字
      一个schema下,属性不可重名
      <propValueType?> 可选。属性值类型。忽略该参数时,将默认使用string。查看所有属性值类型。请注意,属性创建完成后,无法更改其值类型
      <propDesc?> 可选。对属性的描述
      encrypt() <encMeth?> 可选。加密属性,支持使用以下方法:AES128(默认),AES256RSAECC

      整数类属性

      整数类属性值类型包括int32uint32int64uint64

      create().node_property(@user, "age", uint32)
      

      小数类属性

      小数类属性值类型包括floatdoubledecimal

      create()
        .edge_property(@links, "distance", float)
        .edge_property(@links, "weight",  "decimal(25,10)", "Weight of the relation")
      

      decimal(25,10)指定一个精度(所有数字的位数,不包括小数点)为25、标度(小数点后的数字位数)为10的decimal类型。可设置的精度范围为1~65,标度范围为0~30。特别注意,声明decimal属性值类型时,需使用一对引号包裹decimal(<precision>, <scale>)

      文本类属性

      文本类属性值类型包括stringtext,其中string是默认类型,可以不明确指定。

      create()
        .node_property(@post, "title")
        .node_property(@post, "content", text)
      

      时间类属性

      时间类属性值类型包括datetimetimestamp

      create()
        .node_property(@post, "createdOn", timestamp, "When the post is created")
        .node_property(@post, "publishedOn", datetime, "When the post is published")
      

      布尔类属性

      布尔类属性值类型为bool

      create().node_property(@city, "isCapital", bool, "Indicates whether it is the capital city")
      

      空间类属性

      空间类属性值类型为point

      create().node_property(@city, "position", point, "Location of the city")
      

      列表类属性

      列表类属性值类型包括子类型int32int64uint32uint64floatdoublestringtextdatetimetimestamp

      create().node_property(@user, "interests", "string[]", "user interest tags")
      

      特别注意,声明列表类属性值类型时,需使用一对引号包裹<subtype>[]

      集合类属性

      集合类属性值类型包括子类型int32int64uint32uint64floatdoublestringtextdatetimetimestamp

      create()
        .node_property(@user, "heights", "set(float)", "Store user heights history as a set")
      

      特别注意,声明集合类属性值类型时,需使用一对引号包裹set(<subtype>)

      为所有schema创建一个属性

      为所有边schema创建属性time

      create().edge_property(@*, "time", datetime)
      

      加密属性

      创建属性password并使用AES256方法对其加密:

      create().node_property(@user, "password", string).encrypt("AES256")
      

      修改属性名称和描述

      使用语句alter().node_property().set()alter().edge_property().set()修改属性的名称和描述。

      node_property()edge_property()方法里,可使用@<schema>.<property>格式指定某属性,或使用@*.<property>格式指定所有同名属性。

      修改点属性@user.name的名称和描述:

      alter().node_property(@user.name).set({name: "Name", description: "Full name"})
      

      修改所有名为time的边属性的名称:

      alter().edge_property(@*.time).set({name: "createdOn"})
      

      删除属性

      使用单个drop()语句可以删除一或多个属性。串联使用node_property()edge_property()方法可指定每个属性。属性删除后,所有相关数据都将删除,其中包括属性值、关联的索引、全文索引和内存中加载到引擎的值。

      node_property()edge_property()方法中,可使用@<schema>.<property>格式指定某个属性。

      删除点属性@user.name

      drop().node_property(@user.name)
      

      删除边属性time

      drop().edge_property(@*.time)
      

      删除多个属性:

      drop().node_property(@user.age).edge_property(@*.time)
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写