0

我在按属性查找顶点时遇到问题。

在他引用的文档中:

这将返回所有具有“name”属性的顶点,其值为“James”:g.vertices.index.lookup vertices = (name = "James")。

我创建了一个名为 Product 的模型:

from bulbs.titan import Graph as Rexter
from bulbs.model import Node, NodeProxy, Relationship, build_data
from bulbs.property import String, Integer, DateTime
from bulbs.utils import current_datetime

# Nodes
class Product(Node):  
    element_type = "product"

    name = String(nullable=False)
    pid = Integer(nullable=False, indexed=True)
    view_count = Integer(default=0, nullable=False)
    created = DateTime(default=current_datetime, nullable=False)

并添加一些信息。

当我运行g.vertices.index.lookup(pid =318)返回如下:

GET url: http://localhost:8182/graphs/graph/vertices?value=318&key=pid
GET body: None

如果我在 Gremlin 中运行g.V('pid', 318).map()它会返回:

== > { created = 1437049813 , name = Gladiator (2000 ) , pid = 3578 ,   ELEMENT_TYPE = product, view_count = 0}

为什么我不能通过 Bulbs 获得顶点?

谢谢!

4

1 回答 1

0

这个问题在其他领域已经讨论过了,所以为了完整起见,我会在这里回答......

此问题与灯泡未明确向 URL 添加类型提示有关。从 Rexster 的角度来看,以下内容应该有效:

curl " http://localhost:8182/graphs/graph/vertices?value=(i,318)&key=pid "

本期进一步讨论:

https://github.com/espeed/bulbs/issues/156

于 2015-07-20T10:36:02.517 回答