【问题标题】:Querying titan graph for only indexed vertices without traversing complete graph仅查询索引顶点而不遍历完整图的泰坦图
【发布时间】:2015-03-26 05:00:59
【问题描述】:

我正在尝试仅检索图中的索引顶点

我使用了下面的查询

Iterator<Vertex> vertices = titanTransaction.query().has("name").vertices().iterator();

此查询遍历完整图并获取结果,谁能给我一个更好的方法,名称顶点被索引。

谢谢

【问题讨论】:

    标签: graph bigdata titan gremlin


    【解决方案1】:

    你应该可以使用.has(key,value)方法https://github.com/thinkaurelius/titan/blob/0.5.4/titan-core/src/main/java/com/thinkaurelius/titan/graphdb/query/graph/GraphCentricQueryBuilder.java#L113

    Iterator&lt;Vertex&gt; vertices = titanTransaction.query().has("name","john").vertices().iterator();

    应该做的伎俩。

    【讨论】:

      【解决方案2】:

      你试过了吗:

      graph.V('name','nameOfTargetVertex').next()
      

      根据http://gremlindocs.com/#transform/v,我认为这应该使用属性name 上的索引。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-02-21
        • 1970-01-01
        • 2017-04-10
        • 1970-01-01
        • 1970-01-01
        • 2021-04-27
        • 1970-01-01
        相关资源
        最近更新 更多