【发布时间】:2023-04-06 21:07:02
【问题描述】:
我有关于 DSE 图的三个问题:
DSE 图形顶点能否表示为键值实体。如果是,关键是什么,价值是什么?
在 DSE 图中是否有顶点的主键/索引的概念?如果是,如何创建?顶点 id 是主键/索引吗?
我们可以有一个复合值作为 DSE 图中顶点的主键/索引吗?
【问题讨论】:
标签: graph datastax gremlin datastax-enterprise-graph
我有关于 DSE 图的三个问题:
DSE 图形顶点能否表示为键值实体。如果是,关键是什么,价值是什么?
在 DSE 图中是否有顶点的主键/索引的概念?如果是,如何创建?顶点 id 是主键/索引吗?
我们可以有一个复合值作为 DSE 图中顶点的主键/索引吗?
【问题讨论】:
标签: graph datastax gremlin datastax-enterprise-graph
我不是专家,但我会尽力提供帮助,直到 DataStax 团队的某些成员发现:
1) 你可以这样做:
Vertex v = ...
Iterator<VertexProperty<VertexProperty>> iter = v.properties();
while (iter.hasNext()){
VertexProperty prop = iter.next();
System.out.println(prop.label()+" "+ prop.value());
}
请记住,这不会返回唯一 id,但会返回其余属性。您可以使用 v.id() 获取顶点 id,它是一个 LinkedHashMap。更多信息:how to query by vertex id in Datastax DSE 5.0 Graph in a concise way?
2) DSE Graph 支持对顶点的属性级别进行索引,它有效地充当主索引。如需更多信息,请点击此处: https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/using/createIndexes.html 和https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/using/indexOverview.html
3) 如果我理解您的要求,DSE Graph 提供了一种使用复合分区键来获得复合的自定义主顶点 id 的方法:https://docs.datastax.com/en/latest-dse/datastax_enterprise/graph/using/createCustVertexId.html
【讨论】: