incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

RDF数据入库hugegraph遇到很多困难

Open happy-nlp opened this issue 5 years ago • 8 comments

您好,我有三个问题没有找到答案,想请教下: 每个实体有1200多个属性,似乎超出了限制,每次都会报错,导致无法入库,怎么增加属性数量上限?报错如下: ERROR: Failed to load Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during class generation: 1200 java.lang.ArrayIndexOutOfBoundsException: 1200

还有一个关系入库的bug困扰着我,我用csv方式存储的关系,每行只有两个自定义id用于建立连接,但是vertex中自定义id和name联合做主键,入库关系时报错Invalid id 例如某一行 sx27105,sx10945 写入关系时报错Invalid vertex id '1:null!sx27105' 经检索sx27105实体已经入库.我怀疑是你们仍然用name和id组合去查找实体了,但是我只用id属性做关联,这个问题怎么解决呢?

还有个小问题,默认展示的是主键,我想展示其他字段怎么设置呢?

happy-nlp avatar Dec 19 '20 01:12 happy-nlp

@boo-boos 分别解答:

  1. 请问插入顶点是使用Gremlin进行的吗?建议使用rest api接口。同时,可以给出错误的堆栈信息方便我们分析。
  2. 看起来不是bug,如果顶点类型是id+name联合主键,那么导入边时也应该使用id+name,而不是仅仅只有id。如果不是上述意思,建议单独提交一个issue,贴出struct和schema,以供判断错误原因。
  3. hugegraph-hubble可以在【元数据-编辑】里面修改展示列。

image

javeme avatar Dec 23 '20 09:12 javeme

@boo-boos 分别解答:

  1. 请问插入顶点是使用Gremlin进行的吗?建议使用rest api接口。同时,可以给出错误的堆栈信息方便我们分析。
  2. 看起来不是bug,如果顶点类型是id+name联合主键,那么导入边时也应该使用id+name,而不是仅仅只有id。如果不是上述意思,建议单独提交一个issue,贴出struct和schema,以供判断错误原因。
  3. hugegraph-hubble可以在【元数据-编辑】里面修改展示列。

image

您好,感谢回复,关于问题2和3,我尝试下。至于问题1,我贴出来的就是报错信息,使用hugegraph-loader入库的。仔细尝试之后,似乎属性值上限是256,超过即报错,我有1200个属性,因此报 ERROR: Failed to load Exception in thread "main" org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: General error during class generation: 1200 java.lang.ArrayIndexOutOfBoundsException: 1200

happy-nlp avatar Dec 29 '20 01:12 happy-nlp

至于问题1,我贴出来的就是报错信息,使用hugegraph-loader入库的。仔细尝试之后,似乎属性值上限是256,超过即报错,我有1200个属性

可以先使用rest-api将schema创建好,loader创建schema使用的是groovy语法,可能groovy数组有256这个限制,实际上hugegraph没有这个限制的。

javeme avatar Dec 31 '20 07:12 javeme

@boo-boos 还有其他的问题吗?没问题就关闭issue了。

Linary avatar Dec 31 '20 08:12 Linary

@Linary 看看loader是否能loader不受256这个限制?

javeme avatar Jan 05 '21 03:01 javeme

@Linary 我也遇到了这个问题 有一种实体字段过多 如果采用了api的方式预先定义了schema,那么是不是以后就不能使用loader的方式更新数据了???

zx-6017 avatar Jan 11 '21 04:01 zx-6017

@Linary 是否有方式更改loader的限制?

zx-6017 avatar Jan 11 '21 04:01 zx-6017

@happy-nlp @zx-6017 可以先定义一个 list,然后调list的toArray()方法传入properties中。举例:

list = ["1","2"..."n"]
schema.vertexLabel("person")
      .properties(list.toArray(new String[0]))
      .primaryKeys("name")
      .nullableKeys("age", "city")
      .ifNotExist()
      .create();

Linary avatar Jan 11 '21 08:01 Linary