Neo4j-csv文件導(dǎo)入

一、導(dǎo)入csv數(shù)據(jù)

1、導(dǎo)入但不存庫(kù)

導(dǎo)入本地

load csv from 'file:///E:movies.csv' as line return line

導(dǎo)入網(wǎng)站連接

load csv from 'http://*' as line return line

如果把csv文件放入Neo4j系統(tǒng)路徑的import文件夾內(nèi),則無(wú)需指定csv文件路徑,如下:

load csv form 'file:///moves.csv' as line return line

2、導(dǎo)入并存庫(kù)

1、普通導(dǎo)入

load csv from 'file:///moveis.csv' as line create (:Movie {title:line[0], released:line[1], tagline:line[2]})

2、導(dǎo)入附帶表頭:

load csv from 'file:///moveis.csv' as line create (:Track {TrackId:line.id, Name:line.Track, Length:line.Length})

3、導(dǎo)入csv大文件:

using periodic commit load csv with headers from 'file:///moveis.csv' as line create (:Track {TrackId:line.id, Name:line.Track, length:line.Length})

3.1、可以每800行提交一次

using periodic commit 800 load csv with headers from 'file:///moveis.csv' as line create (:Track {TrackId:line.id, Name:line.Track, length:line.Length})

4、使用neo4j-import工具導(dǎo)入Neo4j

在Neo4j系統(tǒng)下目錄path/to/neo4j/bin/neo4j-import 下的可執(zhí)行文件

    bin/neo4j-import --into 數(shù)據(jù)庫(kù)名 --id-type string\ 
    
        --nodes: Customer customer.csv --nodes product.csv\
    
        --nodes:order_header.csv, orders1.csv, orders2.csv\
    
        --relationships:contains order_details.csv\
    
        --relationships:ordered
    customer_order_header.csv, orders1, orders2.csv
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容