2015-08-17 84 views
0

這是我的CSV文件的示例:設置屬性 - Neo4j的

_id,official_name,common_name,country,started_by, 
ABO.00,Association Football Club Bournemouth,Bournemouth,England,"{""day"":NumberInt(1),""month"":NumberInt(1),""year"":NumberInt(1899)}" 
AOK.00,PAE Kerkyra,Kerkyra,Greece,"{""day"":NumberInt(30),""month"":NumberInt(11),""year"":NumberInt(1968)}" 

我有這個CSV導入的Neo4j:

LOAD CSV WITH HEADERS FROM 
'file:///Z:/path/to/file/team.csv' as line 
create (p:Team {_id:line._id, official_name:line.official_name, common_name:line.common_name, country:line.country, started_by_day:line.started_by.day,started_by_month:line.started_by.month,started_by_year:line.started_by.year 

我得到一個錯誤( Neo.ClientError.Statement.InvalidType)設置started_by.day, started_by.month, started_by.year
我如何正確設置有關started_by的屬性?

回答

1

格式的CSV你應該如下:

_id,official_name,common_name,country,started_by_day,started_by_month,started_by_year 
ABO.00,Association Football Club Bournemouth,Bournemouth,England,1,1,1899 

暗號:

LOAD CSV WITH HEADERS FROM 'file:///Z:/path/to/file/team.csv' as line 
CREATE (p:Team {_id:line._id, official_name:line.official_name, common_name:line.common_name, country:line.country, started_by_day:line.started_by_day,started_by_month:line.started_by_month,started_by_year:line.started_by_year}) 
1

它看起來像CSV文件的日期部分是JSON格式 - 不要你需要解析首先?

line.started_by

是這串

"{""day"":NumberInt(30),""month"":NumberInt(11),""year"":NumberInt(1968)}" 

沒有line.started_by.day