TITAN

Matching elasticsearch data indexed by Titan

落爺英雄遲暮 提交于 2019-12-12 06:12:22
问题 I have indexed titan data in elasticsearch, it worked fine and indexed but when i see the data in elasticsearch using REST API. the column/property name looks different than from Titan. For example i have indexed age while inserting data to Titan final PropertyKey age = mgmt.makePropertyKey("age").dataType(Integer.class).make(); mgmt.buildIndex("vertices",Vertex.class).addKey(age).buildMixedIndex(INDEX_NAME); and if i see same in elasticsearch { "_index" : "titan", "_type" : "vertices", "_id"

Load Titan graph with Gremlin

混江龙づ霸主 提交于 2019-12-12 03:59:23
问题 Im toataly new with TitanDB. Im using it with cassandra & Java: Configuration file: storage.backend=cassandra storage.hostname=@CASSANDRA_CLUSTER_INNER_ADDRESS@ Java code: TitanGraph tg = TitanFactory.open(/*the configuration above*/); if (tg.isOpen()) { TitanManagement tm = tg.getManagementSystem(); PropertyKey key = tm.getPropertyKey(name); /* The rest of the nice working code */ } The Java code works fine, I can query the graph, do CRUD operations etc... Now, I want to query the graph

GraphFactory message: GraphFactory could not instantiate this Graph implementation [com.thinkaurelius.titan.core.TitanFactory]

╄→гoц情女王★ 提交于 2019-12-12 03:48:45
问题 I'm trying to make graph queries via a gremlin-shell to a Cassandra backend (locally or remotely). I downloaded a stock Gremlin Server distribution and then installed Titan (as described here in the manual-installation). http://s3.thinkaurelius.com/docs/titan/0.9.0-M1/server.html I added all the property settings and classpath : ~/gremlin-server-3.0.0.M6$ cat conf/titan-cassandra.properties gremlin.graph=com.thinkaurelius.titan.core.TitanFactory storage.backend=cassandrathrift storage

Gremlin drop() isn't working via java api

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:52:53
问题 I'm using titan db 1.0.0 backed by a local dynamodb instance (which uses the 3.0 tinkerpop stack). I've spent more time than I'd like to admit trying to figure out why drop() wasn't working. In my use case I'm trying to remove a specific edge found via a traversal, but even graph.traversal().V().drop() wasn't working. I did much googling, but perhaps not with the right keywords. I finally figured out the issue which I'll specify in my answer. Hopefully others find this useful. 回答1: I finally

How to use GremlinPipeLine sideEffect in java

二次信任 提交于 2019-12-12 01:53:58
问题 I would like to know how to implement the following gremlin query g.V.has("mgrNo",T.neq,"0").sideEffect{g.V.has("empNo",it.mgrNo).next().addEdge("manages",it)} in java using GremlinPipeLine . I getting confused while implementing from the .next() onwards. GremlinPipeline pipe = new GremlinPipeline(graph).V().has("mgrNo",T.neq,0).sideEffect(new PipeFunction<Vertex, Object>(){ @Override public Object compute(Vertex vertex) { @SuppressWarnings("rawtypes") GremlinPipeline pipeline =

Add vertices to TitanDB Graph in Java

浪子不回头ぞ 提交于 2019-12-11 18:08:52
问题 The examples from the tutorials or the online documentations often use the Gremlin/Groovy shell to demonstrate the TitanDB APIs. I'm working in plain (old, but not so old) Java-8, and the first thing I need to implement is an efficient method to add vertices and edges to a graph. So, to getOrCreate a vertex with a String identifier, I did this: private Vertex getOrCreate(TitanGraph g, String vertexId) { Iterator<Vertex> vertices = g.vertices(); if (!vertices.hasNext()) { // empty graph?

Using SparkGraphComputer to traverse a titan cluster throws an error

六眼飞鱼酱① 提交于 2019-12-11 14:28:16
问题 I have a cluster set up with tinkerpop-3.1.1, titan-1.1.0-SNAPSHOT, spark-1.5.2 and hadoop-2.7.1 and run this script to reproduce an error: graph = GraphFactory.open("hadoop-gryo.properties") graph.traversal().V().count() graph.traversal(computer(SparkGraphComputer)).V().next() graph = GraphFactory.open("titan-cassandra-test-spark.properties") graph.traversal().V().count() graph.traversal(computer(SparkGraphComputer)).V().next() The last call produces this error: You must set the initial

Connecting Titan To Solr

断了今生、忘了曾经 提交于 2019-12-11 11:59:37
问题 I am trying to connect titan to solr. The properties file I am using is titan-cassandra-solr.properties : index.search.backend=solr index.search.solr.mode=cloud index.search.solr.zookeeper-url=localhost:2181 I have configured my titan core to be: name: titan instance: /opt/solr-titan/titan data: /opt/solr-titan/data inside /opt/solr-titan/titan I have a conf directory which contains all the files I copied from titandb/conf/solr . When I use gremlin.sh and try: gremlin> graph = TitanFactory

filter vertices on number of outgoing edges in gremlin titan in java

╄→гoц情女王★ 提交于 2019-12-11 10:48:22
问题 I want to query and filter all vertices with more than 500 outgoing edges in titan using gremlin in java...how do i do this?I have started off as below pipe=pipe.start(graph.getVertices()); 回答1: You then need a filter function p.start( g.getVertices() .filter(new PipeFunction<Vertex,Boolean>() { public Boolean compute(Vertex v) { // write your logic here to count edges on the vertex and // return true if over 500 and false otherwise })); Using GremlinPipeline in Java is described more here 来源

How to use TitanFactory.open()?

二次信任 提交于 2019-12-11 10:43:19
问题 I'm new to Titan and now I'm trying to connect to database. There is a server and in this server there is a titan graph. I found some documentation: https://github.com/tinkerpop/blueprints/wiki/Batch-Implementation How to import a CSV file into Titan graph database? And I'm trying to use the following code: TitanGraph titanGraph = TitanFactory.open("I don't know what to write here"); BatchGraph bg = new BatchGraph(titanGraph, VertexIDType.STRING, 1000); In this code block I'm not sure how to