gremlin

Drop all edges on AWS Neptune using pythongremlin

▼魔方 西西 提交于 2019-12-11 06:35:18
问题 I'm using gremlinpython version 3.3.2 and AWS NEPTUNE. I try to drop all the edges (tried the vertices too) and it fails everytime. g.E().drop().iterate() Gives me: gremlin_python.driver.protocol.GremlinServerError: 597: Exception processing a script on request [RequestMessage{, requestId=ae49cbb7-e034-4e56-ac76-b62310f753c2, op='bytecode', processor='traversal', args={gremlin=[[], [V(), drop()]], aliases={g=g}}}]. Did anyone already successfuly remove all vertices/edges of a graph in AWS

How to return all newest nodes from neo4j?

北慕城南 提交于 2019-12-11 06:25:41
问题 Is it possible to query neo4j for the newest nodes? In this case, the indexed property "timestamp" records time in milliseconds on every node. All of the cypher examples I have lfound concern graph-type queries- "start at node n and follow relationships. What is the general best approach for returning resultsets sorted on one field? Is this even possible in a graph database such as node4j? 回答1: In the embedded Java API it is possible to add sorting using Lucene constructs. http://docs.neo4j

Connecting to cassandra with titan

帅比萌擦擦* 提交于 2019-12-11 06:25:02
问题 I am new to titan. I want to use titan with cassandra database. But when I start the gremlin server and try to load a graph using command - graph = TitanFactory.open("conf/titan-cassandra.properties") it gives me the following error - Could not instantiate implementation: com.thinkaurelius.titan.diskstorage.es.ElasticSearchIndex I dont want to use elastic search. Can anyone help. 回答1: You are probably trying to connect to an existing graph that was previously configured to use Elasticsearch.

Printing/Fetching Vertex values from a path

浪子不回头ぞ 提交于 2019-12-11 06:06:00
问题 Just getting started with gremlin. Printing out all the Vertex values worked out fine gremlin> g.V().values() ==>testing 2 ==>Cash Processing ==>Sales ==>Marketing ==>Accounting I was able to find all the directly connected path between my Vertices. gremlin> g.V().hasLabel('Process') .repeat(both().simplePath()) .until(hasLabel('Process')) .dedup().path() ==>[v[25],v[28]] ==>[v[25],v[26]] ==>[v[26],v[27]] ==>[v[26],v[25]] Now am trying to print out the values in the path like ['Sales',

Programmatically add global variables to gremlin server

强颜欢笑 提交于 2019-12-11 06:01:19
问题 How do I add global variables to an embedded Gremlin server instance? Also, I want to avoid loading the server configuration from a file, although I can load resources from the classpath. 回答1: getGlobalBindings() on GremlinExecutor is indeed deprecated, but the javadoc explains how you should proceed: replaced by getScriptEngineManager() to add global scoped bindings directly to that object. That comes from the 3.2.5 javadoc when it was originally deprecated in preparation for pretty large

After Gremlin 3.2.5-SNAPSHOT I can't pass an array of vertex labels in function hasLabel()

狂风中的少年 提交于 2019-12-11 05:47:34
问题 It used to be that both those statements would work in Java: GraphTraversalSource g =...; String[] labels = new String[]{"label1","label2","label3"}; g.V().hasLabel(labels); g.V().hasLabel("label1", "label2", "label3"); After upgrading to 3.2.5-SNAPSHOT only the later one is supported and I am getting "Cannot resolve method hasLabel(java.lang.String[])" . Apparently hasLabel(String label, String... otherLabels) collides with hasLabel(P<String> predicate) . Is there a work around for that so I

How to access the vertices of a path in Gremlin through Java?

那年仲夏 提交于 2019-12-11 05:01:47
问题 I'm using Java to access Gremlin. I have the following lines of code for creating a path between two vertices in an already created graph: //begin simple path finding Vertex fromNode = g.V().has("name", "i2").next(); Vertex toNode = g.V().has("name", "state1").next(); ArrayList list = new ArrayList(); g.V(fromNode).repeat(both().simplePath()).until(is(toNode)).limit(1).path().fill(list); However, at this point I"m stuck. I can print out the list using list.toString() and I get the vertices

AWS Lambda + Tinkerpop/Gremlin + TitanDB on EC2 + AWS DynamoDB in cloud

≯℡__Kan透↙ 提交于 2019-12-11 04:45:34
问题 I am trying to execute following flow: user hits AWS Gateway (REST), it triggers AWS Lambda, that uses Tinkerpop/Gremlin connects to TitanDB on EC2, that uses AWS DynamoDB in cloud (not on EC2) as backend. Right now I have managed to crete fully working TitanDB instance on EC2, that stores data in DynamoDB in cloud. I am also able to connect from AWS Lambda to EC2 through Tinkerpop/Gremlin BUT only this way: Cluster.build() .addContactPoint("10.x.x.x") // ip of EC2 .create() .connect()

Titan+Cassandra and String Vertex Ids

霸气de小男生 提交于 2019-12-11 04:11:13
问题 It looks like we can get Titan 1.0 use custom long ids by setting "graph.set-vertex-id" to true. Is there some way to use non-long (i.e. String) ids as Vertex Ids? Seeing that the Tinkerpop api supports Strings, and there's a feature called "StringIds", is there some way of enabling that feature? I'm using Titan with Cassandra. 回答1: I think this goes against Titan's internal structure. One of the Titan devs recommends here to just use your own indexed property. This is reiterated here and

Upgrading gremlin breaks connection

会有一股神秘感。 提交于 2019-12-11 04:10:07
问题 With gremlin javascript version 3.2.10 the following function connects to my Neptune cluster correctly: export const initGremlinClient = () => { try { const dc = new DriverRemoteConnection( `ws://${process.env.NEPTUNE_ENDPOINT_URI}:${ process.env.NEPTUNE_ENDPOINT_PORT }/gremlin` ); const graph = new Graph(); return { g: graph.traversal().withRemote(dc), closeGremlinConnection: () => dc.close() }; } catch (error) { console.log("[GREMLIN INIT ERROR]", error); throw new Error(error); } }; If I