是否可以选择以逗号分隔值格式导出 Neo4J-Shell 密码查询的结果,即代替
echo "START n=node(*) MATCH n-[r]->m RETURN n.value, type(r), m.value ORDER BY n.value, type(r), m.value;" | neo4j-shell -v -path neo4j-database/ > /tmp/output.csv
less /tmp/output.csv
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| n.value | type(r) | m.value |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa" | "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" | "http://www.w3.org/2002/07/owl#Class" |
| "http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa" | "http://www.w3.org/2000/01/rdf-schema#label" | "Rosa" |
| "http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa" | "http://www.w3.org/2000/01/rdf-schema#subClassOf" | "http://www.co-ode.org/ontologies/pizza/pizza.owl#NamedPizza" |
...
我想得到以下输出
less /tmp/output.csv
"http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa", "http://www.w3.org/1999/02/22-rdf-syntax-ns#type", "http://www.w3.org/2002/07/owl#Class"
"http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa", "http://www.w3.org/2000/01/rdf-schema#label", "Rosa"
"http://www.co-ode.org/ontologies/pizza/pizza.owl#Rosa", "http://www.w3.org/2000/01/rdf-schema#subClassOf", "http://www.co-ode.org/ontologies/pizza/pizza.owl#NamedPizza"
...
就像在 MySQL 中一样,当来自 shell 的 echo 命令使用客户端时,ascii 表被省略。