0

Tinkerpop Frames wiki によると、特定の人が「知っている」すべての人を取得するために、頂点に以下の注釈を付けることができます。しかし、特定の人物に関連するすべての人をどのように見つけたらよいでしょうか? これは可能ですか?

 @Adjacency(label="knows")
 public Iterable<Person> getKnowsPeople();

ありがとう!

4

1 に答える 1

1

基礎となるフレームワークを変更しないとできません。AdjacencyAnnotationHandler.processVertexメソッドでは、Frames がターゲット ブループリント頂点の getVertices() メソッドを呼び出すだけであることがわかります。

if (ClassUtilities.isGetMethod(method)) {
   final FramedVertexIterable r = new FramedVertexIterable(framedGraph, 

   vertex.getVertices(
      adjacency.direction(), adjacency.label()), 
      ClassUtilities.getGenericClass(method));


    if (ClassUtilities.returnsIterable(method)) {
      return r;
    } else {
      return r.iterator().hasNext() ? r.iterator().next() : null;
    }
} 

要求した機能が必要な場合は、このステートメントを変更してすべての頂点を返すか、何らかの規則 (ラベルの値を表すアスタリスクなど) を使用して式ベースのバインディングを実行します。

https://github.com/tinkerpop/frames/blob/master/src/main/java/com/tinkerpop/frames/annotations/AdjacencyAnnotationHandler.java

于 2012-12-14T03:38:12.627 に答える