Max
Max
Explore posts from servers
ATApache TinkerPop
Created by Wolfgang Fahl on 10/16/2024 in #questions
pymogwai
Could you elaborate a bit more on the challenges involved in this approach? Are you referring to porting Tinkergraph Java implementation to Python (or another language)? If that’s the case what compatibility checks would be necessary for new implementation to be compliant with the original?
6 replies
ATApache TinkerPop
Created by Max on 9/28/2024 in #questions
Best practices for local development with Neptune.
Could you possibly clarify why the example code for Neptune includes a different gremlin-server.yaml configuration compared to the default gremlin server? I understand that it needs to reference a distinct tinkergraph.properties file (to allow IDs as strings), but are there any additional configuration changes that justify the divergence from the default? Neptune sample code: https://github.com/aws-samples/automated-testing-graph-queries/blob/main/test/db/conf/gremlin-server.yaml Default config: https://github.com/apache/tinkerpop/blob/master/gremlin-server/conf/gremlin-server.yaml
11 replies
ATApache TinkerPop
Created by Max on 10/2/2024 in #questions
Confusing behavior of `select()`.
I have encountered another issue related to numeric types. If keys in a Map end up being of type Double (for example as the result of math()...group() steps), I couldn't find a way to access the map by key. I am using TypeScript/JavaScript GLV, and the incoming traverser produces values that have Long type, but the map keys have Double type. How can I access the map by key, given this situation?
11 replies
ATApache TinkerPop
Created by Max on 10/2/2024 in #questions
Confusing behavior of `select()`.
Making map keys explicit Long values does work for this example. But the actual map in my code is generated dynamically by the group().by("someIntegerProp") step. This means that someIntegerProp has to be created as Long value in the first place, am I correct? I am using JavaScript GLV by the way, and I found toLong function there. I will try it. Thank you!
11 replies
ATApache TinkerPop
Created by Max on 10/2/2024 in #questions
Confusing behavior of `select()`.
Interesting pattern, thank you! This seems like undocumented feature of where() step.
11 replies
ATApache TinkerPop
Created by Max on 9/28/2024 in #questions
Best practices for local development with Neptune.
By the way I figured out that I can start gremlin server container with modified TinkerGraph properties:
gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
gremlin.tinkergraph.vertexIdManager=ANY
gremlin.tinkergraph.edgeIdManager=ANY
gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
gremlin.tinkergraph.vertexIdManager=ANY
gremlin.tinkergraph.edgeIdManager=ANY
This allows to have ids as strings, which solves one of the major pain points.
11 replies
ATApache TinkerPop
Created by Max on 9/28/2024 in #questions
Best practices for local development with Neptune.
Thanks. Does it support Neptune specific apis like g.with('Neptune#enableResultCache', true)?
11 replies
ATApache TinkerPop
Created by red on 9/27/2024 in #questions
Vertex hashmaps
Is the lack of support for subgraph() in JavaScript simply a feature gap in the JavaScript language variant? Or does it require deeper changes or support from the core Gremlin implementation?
7 replies
ATApache TinkerPop
Created by Max on 9/3/2024 in #questions
Gremlin query to order vertices with some locked to specific positions
Thank you! It was useful, I didn't know you could use by modulator for order like this.
18 replies
ATApache TinkerPop
Created by Max on 9/3/2024 in #questions
Gremlin query to order vertices with some locked to specific positions
Here is the sample graph:
g.addV('Category').
property('name', 'Shoes').as('shoes').
addV('Product').
property('name', 'Product1').as('p1').
addE('belongsTo').from('p1').to('shoes').
addV('Product').
property('name', 'Product2').as('p2').
addE('belongsTo').from('p2').to('shoes').
addV('Product').
property('name', 'Product3').as('p3').
addE('belongsTo').from('p3').to('shoes').
addV('Product').
property('name', 'Product4').as('p4').
addE('belongsTo').from('p4').to('shoes').
addV('Product').
property('name', 'Product5').as('p5').
addE('belongsTo').from('p5').to('shoes').
addV('Product').
property('name', 'Product6').as('p6').
addE('belongsTo').from('p6').to('shoes').
addV('Product').
property('name', 'Product7').as('p7').
addE('belongsTo').from('p7').to('shoes').
addV('Product').
property('name', 'Product8').as('p8').
addE('belongsTo').from('p8').to('shoes').
addV('Product').
property('name', 'Product9').as('p9').
addE('belongsTo').from('p9').to('shoes').
property('lockedPosition', 7).
addV('Product').
property('name', 'Product10').as('p10').
addE('belongsTo').from('p10').to('shoes').
property('lockedPosition', 3).
iterate()
g.addV('Category').
property('name', 'Shoes').as('shoes').
addV('Product').
property('name', 'Product1').as('p1').
addE('belongsTo').from('p1').to('shoes').
addV('Product').
property('name', 'Product2').as('p2').
addE('belongsTo').from('p2').to('shoes').
addV('Product').
property('name', 'Product3').as('p3').
addE('belongsTo').from('p3').to('shoes').
addV('Product').
property('name', 'Product4').as('p4').
addE('belongsTo').from('p4').to('shoes').
addV('Product').
property('name', 'Product5').as('p5').
addE('belongsTo').from('p5').to('shoes').
addV('Product').
property('name', 'Product6').as('p6').
addE('belongsTo').from('p6').to('shoes').
addV('Product').
property('name', 'Product7').as('p7').
addE('belongsTo').from('p7').to('shoes').
addV('Product').
property('name', 'Product8').as('p8').
addE('belongsTo').from('p8').to('shoes').
addV('Product').
property('name', 'Product9').as('p9').
addE('belongsTo').from('p9').to('shoes').
property('lockedPosition', 7).
addV('Product').
property('name', 'Product10').as('p10').
addE('belongsTo').from('p10').to('shoes').
property('lockedPosition', 3).
iterate()
Note, the edge Product9 -belongsTo-> shoes has property lockedPosition: 7. The edge Product10 -belongsTo-> shoes has property lockedPosition: 3 . A traversal like g.V().hasLabel("Category").in("belongsTo").values("name") returns products with no specific order. My goal is to create a traversal such that getting products in shoes category would always result in a list, where 3rd and 7th positions would be always occupied by Product10 and Product9 respectively. Alternatively, I am okay with accommodating a different data model for this use case, if it makes for simpler or more efficient traversals.
18 replies