1.ngql在已知点的vid情况下无法对其拥有的tag里的指定属性进行remove,只能置为null,例如vid:“player100” tag为“player”,我想删除player100的player.name :“Tim Duncan”,无法进行删除;
2.创建Tag标签对于内部属性类型无法使用列表类型;
3.neo4j的查询语句match (n:%s)–>() where not (n)<–() return n,但是ngql不支持where后面跟pattern并且match只支持-- 、 → 、 <–,没有不指向这个说法,这该怎么解决;
因为需要对以有cql进行ngql转换,有大佬晓得嘛?
cql 指的是 Cypher 吗?
嗯 对
- 目前只支持删除实体(cql delete),不支持类似 cql 的 remove 语法
- 目前还不支持属性是列表类型
- 目前还不支持多 pattern
没法转换。
对于标签只能整体delete,不能删除标签内的具体属性是嘛?
是的。原因是 neo4j 是 schema-less 的,而 nebula 设计为 schema-first 系统,因此 nebula 会提供 Schema Definition Language (SDL) 类似 create tag
语句而无法支持类似 remove 的语法。
类似的需求可以通过修改 schema 的方式做整体删除,详见文档: https://docs.nebula-graph.com.cn/2.5.1/3.ngql-guide/10.tag-statements/3.alter-tag/
我的本地测试:
(czp@nebula) [nba]> create tag t1(a int,b bool)
Execution succeeded (time spent 2678/2981 us)
(czp@nebula) [nba]> alter tag t1 add (c float)
Execution succeeded (time spent 2489/2931 us)
(czp@nebula) [nba]> desc tag t1
+-------+---------+-------+---------+---------+
| Field | Type | Null | Default | Comment |
+-------+---------+-------+---------+---------+
| "a" | "int64" | "YES" | | |
+-------+---------+-------+---------+---------+
| "b" | "bool" | "YES" | | |
+-------+---------+-------+---------+---------+
| "c" | "float" | "YES" | | |
+-------+---------+-------+---------+---------+
Got 3 rows (time spent 1581/2093 us)
(czp@nebula) [nba]> alter tag t1 drop (c)
Execution succeeded (time spent 2050/2471 us)
(czp@nebula) [nba]> desc tag t1
+-------+---------+-------+---------+---------+
| Field | Type | Null | Default | Comment |
+-------+---------+-------+---------+---------+
| "a" | "int64" | "YES" | | |
+-------+---------+-------+---------+---------+
| "b" | "bool" | "YES" | | |
+-------+---------+-------+---------+---------+
Got 2 rows (time spent 1708/2204 us)
这确实是个问题,目前 ngql 确实没有这个能力。
alter tag t1 drop (c),这是对这个标签的整体进行属性删除呀,而不能根据vid针对一个点进行属性删除呀
对的呀。 就是因为 nebula 是 schema-first 的,你不能删除某个实体的属性(只能置为 null),否则实体的 schema 就不一致了。如果要删除属性,必须是具有同样 schema 的实体做整体删除
好的 了解 感谢您的解惑
此话题已在最后回复的 30 天后被自动关闭。不再允许新回复。