Apache TinkerPop

AT

Apache TinkerPop

Apache TinkerPop is an open source graph computing framework and the home of the Gremlin graph query language.

Join

Modify traversal from outside the function that builds the traversal (Java)

Hi peeps, more of an OOP oriented question this time around. I'll start off by explaining what I'm trying to do first. In my app I have a bunch of tables that can have different types of filters applied to them. To make my life easier on the backend I've made an abstract Filter class which is extended by all the different types of filters, and the model mapper knows which subclass I want from a field sent in the request. A good way to apply the filtering to the traversal would be to have a dsl step that takes the list of filters, checks which instanceof each filter is and does it's stuff accordingly. I wanted to know if there would be any way to keep the logic in the filter classes, overriding the method in each subclass. Perhaps something like generating the steps in the filter and adding them to the admin traversal in the dsl, I'm not sure....

How can I write a project using an inject that doesn't exhaust itself?

Take the following example query: g.inject("1", "2", "3").project("list").by(__.inject("b").fold()).toList() its result is [{list=[1, b]}, {list=[2]}, {list=[3]}]...

ReadOnlyStrategy for remote script execution to make a read only server instance

Hi all, I am setting up a read only cluster of gremlin server, I have conifgured the initialization script like this: globals << [g : traversal().withEmbedded(graph).withStrategies(ReferenceElementStrategy)] Now when I'm using g and sending a write request to the gremlin server I'm getting the proper exception and not able to add data....

Pass label to coalesce

When I want to pass a label to a coalesce step I get follwoing error:
"addE(occupied) failed because the from() traversal (which should give a Vertex) failed with: The provided traverser does not map to a value: v[10190][TinkerVertex]->[SelectOneStep(last,u,null)
"addE(occupied) failed because the from() traversal (which should give a Vertex) failed with: The provided traverser does not map to a value: v[10190][TinkerVertex]->[SelectOneStep(last,u,null)
...

Can I use a query to export data in the form of a query?

In the SQL world you can use SQL Developer to generate INSERT statements from the results of a query. I want to sample some of our Neptune data for use in a unit test that uses Tinkergraph - is it possible to capture the results of a query as something like g.addV() queries that allow me to export my real data into Tinkergraph?

Gremlin query to give response for 1 and 2 hops at same time

I have a graph setup with certain type of vertices like: inputFiles, outputFiles, convertors convertors basically take some input files, process them and produce output files. ...

Connect and work with JG

Hi Guys. I'm looking for assistance with connecting to a JanusGraph database using Angular and TypeScript. The JanusGraph database is running on a virtual machine (VM) in Google Cloud, and the Gremlin console can be started using a Docker command. I need guidance on how to integrate the Gremlin console into my Electron Angular project, so that I can create queries and search through the database. Can someone help me with this. Right now im trying to connect to JG locally (testing purposes)...

Add Multiple addV() by one Iterate

Hello guys, I have crazy question which needs some experts to help me. I am using C# to add many nodes (20k) I am adding them to the Aws Neptune. but if I do them one by one it's going to take very long time. therefore I need to have like bulk addV() codes. here is my code but it is not working as I want. - Some concerns here: what is the maximum Iterate() requests? - Can I add the 20k node by one go or I need to devided them in smaller packets? - Is there any better way to Bulk add/update the graph?...
No description

MetricRegistry Documentation

Is there documentation anywhere on the metrics provided by the MetricRegistry and what their meaning is?

How do I enable Dynamic Graphs while using the default Docker image `janusgraph/janusgraph:latest`?

With the following configuration settings and using the default g alias I can work with gremlin/JanusGraph no problem: ``` environment: janusgraph.set-vertex-id: true storage.backend: cql...

Encounter strange behaviors in "match()" step

Hello! Sorry for bothering you once again. When I further investigate the problem I post at https://issues.apache.org/jira/projects/TINKERPOP/issues/TINKERPOP-2961?filter=allopenissues. I found that the result of this query is unstable. ```gremlin...

[parameterized queries] Increased time in query evaluation when gremlin server starts/restarts

Hi folks, High latency observed in query evaluation time whenever janusgraph server restarts/starts & the latency degradation is there for atleast 5 mins. * I'm using parameterized queries for the janusgraph server requests, So I know there will be some increased latency whenever sever starts/restarts but the issue is this degradation does not go away for atleast 5 mins and the latency for evaluation goes from aoound 300ms to 5k ms....

Gremlin Statement for Adding Edges Based on Existence of Other Edges

I'm trying to figure out how to do the following in Gremlin with Kelvin's air-routes data. I want to be able to add direct flights (edge with route label) from airports (vertex with airport label) that currently have routes that are exactly two degrees away but currently don't have a direct connecting route. Is it possible to do this in one statement?

Gremlin Python 3.4.13 - Exception Ignored Message When Existing A Python Main

What Happens This happens in Gremlin Python 3.4.13 1. Open self.connection = DriverRemoteConnection(url, 'g')...

indexOf Vertex with given property in a sorted list

Hi all! I've been trying to create a paginated GET REST api and sometimes I need to enforce a range on the resulting vertices starting from a vertex matching a given ID. Let's say my gremlin query so far returns the following list of vertices, sorted based on some property comparison:...

Expected use of `next()` in Java driver

I was doing some testing recently and noticed that on very large datasets, invoking next() seems to pull everything and not just the first element like I thought it would. I have noticed this used a lot as a way of effectively doing <traversal>.limit(1). Is it expected if you are using next() that you then close() the traversal that you called next() on?...

Direct and indirect Edges

This may also be an "it depends" question, but here I have labels A, B and C where entity C is created by entity B on behalf of entity A. At the creation time of C I know the instance of both B and A The cardinality will be roughly say ten Bs for each A (though the Bs can be used by many As and there are potentially millions of Cs, which belong to only one B ...

Advantage/Disadvantage of In and out edge vs one edge

I realize that the answer to this questions might be "it depends", but if I have a bunch of vertices labeled A and B and they always have an edge between them, is there any advantage either generically or in AWS Neptune to having an edge that is directed from A -> B and a different edge directed B -> A. Or is it just as good to have a single undirected edge (by whihic I mean use the both() step on the edge to ignore direction), and construct the traversal appropriately? In this particular case, I will have relatively few As very many Bs...

MergeV uint32 properties inserted as long

Using a property map with OnCreate in MergeV exhibits different behavior if the property type is uint32 rather than int32. If the property is uint32 then the property is serialized as a long. If the property is int32, then it is serialized as integer. ...