【问题标题】:Getting an error when I run a V().has() gremlin query against IBM Graph service on bluemix在 bluemix 上针对 IBM Graph 服务运行 V().has() gremlin 查询时出错
【发布时间】:2016-04-28 04:46:06
【问题描述】:

我在 bluemix 上创建了一个 IBM Graph 服务实例并创建了一些顶点。当我尝试发出 gremlin 查询以查找我创建的其中一个顶点时,我收到“内部错误”。

这是我正在使用的查询

创建顶点
curl -u 用户名-密码 -H 'Content-Type: application/json' -d '{ "label":"movie","properties":{"Name": "Million Dollar Baby","Type": "Movie "} }' -X POST "http://../g/vertices"

回复
{"requestId":"07f29cea-25b3-4305-b74b-540466206872","status":{"message":"","code":200,"attributes":{}},"result":{"data ":[{"id":8336,"label":"movie","type":"vertex","properties":{"Type":[{"id" :"36a-6fk-1l1","value":"Movie"}],"Name":[{"id":"2s2-6fk-sl","value":"百万美元宝贝" }]}}],"meta":{}}}

查询顶点是否有Type属性'movie'
curl -u 用户名-密码 -H 'Content-Type: application/json' -d '{"gremlin": "def g = graph.traversal(); gV().has('Type','movie')" }' -X POST "http://../g/gremlin"

响应(错误)
{"code":"InternalError","message":""}

【问题讨论】:

    标签: ibm-cloud graph-databases gremlin tinkerpop3 ibm-graph


    【解决方案1】:

    IBM Graph 要求用户为他们要针对其发出查询的任何属性创建索引。在这种情况下,“类型”是一个属性,包含在 gremlin 查询中。

    您需要使用 Bluemix 中的 IBM Graph 服务提供的 /schema 端点创建索引。

    服务入门指南中提供了一个示例 http://ibm-graph-docs.ng.bluemix.net/gettingstarted.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-22
      相关资源
      最近更新 更多