如何切换图形(在 Neo4j 上)?
使用后如何返回 Neo4J 图
g = new TinkerGraph()
我想它类似于
g.loadGraphML(...)
编辑:
您的答案帮助我更好地理解 loadGraphML() 的工作原理,但它没有解决我的问题。
我要重新表述我的问题。我使用 Neo4j 和 Gremlin,当我第一次启动服务器时,我在 Gremlin 控制台下看到以下几行。
==> Available variables:
==> g = neo4jgraph[EmbeddedGraphDatabase [/home/user/software/neo4j-community-1.5.M01/data/graph.db]]
然后我输入
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==> tinkergraph[vertices:6 edges:6]
But how I can back to "g = neo4jgraph[EmbeddedGraphDatabase [/home/user/software/neo4j-community-1.5.M01/data/graph.db]]"
How do I come back on the Neo4J graph after using
g = new TinkerGraph()
I guess it's something like
g.loadGraphML(...)
EDIT:
Your answer helped me to better understand how loadGraphML() works, but it didn't solve my problem.
I'm going to rephrase my question. I use Neo4j and Gremlin, and when I first start the server, I get the following lines under Gremlin console.
==> Available variables:
==> g = neo4jgraph[EmbeddedGraphDatabase [/home/user/software/neo4j-community-1.5.M01/data/graph.db]]
Then I type
gremlin> g = TinkerGraphFactory.createTinkerGraph()
==> tinkergraph[vertices:6 edges:6]
But how can I come back to "g = neo4jgraph[EmbeddedGraphDatabase [/home/user/software/neo4j-community-1.5.M01/data/graph.db]]"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不完全理解你的问题,但我相信你的意思是你已经用 TinkerGraph 做了一些工作,并且你想将这些数据导入 Neo4jGraph 吗?此外,鉴于您正在执行 g.loadGraphML(...),我假设您正在谈论从 Gremlin。如果没有,请使用相应的 GraphMLReader/Writer 类由蓝图提供。
简而言之,您可以将图形从 TinkerGraph 输出到 GraphML,然后通过 loadGraphML() 方法将其加载到 Neo4jGraph 中。您可能会对蓝图中有一个 GraphMigrator 工具感兴趣——请参阅蓝图 JavaDoc 了解更多信息。
I don't fully understand your question, but I believe you mean that you have done some work with TinkerGraph and you want to import that data into Neo4jGraph? Moreover, given that you are doing g.loadGraphML(...), I will assume you are talking about doing this from Gremlin. If not, please use the respective GraphMLReader/Writer classes provided by Blueprints.
In short, you can output your graph to GraphML from TinkerGraph and then load it up into Neo4jGraph via the loadGraphML() method. There is a GraphMigrator tool in Blueprints that you might be interested---see the Blueprints JavaDoc for more information.
在 gremlin 控制台中,您应该只需键入:
g = new Neo4jGraph("/home/path_to_your_neo4j/data/graph.db")
如果这回答了您的问题,请告诉我。
Within the gremlin console, you should be able to just type:
g = new Neo4jGraph("/home/path_to_your_neo4j/data/graph.db")
Let me know if this answers your question.