繁体   English   中英

Neo4j将csv导入数据库

[英]Neo4j import csv to database

我想将出版物从csv导入neo4j。 并进行查询,以选择所有作者(至少是出版物的作者)。

我有格式为Author,Publication的csv文件

Sanjeev Saxena,Parallel Integer Sorting and Simulation Amongst CRCW Models.
Hans-Ulrich Simon,Pattern Matching in Trees and Nets.
Nathan Goodman,NP-complete Problems Simplified on Tree Schemas.
Oded Shmueli,NP-complete Problems Simplified on Tree Schemas.
Norbert Blum,On the Power of Chain Rules in Context Free Grammars.
Arnold Sch,rpern der Charakteristik 2.
nhage,rpern der Charakteristik 2.
Juha Honkala,A characterization of rational D0L power series.
Chua-Huang Huang,The Derivation of Systolic Implementations of Programs.
Christian Lengauer,The Derivation of Systolic Implementations of Programs.

我用这个查询:

USING PERIODIC COMMIT
LOAD CSV FROM 'file:/home/kanion/studia/bazy/clean.csv' AS line
CREATE (:Publikacja { author: line[1], title: line[2]})

导入后,我有:

http://imgur.com/3lpWM3O

所以我认为作者不是进口的吗? 怎么处理呢?

在大多数(如果不是全部)编程语言中,数组的第一个键为0,因此对于作者,它应该为line [0],对于标题应该为line [1]

USING PERIODIC COMMIT
LOAD CSV FROM 'file:/home/kanion/studia/bazy/clean.csv' AS line
CREATE (:Publikacja { author: line[0], title: line[1]})

暂无
暂无

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

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