修改密码

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

      ListSchema()

      方法及相关类:

      ListSchema(DBType ultipa.DBType, config *configuration.RequestConfig) ([]*structs.Schema, error)
      

      示例:获取test图集的点、边schema列表

      func TestMisc(t *testing.T) {
          // 创建名为conn的连接并使用default图集,此部分代码省略
      
        	requestConfig := &configuration.RequestConfig{
      		GraphName: "test",
      	}
        
      	nodeSchemas, _ := conn.ListSchema(ultipa.DBType_DBNODE, requestConfig)
      	printers.PrintSchema(nodeSchemas)
      	edgeSchemas, _ := conn.ListSchema(ultipa.DBType_DBEDGE, requestConfig)
      	printers.PrintSchema(edgeSchemas)
      }
      

      GetSchema()

      方法及相关类:

      GetSchema(schemaName string, 
      		  DBType ultipa.DBType, 
                config *configuration.RequestConfig
      ) (*structs.Schema, error)
      

      示例:获取test图集的点schema account和边schema transfer的信息

      func TestMisc(t *testing.T) {
          // 创建名为conn的连接并使用default图集,此部分代码省略
      
        	requestConfig := &configuration.RequestConfig{
      		GraphName: "test",
      	}
        
      	nodeSchema, _ := conn.GetSchema("client", ultipa.DBType_DBNODE, requestConfig)
      	fmt.Println(*nodeSchema)
      	edgeSchema, _ := conn.GetSchema("transfer", ultipa.DBType_DBEDGE, requestConfig)
      	fmt.Println(*edgeSchema)
      }
      

      GetNodeSchema() | GetEdgeSchema()

      方法及相关类:

      GetNodeSchema(schemaName string, config *configuration.RequestConfig) (*structs.Schema, error)
      
      GetEdgeSchema(schemaName string, config *configuration.RequestConfig) (*structs.Schema, error)
      

      示例:获取test图集的点schema account和边schema transfer的信息

      func TestMisc(t *testing.T) {
          // 创建名为conn的连接并使用default图集,此部分代码省略
      
        	requestConfig := &configuration.RequestConfig{
      		GraphName: "test",
      	}
        
      	nodeSchema, _ := conn.GetNodeSchema("client", requestConfig)
      	fmt.Println(*nodeSchema)
      	edgeSchema, _ := conn.GetEdgeSchema("transfer", requestConfig)
      	fmt.Println(*edgeSchema)
      }
      

      CreateSchema()

      方法及相关类:

      CreateSchema(schema *structs.Schema, 
      			 isCreateProperties bool, 
                   conf *configuration.RequestConfig
      ) (*http.UQLResponse, error)
      
      Schema struct {
      	Name       string
      	Properties []*Property
      	Desc       string
      	Type       string
      	DBType     ultipa.DBType
      	Total      int
      }
      
      Property struct {
      	Name   string
      	Desc   string
      	Lte    bool
      	Schema string
      	Type   ultipa.PropertyType
      }
      

      示例:为图集test创建一个有属性的点schema card1,再创建一个无属性的点schema card2

      func TestMisc(t *testing.T) {
          // 创建名为conn的连接并使用default图集,此部分代码省略
      
        	requestConfig := &configuration.RequestConfig{
      		GraphName: "test",
      	}
        
      	schema := &structs.Schema{
      		Name:   "card1",
      		Desc:   "card with 2 properties",
      		DBType: ultipa.DBType_DBNODE,
      		Properties: []*structs.Property{
      			{
      				Name: "balance",
      				Type: ultipa.PropertyType_FLOAT,
      			},
      			{
      				Name: "level",
      				Type: ultipa.PropertyType_INT32,
      			},
      		},
      	}
      
      	resp1, _ := conn.CreateSchema(schema, true, requestConfig)
      	log.Println(resp1.Status.Code)
      
      	schema.Name = "card2"
      	schema.Desc = "card with no property"
      
      	resp2, _ := conn.CreateSchema(schema, false, requestConfig) // 第二个参数 false 表示不创建属性
      	log.Println(resp2.Status.Code)
      }
      

      CreateSchemaIfNotExist()

      方法及相关类:

      CreateSchemaIfNotExist(schema *structs.Schema, config *configuration.RequestConfig) (exist bool, err error)
      
      Schema struct {
      	Name       string
      	Properties []*Property
      	Desc       string
      	Type       string
      	DBType     ultipa.DBType
      	Total      int
      }
      
      Property struct {
      	Name   string
      	Desc   string
      	Lte    bool
      	Schema string
      	Type   ultipa.PropertyType
      }
      

      示例:创建schema时,如果该schema已存在则返回true,否则返回false并创建

      func TestMisc(t *testing.T) {
          // 创建名为conn的连接并使用default图集,此部分代码省略
      
        	requestConfig := &configuration.RequestConfig{
      		GraphName: "test",
      	}
        
      	schema := &structs.Schema{
      		Name: "card1",
              DBType: ultipa.DBType_DBNODE,
      	}
      
      	isExist, _ := conn.CreateSchemaIfNotExist(schema, requestConfig)
      	log.Println(isExist)    
      }
      
      请完成以下信息后可下载此书
      *
      公司名称不能为空
      *
      公司邮箱必须填写
      *
      你的名字必须填写
      *
      你的电话必须填写
      *
      你的电话必须填写