TITAN

How to import a CSV file into Titan graph database?

半腔热情 提交于 2019-12-18 03:44:47
问题 Can anyone supply some sample code or hints on how to import a 1MB CSV of nodes, and another 1MB CSV of edges, into Titan graph database running on Cassandra? I've got small CSV files importing via Gremlin, but this doesn't seem appropriate for large files. I've seen Faunus can do this, but I'd like to avoid spending a couple of days setting it up if possible. It looks like BatchGraph might be the way to go (https://github.com/tinkerpop/blueprints/wiki/Batch-Implementation) but the example

Graph DB: Sort product based on likes

独自空忆成欢 提交于 2019-12-14 04:14:38
问题 I have a product vertex which has incomming like edge. User ------- likes ----------->products In my search result I want to sort the products based on likes. How this can be done ? 回答1: Just use groupCount : gremlin> g = new TinkerGraph() ==>tinkergraph[vertices:0 edges:0] gremlin> user1 = g.addVertex('u1') ==>v[u1] gremlin> user2 = g.addVertex('u2') ==>v[u2] gremlin> product1 = g.addVertex('p1') ==>v[p1] gremlin> product2 = g.addVertex('p2') ==>v[p2] gremlin> product3 = g.addVertex('p3') ==

Unable to print node properties in DSE graph

我只是一个虾纸丫 提交于 2019-12-14 03:29:08
问题 Apologies as this might be very basic question on the topic but I am new to Gremlin/DSE Graph and i tried many ways to extract data i am inserting to my graph but somehow i am unable to make it work. Here is what i have: 1. Graph with allow_scans set to true 2. Schema with propertyKey and vertexes defined and materialized index on NodeID of all Vertexes. There are no relationships right now, just vertexes with data points. I wrote a program to insert all my nodes to DSE Graph which is working

titan rexster with external cassandra instance

£可爱£侵袭症+ 提交于 2019-12-13 21:32:51
问题 I have a cassandra cluster (2.1.0) running fine. After installing titan 5.1, and editing the titan-cassandra.properties to point to cluster hostname list rather than localhost, i run following - titan.sh -c conf/titan-cassandra.properties start It is able to recognize running cassandra instance, starts elastic search, but times out while connecting to rexster. If i run it with local cassandra, everything runs fine using following ->br> titan.sh start do i need to make any change in rexster

Connection of Titan graph DB to Gephi through Gremlin console

跟風遠走 提交于 2019-12-13 21:18:18
问题 I am trying to connect to gephi(0.9.1) through gremlin console. I have a graph in my titan database. I also have the streaming server enabled in my gephi. And through gremlin i executed the following commands: :plugin use tinkerpop.gephi g = TinkerFactory.createModern() :remote connect tinkerpop.gephi All these worked fine.But when i ran the last command: :> g I got the following error: ==>tinkergraph[vertices:6 edges:6] 16:07:16.783 [main] DEBUG groovyx.net.http.HTTPBuilder - POST http:/

set-up our own vertex id in titan using java API

旧时模样 提交于 2019-12-13 04:41:42
问题 I want to set up my own id to vertex like the way mentioned below. BaseConfiguration configuration = new BaseConfiguration(); configuration.setProperty("storage.backend", "hbase"); configuration.setProperty("storage.hostname", "slave05"); configuration.setProperty("storage.port", "2181"); configuration.setProperty("storage.tablename", "REC_GRAPH1"); TitanGraph graph = TitanFactory.open(configuration); Vertex vertex = graph.addVertex(200); graph.commit(); But I'm not able to.. I guess I'm

Gremlin: how can I return vertex and their associated vertex?

故事扮演 提交于 2019-12-13 03:09:50
问题 I Need to return some groups and people in that group, like this: Group A -----Person A -----Person B -----Person C Group B -----Person D -----Person E -----Person F How can I do that with gremlin. They are connected to group with a edge. 回答1: It is always helpful to include a sample graph with your questions on Gremlin preferably as a something easily pasted to the Gremlin Console as follows: g.addV('group').property('name','Group A').as('ga'). addV('group').property('name','Group B').as('gb

Is it possible to index labels in Titan?

穿精又带淫゛_ 提交于 2019-12-13 02:39:40
问题 When I run a query like this: g.V().hasLabel("myDefinedLabel").values("myKey").next() It prints 20:46:30 WARN com.thinkaurelius.titan.graphdb.transaction.StandardTitanTx - Query requires iterating over all vertices [(~label = myDefinedLabel)]. For better performance, use indexes So, I guess to solve this issue, I need to index the label. Is there anyway to do this? I tried doing the normal procedure to create an index described here in Titan docs but the label is not a regular property key to

How to efficiently create a vertex with a label and several properties?

不打扰是莪最后的温柔 提交于 2019-12-13 02:05:26
问题 I want to create a vertex with a given label and some properties. Since the g.addVertexWithLabel() method only takes the label as an argument and I cannot find any v.addLabel() method, it seems that I have to add the properties one by one after creating the vertex. Or am I missing something here? 回答1: No. As of Titan 0.5.4, there is no API that allows you to add it all at once. In fact, even the Gremlin Groovy sugar of: g.addVertex([name:"stephen"]) just calls Element.setProperty(k,v) for

TitanDB - Build a property index in descending order by timestamp

故事扮演 提交于 2019-12-12 20:16:30
问题 TitanDB 1.0.0 (on top of DynamoDB) Gremlin 3 I've got a set of vertices with a label a . I have a property of type long on those vertices which corresponds to the time in milliseconds from 1970 UTC (timestamp of when the vertex was created.) When I pull back those vertices I want to be able to pull them back in decsending order. How can I create an index on that property in the decr order in Titan Management System ? Documentation seems vague on that. Closest thing I found is public