gremlin

Re-running an existing route in a Tinkerpop Graph

不羁的心 提交于 2020-04-18 05:47:23
问题 If i have a pre-run route from the shortestPath which is returned as a list of vertex, how can i then re-run that on a graph with the same set of vertices, to return the edges which it has used. i.e. PATH = (V(1), V(2), V(3), V(4), V(5), V(6)), how would the command look to replay that path on a new graph with the same vertices, returning the edges, which contain different properties. So to confirm i need to input this explicit Path to return the edges? 回答1: If I knew my path was [v[1],v[4],v

How to write unit test for these type of methods? [closed]

落花浮王杯 提交于 2020-04-17 21:30:24
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 days ago . I'm new to unit testing . How to write unit test for these type of methods? private boolean fn(Vertex vertex) { return vertex.id().toString().split(":").length > 1; } Here Vertex is the element of gremlin query . I have tried to create instance of graph and pass a new Vertex object

How to write unit test for these type of methods? [closed]

Deadly 提交于 2020-04-17 21:28:35
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 days ago . I'm new to unit testing . How to write unit test for these type of methods? private boolean fn(Vertex vertex) { return vertex.id().toString().split(":").length > 1; } Here Vertex is the element of gremlin query . I have tried to create instance of graph and pass a new Vertex object

How to write unit test for these type of methods? [closed]

走远了吗. 提交于 2020-04-17 21:28:16
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 days ago . I'm new to unit testing . How to write unit test for these type of methods? private boolean fn(Vertex vertex) { return vertex.id().toString().split(":").length > 1; } Here Vertex is the element of gremlin query . I have tried to create instance of graph and pass a new Vertex object

Geolocation search with Gremlin

最后都变了- 提交于 2020-04-14 07:07:06
问题 Is it possible to do a location search in Gremlin? I can't see how it can be done in the documentation. I specifically want to do the location search in Cosmos Gremlin. 回答1: Geo location currently is something that is provided by the back end graph system. For example JanusGraph has a GeoSpatial API that can be used with Gremlin. Of course if you store lat/lon coordinates in your graph you can pretty easily write a Gremlin query to use those to look for things based on coordinates. I have a

CosmosDB creation - API option (SQL vs Graph)

拟墨画扇 提交于 2020-04-10 03:27:08
问题 I'm interested in using the Azure CosmosDB for it's Graph capability. Looking through the docs i saw that it sores graph vertices and edges as JSON documents (with an agreed schema) and so it can be accessed as a plain old DocumentDB. Taking this into consideration what is the meaning of the API selection you need to make when creating a new instance (link)? eg : what am i losing if i create the DB as SQL (DocumentDB) and manipulating data via the graph part of the client (eg

Best way to get (millions of rows of) data into Janusgraph via Tinkerpop, with a specific model

核能气质少年 提交于 2020-03-22 09:20:10
问题 Just started out with Tinkerpop and Janusgraph, and I'm trying to figure this out based on the documentation. I have three datasets, each containing about 20 milions rows (csv files) There is a specific model in which the variables and rows need to be connected, e.g. what are vertices, what are labels, what are edges, etc. After having everything in a graph, I'd like to of course use some basic Gremlin to see how well the model works. But first I need a way to get the data into Janusgraph.

Limit number of items in group().by() in gremlin query

吃可爱长大的小学妹 提交于 2020-03-21 20:28:57
问题 I am trying to run a gremlin query which groups vertices of a certain label into several groups by a certain field (assume it is 'displayName') and limit the number of groups to n and the number of items in each group also to n . Is there a way to achieve that? Since group().by() returns a list of the item, I tried using unfold() and then applying limit on the inner items. I managed to limit the number of groups that are returned, but couldn't limit the number of items in each group. Here's

Limit number of items in group().by() in gremlin query

旧街凉风 提交于 2020-03-21 20:28:47
问题 I am trying to run a gremlin query which groups vertices of a certain label into several groups by a certain field (assume it is 'displayName') and limit the number of groups to n and the number of items in each group also to n . Is there a way to achieve that? Since group().by() returns a list of the item, I tried using unfold() and then applying limit on the inner items. I managed to limit the number of groups that are returned, but couldn't limit the number of items in each group. Here's

Measure serialization and deserialization time

情到浓时终转凉″ 提交于 2020-03-16 08:18:42
问题 In addition to my previous question please, is there a way to measure the time it takes gremlin server to serialize and deserialize a query request from the client? For example, if the client is a java application that sends query request to gremlin server running on a remote server, is there a way to measure the time from the point gremlin server receives the request, deserializes it, before running the query? Many thanks 回答1: No - I can't think of how to do that directly, but when you write