我有一个Edgelabel

ContainsAttribute 其中 Multiplicity.SIMPLE

这些边也有一个属性让我们称之为 x ,我想要以顶点为中心的索引 .

PropertyKey propertyX = mgmt.getPropertyKey("x");
EdgeLabel containsAttributeLabel = mgmt.makeEdgeLabel(EdgeLabels.ContainsAttribute).multiplicity(Multiplicity.SIMPLE).make();
mgmt.buildEdgeIndex(containsAttributeLabel,"propXIndex",Direction.IN, propertyX);

所以边缘代表 Entity --containsAttribute --> Attribute . 我试图进行的查询将尝试通过过滤属性 x 来搜索给定查询的实体 .

我想知道为什么它不允许我说:

The relation type [ContainsAttribute] has a multiplicity or cardinality constraint in direction [IN] and can therefore not be indexed

我认为我的用例是有道理的,我不想放宽我的边缘标签多样性从 SIMPLEMANY2ONEONE2MANYMULTI ,以使其工作 .

Edit: 根据示例http://s3.thinkaurelius.com/docs/titan/1.0.0/indexes.html赫拉克勒斯与很多怪物作战,因此发现标记为'battled'的边缘多次与不同的怪物连接 . 然后边缘索引在属性'time'上,因此可以进行过滤 . 我想做类似的事情,我认为以顶点为中心的索引是这样的 . 那些边是Multiplicity.SIMPLE,因为在Hercules和每个怪物之间最多有一条标记为'battled'的边 .

Edit 2:

再次类似于给定的示例SIMPLE图:

enter image description here

我相信为Hercules和外出的SIMPLE 'battled'边缘设置一个顶点中心索引是有意义的 . 当从赫拉克勒斯到怪物时,这会使得像 time >=20 这样的查询更快 .

我不明白为什么我们必须有一个像下面这样的MULTI图(不太严格)来利用以顶点为中心的索引 .

enter image description here

任何帮助,将不胜感激!谢谢!