'How to load a XML file in Gremlin

gremlin> graph.io(graphml()).readGraph('airroutes.xml') airroutes.xml (The system cannot find the file specified) Type ':help' or ':h' for help. Display stack trace? [yN] g=graph.traversal()

This is the error I'm getting when I'm trying to load an XML file. What is the correct way?



Solution 1:[1]

Note that, and I need to update this in Practical Gremlin also, that graph.io is deprecated now in favor of g.io. If you are loading locally into an in memory TinkerGraph a simple file system path should be sufficient. If you are loading into a Gremlin Server, the server will need to have access to that file from its file system.

If loading locally, the format will look like this (I used the older graph.io form).

graph.io(graphml()).readGraph('/myfiles/air-routes.graphml')

If you are looking to load the air-routes data into a Gremlin Server, you should be able to follow the steps here.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1