https://www.compose.com/articles/importing-graphs-into-janusgraph/ показывает, как вы можете импортировать данные в график janus.
Поскольку я не мог заставить janusgraph docker работать на моем компьютере Mac с использованием localhost, я попытался подключиться к удаленному компьютеру Ubuntu, на котором я запускаю janusgraph с помощью:
docker run -it -p 8182:8182 janusgraph/janusgraph
Затем я хотел использовать gremlin-python для загрузки данных, и это не удалось. Я пробовал следующее, чтобы получить простой повторяемый пример:
server= ...
port=8182
graph = Graph()
janusgraphurl='ws://%s:%s/gremlin' % (server,port)
connection = DriverRemoteConnection(janusgraphurl, 'g')
g = graph.traversal().withRemote(connection)
dataurl="https://github.com/krlawrence/graph/raw/master/sample-data/air-routes.graphml"
g.io(dataurl).read().iterate()
Я получаю следующую ошибку:
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/gremlin_python/driver/protocol.py", line 110, in data_received
raise GremlinServerError(message["status"])
gremlin_python.driver.protocol.GremlinServerError: 500: https://github.com/krlawrence/graph/raw/master/sample-data/air-routes.graphml does not exist
Хотя ссылка https://github.com/krlawrence/graph/raw/master/sample-data/air-routes.graphml, похоже, работает нормально.
Каким будет правильный способ загрузки данных графика с URL-адреса с использованием варианта языка python gremlin?