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

Same edge label between different vertex labels

Open kfirdado opened this issue 7 years ago • 2 comments

Expected behavior 期望表现

I would like to use the same edge label between different vertex label pairs:

graph.schema().edgeLabel("link").link('S1', 'T1').properties('foo').ifNotExist().create()
graph.schema().edgeLabel("link").link('S2', 'T2').properties('foo').ifNotExist().create()

or

graph.schema().edgeLabel("link").link('S1', 'T1').link('S2', 'T2').properties('foo').ifNotExist().create()

Actual behavior 实际表现

Link can be defined between one pair of vertex labels. Code also confirms that source label and target label are strings and not collections.

EdgeLabelBuilder.java:

    private String sourceLabel;
    private String targetLabel;

Steps to reproduce the problem 复现步骤

Run the above query.

Schema(VertexLabel, EdgeLabel, IndexLabel) 元数据结构

graph.schema().propertyKey('foo').asInt().ifNotExist().create()
graph.schema().propertyKey('bar').asInt().ifNotExist().create()
graph.schema().vertexLabel("S1").properties('foo', 'bar').ifNotExist().create()
graph.schema().vertexLabel("S2").properties('foo', 'bar').ifNotExist().create()
graph.schema().vertexLabel("T1").properties('foo', 'bar').ifNotExist().create()
graph.schema().vertexLabel("T2").properties('foo', 'bar').ifNotExist().create()

graph.schema().edgeLabel("link").link('S1', 'T1').link('S2', 'T2').properties('foo').ifNotExist().create()

Specifications of environment 环境信息

  • hugegraph version: v0.10.4
  • operating system: Ubuntu 18.04.3 LTS
  • hugegraph backend: RocksDB

kfirdado avatar Nov 17 '19 16:11 kfirdado

Yes, we can't support this feature, but we plan to implement it through vertex-label inheritance #447 and edge-label semantic extension #745. Currently please use multiple edge-labels for each relationship.

javeme avatar Nov 25 '19 06:11 javeme

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] avatar Jan 01 '22 21:01 github-actions[bot]