Nebula-V2添加点和边的多标签??

比如player的tag, 怎么再加个person的tag呢?? 就是点和边的多标签

边是不支持多个类型的,边只支持单类型多个属性。一个 player 如果是一个点的话,直接可以创建一个 person 的 tag 就好了,可以给 person 加很多属性,Nebula 是一个属性图,建议你去阅读下我们的文档。了解下我们的一些基础概念 Nebula Graph常用语法(CRUD) - Nebula Graph Database 手册

你好, steam,
我可能没有说清楚我的意思, 我想表达的是同一个点可以支持多个标签吗? 比如: 一位成年男性, 儿子对其既以叫是"爸爸", 也可以叫"父亲", 但是指的是同一个人(就是这里的点或者边), 你有理解吗? 这种支持吗? 就比如neo4j中的同一个点支持多标签化

neo4j的label,在nebula中是没有的概念和操作的。
tag不能实现label的功能

wu老师,
tag 和label是不同的, 我明白, 其实就一句话, nebula中一个的点不能同时拥有多了tag, 边也不行, 对吧?

nebula 中一个点可以有多个tag啊

https://docs.nebula-graph.com.cn/site/pdf/NebulaGraph-book.pdf 5.1.9 & 5.11

1 个赞

一个点插入了多个标签,只能用vid查询了,没法用属性查询(属性有索引),不知道该怎么查啊,现实情况肯定是不知道vid的


你是创建了 player 的索引吗

给player建了索引,也给name属性建了索引的。

您创建 index 之后插入的数据对么?如果不是的话(现有数据后有index),index是需要rebuild才会索引存量数据的哈,rebuild 参考文档。

我的索引都rebuild了,我再发张图,你不觉得很怪异么?properties的值很奇怪。

目前的索引选择机制是会在不同 tag 同 property name ,却是不同 property value 的情况下出现这个问题,请问您的场景下允不允许通过下边两个方法绕过呢?

  • 保证同一个 vertex 在不同 tag 下 同名 property 的 value 相同
  • 通过改 property_name 避开多 tag vertex 同名 property 的情况

这个问题我之前提过 issue: same prop-name in different tags on same vertex with different values · Issue #1255 · vesoft-inc/nebula-graph · GitHub

还有这个问题啊 :thinking:

是呢,四王:sob:




testTag,testTag2,testTag3,是个啥玩意啊

您这个情况最好开一个新的帖子,方便后边的同学搜索到,适当描述一下。

因为之前创建过的 tag,需要新的 stats job 才会触发新增、删除这一行。

(root@nebula) [basketballplayer]> CREATE TAG testTag(name string, age int);
Execution succeeded (time spent 9292/45285 us)

Tue, 03 Aug 2021 09:50:13 CST

(root@nebula) [basketballplayer]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 51    |
+---------+------------+-------+
| "Tag"   | "team"     | 30    |
+---------+------------+-------+
| "Edge"  | "follow"   | 81    |
+---------+------------+-------+
| "Edge"  | "serve"    | 152   |
+---------+------------+-------+
| "Space" | "vertices" | 81    |
+---------+------------+-------+
| "Space" | "edges"    | 233   |
+---------+------------+-------+
Got 6 rows (time spent 2270/46137 us)

Tue, 03 Aug 2021 09:50:19 CST

(root@nebula) [basketballplayer]> SUBMIT JOB STATS;
+------------+
| New Job Id |
+------------+
| 37         |
+------------+
Got 1 rows (time spent 5095/39840 us)

Tue, 03 Aug 2021 09:50:43 CST

(root@nebula) [basketballplayer]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 51    |
+---------+------------+-------+
| "Tag"   | "t2"       | 2     |
+---------+------------+-------+
| "Tag"   | "team"     | 30    |
+---------+------------+-------+
| "Tag"   | "testTag"  | 0     |
+---------+------------+-------+
| "Edge"  | "follow"   | 81    |
+---------+------------+-------+
| "Edge"  | "serve"    | 152   |
+---------+------------+-------+
| "Space" | "vertices" | 83    |
+---------+------------+-------+
| "Space" | "edges"    | 233   |
+---------+------------+-------+
Got 8 rows (time spent 1846/47381 us)

Tue, 03 Aug 2021 09:50:45 CST

(root@nebula) [basketballplayer]> DROP TAG testTag
Execution succeeded (time spent 7333/49418 us)

Tue, 03 Aug 2021 09:51:05 CST

(root@nebula) [basketballplayer]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 51    |
+---------+------------+-------+
| "Tag"   | "t2"       | 2     |
+---------+------------+-------+
| "Tag"   | "team"     | 30    |
+---------+------------+-------+
| "Tag"   | "testTag"  | 0     |
+---------+------------+-------+
| "Edge"  | "follow"   | 81    |
+---------+------------+-------+
| "Edge"  | "serve"    | 152   |
+---------+------------+-------+
| "Space" | "vertices" | 83    |
+---------+------------+-------+
| "Space" | "edges"    | 233   |
+---------+------------+-------+
Got 8 rows (time spent 1905/35170 us)

Tue, 03 Aug 2021 09:51:07 CST

(root@nebula) [basketballplayer]> SUBMIT JOB STATS;
+------------+
| New Job Id |
+------------+
| 38         |
+------------+
Got 1 rows (time spent 5667/39593 us)

Tue, 03 Aug 2021 09:51:38 CST

(root@nebula) [basketballplayer]> show stats
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 51    |
+---------+------------+-------+
| "Tag"   | "t2"       | 2     |
+---------+------------+-------+
| "Tag"   | "team"     | 30    |
+---------+------------+-------+
| "Edge"  | "follow"   | 81    |
+---------+------------+-------+
| "Edge"  | "serve"    | 152   |
+---------+------------+-------+
| "Space" | "vertices" | 83    |
+---------+------------+-------+
| "Space" | "edges"    | 233   |
+---------+------------+-------+
Got 7 rows (time spent 1465/40677 us)

Tue, 03 Aug 2021 09:51:41 CST

此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。

浙ICP备20010487号