Skip to content

Commit

Permalink
Remove usage of graph.io from more places #259 #115
Browse files Browse the repository at this point in the history
  • Loading branch information
krlawrence committed Oct 9, 2023
1 parent 25e1f0a commit d8895cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions book/Section-Getting-Started.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ into the console manually. These commands will setup the console environment, cr
a TinkerGraph graph and load the `air-routes.graphml` file into it. Some extra
console features are also enabled.

NOTE: There is a file called `load-air-routes-graph.groovy`, that contains the
NOTE: There is a file called `load-air-routes-graph34.groovy`, that contains the
commands shown below, available in the `/sample-data` directory.
https://github.com/krlawrence/graph/tree/main/sample-data

Expand All @@ -654,9 +654,8 @@ conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG");[]
graph = TinkerGraph.open(conf)
graph.io(graphml()).readGraph('air-routes.graphml')
g=graph.traversal()
g = TinkerGraph.open(conf).traversal()
g.io("/mydata/air-routes.graphml"). with(IO.reader,IO.graphml).read().iterate()
:set max-iteration 1000
----

Expand Down
5 changes: 2 additions & 3 deletions sample-data/load-air-routes-graph-34.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.edgeIdManager","LONG")
conf.setProperty("gremlin.tinkergraph.vertexPropertyIdManager","LONG")
graph = TinkerGraph.open(conf)
g=graph.traversal()
g = TinkerGraph.open(conf).traversal()

// Change the path below to point to wherever you put the graphml file.

// We need to explicitly tell Gremlin which reader to use as it does not recognize the GraphML
// file extension. It does recognize XML as an extension so an alternative would be to rename
// the file.
g.io("/mydata/air-routes.graphml"). with(IO.reader,IO.graphml).read().iterate()
g.io("/mydata/air-routes.graphml"). with(IO.reader,IO.graphml).read()

:set max-iteration 1000
2 changes: 2 additions & 0 deletions sample-data/load-air-routes-graph.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//
// To execute use the console command ":load load-air-routes-graph.groovy"
//
// This file uses the deprecated way of creating a graph and loading data. See
// the file load-air-routes34.groovy to see the currently recommended way.

conf = new BaseConfiguration()
conf.setProperty("gremlin.tinkergraph.vertexIdManager","LONG")
Expand Down

0 comments on commit d8895cf

Please sign in to comment.