[英]Gremlin query output to CSV file
I want to save the output returned by gremlin query to a CSV file with column names as labels of property and rows as values:我想将 gremlin 查询返回的 output 保存到 CSV 文件,其中列名作为属性标签,行作为值:
Query:询问:
g.V().as('v1').outE().as('e').inV().as('v2').select('v1','e','v2').by(valueMap()).limit(1)
Output: Output:
[
{
"v1": {
"label_A": [
"A"
]
},
"e": {
"label_E": "E"
},
"v2": {
"label_B": [
“B"
]
}
}
]
Csv file required:需要 Csv 文件:
label_A,labelB,label_E
A,B,E //row1
.,.,. //row2
etc
While it was written for Amazon Neptune, there's very little about this tool that is specific to Neptune:虽然它是为 Amazon Neptune 编写的,但这个工具几乎没有专门针对 Neptune:
https://github.com/awslabs/amazon-neptune-tools/tree/master/neptune-export https://github.com/awslabs/amazon-neptune-tools/tree/master/neptune-export
See in particular:具体见:
https://github.com/awslabs/amazon-neptune-tools/blob/master/neptune-export/docs/export-pg-from-queries.md https://github.com/awslabs/amazon-neptune-tools/blob/master/neptune-export/docs/export-pg-from-queries.md
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.