gremlin

Random Walk on Bipartite Graph with Gremlin

£可爱£侵袭症+ 提交于 2019-12-04 13:30:35
I would like to rank items according to a given users preference (items liked by the user) based on a random walk on a directed bipartite graph using gremlin in groovy. The graph has the following basic structure: [User1] ---'likes'---> [ItemA] <---'likes'--- [User2] ---'likes'---> [ItemB] Hereafter the query that I came up with: def runRankQuery(def userVertex) { def m = [:] def c = 0 while (c < 1000) { userVertex .out('likes') // get all liked items of current or similar user .shuffle[0] // select randomly one liked item .groupCount(m) // update counts for selected item .in('likes') // get

How to get id and all properties from a vertex in gremlin?

ε祈祈猫儿з 提交于 2019-12-04 12:22:11
I am using AWS Neptune with gremlin and I want to get the id of a vertex with all properties of the vertex in one query. How can I do this? I have tried g.V().hasLabel('file').valueMap(true) but the output is: { "fileSize": [ "9170" ], "Gremlin.Net.Process.Traversal.T": "f1fce58306f85ca7050503160640d735c9919c8fc85881d65de80bfe31b5ca24", "mimeType": [ "text/html" ] } No label and no id is there. The problem with project('id','label',' fileSize', 'mimeType', 'malwareSource'). by(id). by(label). by('fileSize'). by('mimeType'). by('malwareSource') is that the propertie malwareSource is sometimes

Gremlin remote command fails with timeout error: Host did not respond in a timely fashion

时光总嘲笑我的痴心妄想 提交于 2019-12-04 10:48:30
I connected to a remote gremlin server via gremlin groovy shell. Connection succeeded. But for any remote command I try to execute it gives timeout error. Even for command :> 1+1 gremlin> :remote connect tinkerpop.server conf/senthil.yaml ==>Connected - 10.40.40.65/10.40.40.65:50080 gremlin> :> 1+1 Host did not respond in a timely fashion - check the server status and submit again. Display stack trace? [yN] org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: Host did not respond in a timely fashion - check the server status and submit again. at org.apache.tinkerpop.gremlin.console

IllegalStateException : Gremlin Server must be configured to use the JanusGraphManager

流过昼夜 提交于 2019-12-04 05:53:30
问题 Set<String> graphNames = JanusGraphFactory.getGraphNames(); for(String name:graphNames) { System.out.println(name); } The above snippet produces the following exception java.lang.IllegalStateException: Gremlin Server must be configured to use the JanusGraphManager. at com.google.common.base.Preconditions.checkState(Preconditions.java:173) at org.janusgraph.core.JanusGraphFactory.getGraphNames(JanusGraphFactory.java:175) at com.JanusTest.controllers.JanusController.getPersonDetail

Unable to create a composite index, stuck at INSTALLED

那年仲夏 提交于 2019-12-03 16:56:00
问题 I'm unable to create an index. My Gremlin code is as follows: usernameProperty = mgmt.getPropertyKey('username') usernameIndex = mgmt.buildIndex('byUsernameUnique', Vertex.class).addKey(usernameProperty).unique().buildCompositeIndex() mgmt.setConsistency(usernameIndex, ConsistencyModifier.LOCK) mgmt.commit() Shortly after I receive two errors: 18:04:57 ERROR com.thinkaurelius.titan.graphdb.database.management.ManagementLogger - Evicted [1@0a00009d2537-ip-10-0-0-1572] from cache but waiting

Gremlin - Giraph - GraphX ? On TitanDb

让人想犯罪 __ 提交于 2019-12-03 14:40:43
I need some help to be confirm my choice... and to learn if you can give me some information. My storage database is TitanDb with Cassandra. I have a very large graph. My goal is to use Mllib on the graph latter. My first idea : use Titan with GraphX but I did not found anything or in development in progress... TinkerPop is not ready yet. So I have a look to Giraph. TinkerPop, Titan can communique with Rexster from TinkerPop. My question is : What are the benefit to use Giraph ? Gremlin seems to do the same think and is distributed. Thank you very much to explain me. I think I don't really

How Gremlin query same sql like for search feature

喜你入骨 提交于 2019-12-03 13:52:35
Im using OrientDB type graph. I need syntax of Gremlin for search same SQL LIKE operator LIKE 'search%' or LIKE '%search%' I've check with has and filter (in http://gremlindocs.com/ ). However it's must determine exact value is passed with type property. I think this is incorrect with logic of search. Thanks for anything. Daniel Kuppitz Try: g.V().filter({ it.getProperty("foo").startsWith("search") }) or g.V().filter({ it.getProperty("foo").contains("search") }) You can use filter with a bit of regex: gremlin> g = TinkerGraphFactory.createTinkerGraph() ==>tinkergraph[vertices:6 edges:6]

Getting vertices that are connected to ALL current vertices

左心房为你撑大大i 提交于 2019-12-02 23:07:55
问题 I might be asking an obvious question, but new to the graphs and gremlin language and got a bit stuck. I have a graph setup where I can find N vertices of a particular type. Let's say I find 2 vertices of type X. These vertices have edges to K vertices of type Y. I want to find vertices of type Y that all have connection to the 3 vertices I found of the type X. In this situation, the vertices of type Y could be connected to either of the 3 vertices of type X, but I want to get only common

How to fire match query in gremlin . Filter query not working in cosmos db with java driver

老子叫甜甜 提交于 2019-12-02 20:40:06
问题 I have 2 problem statements with similar approach .Can I put a contains or like query in both to solve my problem in gremlin: 1) Returning vertex 'a' in the following query when the outE() (as depicted in below gremlin query) has label with contains print. g.V().hasLabel('url').has('name','sw10707').as('a').outE('print').has('forward','states').inV().select('a') 2) Returning all the vertices as stated below which contains print in their edge labels: g.V().hasLabel('url').has('name','sw10707')

Recursively query simpler tree-like structures with Gremlin

夙愿已清 提交于 2019-12-02 17:49:09
问题 Consider the following data: g.addV('RootTopic').property('name', 'A').as('A') .addV('RootTopic').property('name', 'M').as('M') .addV('Topic').property('name', 'A1').as('A1') .addV('Topic').property('name', 'A2').as('A2') .addV('Topic').property('name', 'B1').as('B1') .addV('Topic').property('name', 'B2').as('B2') .addV('Topic').property('name', 'N1').as('N1') .addV('Topic').property('name', 'N2').as('N2') .addV('Topic').property('name', 'O1').as('O1') .addE('refines').from('A').to('A1')