danielcraig23
danielcraig23
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
I get the same result when I use the absolute path ~/air-routes.graphml
9 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
~ % gremlin

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@1f52eb6f
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(graphml()).readGraph('~/air-routes.graphml')
~/air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> :exit
~ % head ~/air-routes.graphml
<?xml version='1.0' ?>
<!-- ******************************************************************************* -->
<!-- Sample file containing selected air routes between selected airports. -->
<!-- Intended for learning purposes only and not for travel planning! -->
<!-- -->
<!-- Author: Kelvin R. Lawrence. -->
<!-- Graph version : 0.77 , 2017-Oct-06 -->
<!-- -->
<!-- Please send details of errors in the graph or suggestions to: -->
<!-- e-mail: [email protected] , twitter: @gfxman -->
~ % gremlin

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@1f52eb6f
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)
==>tinkergraph[vertices:0 edges:0]
gremlin> graph.io(graphml()).readGraph('~/air-routes.graphml')
~/air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]
gremlin> :exit
~ % head ~/air-routes.graphml
<?xml version='1.0' ?>
<!-- ******************************************************************************* -->
<!-- Sample file containing selected air routes between selected airports. -->
<!-- Intended for learning purposes only and not for travel planning! -->
<!-- -->
<!-- Author: Kelvin R. Lawrence. -->
<!-- Graph version : 0.77 , 2017-Oct-06 -->
<!-- -->
<!-- Please send details of errors in the graph or suggestions to: -->
<!-- e-mail: [email protected] , twitter: @gfxman -->
9 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
I wanted to use the air routes database to write up a question that I need to ask, but I can't seem to follow the instructions found in Practical Gremlin and at https://github.com/krlawrence/graph/blob/master/sample-data/load-air-routes-graph.groovy#L13 to load the air-routes database
9 replies
ATApache TinkerPop
Created by danielcraig23 on 1/21/2025 in #questions
Trying to load air-routes.graphml yields no such file or directory
~ % gremlin

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@1f52eb6f
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)
==>tinkergraph[vertices:0 edges:0]
gremlin>
graph.io(graphml()).readGraph('air-routes.graphml')
air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]
~ % gremlin

\,,,/
(o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> conf = new BaseConfiguration()
==>org.apache.commons.configuration2.BaseConfiguration@1f52eb6f
gremlin> conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
==>null
gremlin> conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
==>null
gremlin> graph = TinkerGraph.open(conf)
==>tinkergraph[vertices:0 edges:0]
gremlin>
graph.io(graphml()).readGraph('air-routes.graphml')
air-routes.graphml (No such file or directory)
Type ':help' or ':h' for help.
Display stack trace? [yN]
9 replies
ATApache TinkerPop
Created by beef_pork_chicken on 12/21/2024 in #questions
TypeScript incomplete declaration of Traverser
I'm able to cast it like this: const castResult : Map<string, string> = result as Map<string, string>
5 replies
ATApache TinkerPop
Created by beef_pork_chicken on 12/21/2024 in #questions
TypeScript incomplete declaration of Traverser
I have the same issue: how do I get() anything from a Traverser?
5 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Ok thank you!!
13 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
for 3.6.2 is this also the case?
13 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
@Valentyn Kahamlyk does gtx....iterate() have a strategy for maintaining the order of these writes?
13 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
Thank you @spmallette !
8 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Is this an acceptable way of making sequential writes? I am using async.retry to retry the promise returned by tx.commit(), similar to this example from Amazon: https://docs.aws.amazon.com/neptune/latest/userguide/lambda-functions-examples.html#lambda-functions-examples-javascript ``` const tx = g.tx(); try { // get the graph traversal source from the transaction const gtx = tx.begin();
gtx.addV("owner").property(id, "1111").iterate() gtx.addV("laptop").property(id, "macbookAir2024").property("yearReleased", 2024).iterate() gtx.V() .hasLabel('laptop') .has(t.id, textP.startingWith(partialMacbookId)) .order() .by('yearReleased', desc) .limit(1) .as("mostRecentMacbook") .mergeE( new Map([ [t.label, 'hasOwner'], [direction.out, merge.outV], [direction.in, merge.inV]] ) ) .option(merge.outV, .select('mostRecentMacbook')) .option(merge.inV, .V(ownerId)) .iterate(); return tx.commit(); } catch (error) { logger.error(error); // roll back the transaction return tx.rollback(); }
13 replies
ATApache TinkerPop
Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
The solution was to allow neptune to use the default mimetype; removing the mimetype header solved the issue
28 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Is the insertion order guaranteed with this example code?
Yes that's certainly true, for reasons of breaking up a series of several long .mergeV() and .mergeE()'s I want to use a transaction so that there's space in between.
13 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
I'm using Tinkerpop 3.6.2, where .concat() and .format() weren't yet added, and I'm using Neptune where lambdas aren't supported
8 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
gremlin> g.addV("owner").property(id, "1111")
gremlin> g.addV("laptop").property(id, "macbookAir2024").property("yearReleased", 2024)
gremlin> g.V().hasLabel('laptop').has(T.id, TextP.startingWith("macbookAir")).order().by('yearReleased', desc).limit(1).as("mostRecentMacbook").mergeE([(T.label): 'hasOwner', (from): Merge.outV, (to): Merge.inV]).option(Merge.outV, __.select('mostRecentMacbook')).option(Merge.inV, __.V('1111')).iterate();
gremlin> g.addV("owner").property(id, "1111")
gremlin> g.addV("laptop").property(id, "macbookAir2024").property("yearReleased", 2024)
gremlin> g.V().hasLabel('laptop').has(T.id, TextP.startingWith("macbookAir")).order().by('yearReleased', desc).limit(1).as("mostRecentMacbook").mergeE([(T.label): 'hasOwner', (from): Merge.outV, (to): Merge.inV]).option(Merge.outV, __.select('mostRecentMacbook')).option(Merge.inV, __.V('1111')).iterate();
8 replies
ATApache TinkerPop
Created by danielcraig23 on 5/9/2024 in #questions
Using mergeE to create an edge with an id that depends on a lookup
Here is the script that I'm testing in gremlin console:
8 replies
ATApache TinkerPop
Created by danielcraig23 on 5/8/2024 in #questions
Is tx.close() necessary in Javascript?
Thanks Valentyn
6 replies
ATApache TinkerPop
Created by danielcraig23 on 5/8/2024 in #questions
Is tx.close() necessary in Javascript?
try {
const gtx = tx.begin();

gtx.mergeV(
new Map([
[t.id, 'exampleId'],
[t.label, 'exampleLabel']
]))
.option(merge.onCreate, new Map([['lastUpdatedTime', eventTimeStamp]]))
.iterate();

tx.commit();
} catch (error) {
logger.error(error);
// roll back the transaction
tx.rollback();
}
try {
const gtx = tx.begin();

gtx.mergeV(
new Map([
[t.id, 'exampleId'],
[t.label, 'exampleLabel']
]))
.option(merge.onCreate, new Map([['lastUpdatedTime', eventTimeStamp]]))
.iterate();

tx.commit();
} catch (error) {
logger.error(error);
// roll back the transaction
tx.rollback();
}
6 replies
ATApache TinkerPop
Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
Thank you!
28 replies
ATApache TinkerPop
Created by danielcraig23 on 4/18/2024 in #questions
.mergeV() with Javascript not working
I provided some more details in an amazon case which I just created, can I send you that case #?
28 replies