gremlin

How to import a CSV file into Titan graph database?

跟風遠走 提交于 2019-11-29 02:36:42
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 appears to be incomplete. My question was answered at https://groups.google.com/forum/#!topic

CosmosDB Graph : “upsert” query pattern

对着背影说爱祢 提交于 2019-11-29 00:27:12
I am new to Gremlin query language. I have to insert data on a Cosmos DB graph (using Gremlin.Net package), whether the Vertex (or Edge) already exists in the graph or not. If the data exists, I only need to update the properties. I wanted to use this kind of pattern: g.V().hasLabel('event').has('id','1').tryNext().orElseGet {g.addV('event').has('id','1')} But it is not supported by Gremlin.Net / Cosmos DB graph API. Is there a way to make a kind of upsert query in a single query ? Thanks in advance. There are a number of ways to do this but I think that the TinkerPop community has generally

Gremlin remove all Vertex

冷暖自知 提交于 2019-11-28 21:14:40
I know how to remove a vertex by id, but I need to delete multiple vertices (clean the db). Deleting 1 v is like this: ver = g.v(1) g.removeVertex(ver) Peter Neubauer you can try g.V.each{g.removeVertex(it)} g.commit() In more recent terms as of Gremlin 2.3.0, removal of all vertices would be best accomplished with: g.V.remove() UPDATE: For version Gremlin 3.x you would use drop() : gremlin> graph = TinkerFactory.createModern() ==>tinkergraph[vertices:6 edges:6] gremlin> g = graph.traversal() ==>graphtraversalsource[tinkergraph[vertices:6 edges:6], standard] gremlin> g.V().drop().iterate()

Graph/Gremlin for social media use case

自作多情 提交于 2019-11-28 14:24:22
Consider instagram feed scenario. I want to get all the posts 'posted' by the people I follow. For each of these posts I want to know whether I have liked it or not and also know which of the other people I follow have liked it (if any). What is the best solution to get this in gremlin (possibly avoiding duplication)? Image for clarity The following just gives the posts 'posted' by USER 2. How to get other information in the same query? g.V().has('ID','USER 2').out('posted') When you ask questions about Gremlin, especially one of this complexity, it is always best to include a Gremlin script

How to perform pagination in Gremlin

为君一笑 提交于 2019-11-28 11:03:06
In Tinkerpop 3, how to perform pagination? I want to fetch the first 10 elements of a query, then the next 10 without having to load them all in memory. For example, the query below returns 1000,000 records. I want to fetch them 10 by 10 without loading all the 1000,000 at once. g.V().has("key", value).limit(10) Edit A solution that works through HttpChannelizer on Gremlin Server would be ideal. From a functional perspective, a nice looking bit of Gremlin for paging would be: gremlin> g.V().hasLabel('person').fold().as('persons','count'). select('persons','count'). by(range(local, 0, 2)). by

JanusGraph : Please add a key named “ConfigurationManagementGraph” to the “graphs”

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 08:56:22
问题 I get the this error in gremlin console cegprakash@cegprakash:~/workspace/janusgraph-0.2.1-hadoop2$ ./bin/gremlin.sh \,,,/ (o o) -----oOOo-(3)-oOOo----- plugin activated: janusgraph.imports plugin activated: tinkerpop.server plugin activated: tinkerpop.utilities SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/home/cegprakash/workspace/janusgraph-0.2.1-hadoop2/lib/slf4j-log4j12-1.7.12.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in

Store Gremlin graph in local DynamoDB

走远了吗. 提交于 2019-11-28 08:50:17
问题 Instead of using AWS, I am using its local available DynamoDB database and creating a graph in the Gremlin console. My PC is using Gremlin-version=3.0.1.incubating and Titan-version=1.0.0 My question: How to save a graph in my local DynamoDB so that I can retrieve it back whenever I wish? (E.g. after computer restart). I have tried a lot, using save() or commit() graph. But I always got an error: g.commit() No signature of method: org.apache.tinkerpop.gremlin.process.traversal.dsl.graph

Titan Db ignoring index

喜欢而已 提交于 2019-11-28 04:33:52
问题 I have a graph with a couple of indices. They're two composite indices with label restraints. (both are exactly the same just on different properties/labels). One definitely seems to work but the other doesn't. I've done the following profile() to doubled check: One is called KeyOnNode : property uid and label node : gremlin> g.V().hasLabel("node").has("uid", "xxxxxxxx").profile().cap(...) ==>Traversal Metrics Step Count Traversers Time (ms) % Dur =============================================

gremlin clone a node and its edges

时光总嘲笑我的痴心妄想 提交于 2019-11-28 02:19:20
问题 Does gremlin provide the ability to clone a vertex for instance v1->v2, v1->v3, v1->v4 how can I simply and efficiently create a new vertex v5 that also has edges that point to v2, v3, v4 (the same places that v1's edges point to) without have to explicitly set them and instead saying something like g.createV(v1).clone(v2) . Note that I am using the AWS Neptune version of gremlin, solution must be compatible with that. 回答1: A clone step doesn't exist (yet), but it can be solved with a single

GremlinPipeLine java API chain traversal in Titan graph use cases

﹥>﹥吖頭↗ 提交于 2019-11-28 01:35:57
问题 I have use case where in I have to traverse a chain of vertices starting from a particular vertex. Its a linear chain (like a train) with only one vertex connected to the previous.While traversing I have to emit certain vertices based on some criteria until I reach the end of the chain. The second use case is the extension of the above use case but instead of a single chain starting from a single vertex, there are multiple such chains , again starting from a single vertex. I have to traverse