2013-08-28 3 views

答えて

4

青写真getIndexedKeys(Vertex.class)の方法を使用することができますが、TitanタイプのシステムのほうがcreateKeyIndexよりもはるかに多くなります。 getIndexedKeysで返される型は十分ではないかもしれない、その場合には

https://github.com/thinkaurelius/titan/wiki/Type-Definition-Overview

:長いあなたはより多くのあなたがタイプメーカーのシステムについて学ぶことになるでしょうタイタンで動作します。

gremlin> g = GraphOfTheGodsFactory.create('/tmp/titan') 
13/08/28 16:28:23 INFO diskstorage.Backend: Configuring index [search] based on: 
... 
13/08/28 16:28:25 INFO cluster.metadata: [Astaroth/Asteroth] [titan] update_mapping [vertex] (dynamic) 
==>titangraph[local:/tmp/titan] 
gremlin> import static com.thinkaurelius.titan.graphdb.types.system.SystemKey.* 
==>import com.tinkerpop.gremlin.* 
==>import com.tinkerpop.gremlin.java.* 
==>import com.tinkerpop.gremlin.pipes.* 
==>import com.tinkerpop.gremlin.pipes.filter.* 
==>import com.tinkerpop.gremlin.pipes.sideeffect.* 
==>import com.tinkerpop.gremlin.pipes.transform.* 
... 
==>import static com.thinkaurelius.titan.graphdb.types.system.SystemKey.* 
gremlin> import com.thinkaurelius.titan.graphdb.types.* 
==>import com.tinkerpop.gremlin.* 
==>import com.tinkerpop.gremlin.java.* 
==>import com.tinkerpop.gremlin.pipes.* 
==>import com.tinkerpop.gremlin.pipes.filter.* 
==>import com.tinkerpop.gremlin.pipes.sideeffect.* 
==>import com.tinkerpop.gremlin.pipes.transform.* 
... 
==>import com.thinkaurelius.titan.graphdb.types.* 
gremlin> g.newTransaction().getVertices(TypeClass, TitanTypeClass.KEY).collect{[it.name,it.dataType]} 
==>[reason, class java.lang.String] 
==>[name, class java.lang.String] 
==>[type, class java.lang.String] 
==>[time, class java.lang.Integer] 
==>[place, class com.thinkaurelius.titan.core.attribute.Geoshape] 
==>[age, class java.lang.Integer] 

あなたは(種類が頂点として格納されているとして)getVerticesにその呼び出しから返されTitanKeyの詳細については、タイタンのAPIを見たいかもしれません:ここではいくつかのグレムリンはあなたの詳細を取得します

http://thinkaurelius.github.io/titan/javadoc/0.3.2/com/thinkaurelius/titan/core/TitanKey.html

+0

これはすばらしいです、感謝@ stephen-mallette。タイタンの他のタイプについてはあなたが正しいです:私はすでにより高度なインデックスと検索のためにTitanとElasticSearchの統合を検討しています。 – bcm360

5

、あなたは青写真KeyIndexableGraphgetIndexedKeys機能を使用することができます

gremlin> g.getIndexedKeys(Vertex.class) 
==>my_key_1 
==>my_key_2 
==>my_key_3 

my_key_1my_key_2、およびmy_key_3を3頂点キーをインデックス化している)

上のキーのインデックスをつかむために、上記のVertex.classの代わりにEdge.classを使用してください。

関連する問題