简体   繁体   English

Python Neo4j驱动程序和可视化

[英]Python Neo4j Driver and visualization

I would like to get a JSON output from a Cypher query in 'Graph' format in order to pass based to the browser from my Python app to draw a nice graph. 我想以“图形”格式从Cypher查询中获取JSON输出,以便从Python应用程序传递到浏览器以绘制漂亮的图形。

However using the python driver I can't see a way to do this. 但是,使用python驱动程序我看不到做到这一点的方法。 In the API docs the rest driver has the ability to specify resultDataContents":\\["graph"\\]} 1 but in the python driver there doesn't seem to any way to specify this. 在API docs中,其余驱动程序可以指定resultDataContents":\\["graph"\\]} 1,但在python驱动程序中似乎没有任何指定方法。

Is there a way to get the python driver to directly output the JSON output? 有没有办法让python驱动程序直接输出JSON输出?

You can try to manipulate the neo4j query output using COLLECT clause. 您可以尝试使用COLLECT子句操纵neo4j查询输出。

Eg:MATCH(n:Person) RETURN COLLECT({name: n.name, age: n.age ,etc..}) as output

this query will have a json named output. 此查询将具有一个名为output的json。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM