Neo4J Load CSV -> URI is not hierarchical

前端 未结 10 1944
无人共我
无人共我 2021-02-20 10:39

I try to import CSV in a Neo4j Database and I have a problem.

On my desktop computer (windows 7, java 1.8.0_40-b25), the LOAD CSV works great. But on the server (window

相关标签:
10条回答
  • 2021-02-20 11:20

    Use the path 'file:///F:/Neo4JData/Destination.csv' and add the Destination.csv file to the neo4jDB\import directory.If the import directory is not there create a new directory named as import and add the file.

    0 讨论(0)
  • 2021-02-20 11:27

    As specified above once you try with

    USING PERIODIC COMMIT
    LOAD CSV WITH HEADERS FROM "file:///E:/AdventureWorks/adventureworks-neo4j/data/products.csv" as row
    CREATE (:Product {productName: row.ProductName, productNumber: row.ProductNumber, productId: row.ProductID, modelName: row.ProductModelName, standardCost: row.StandardCost, listPrice: row.ListPrice});
    

    The "URI is not hierarchical" error disappears. Then most probably you will get an error saying that it couldnt load the resource like

    TransientError.Statement.ExternalResourceFailure
    

    In order to solve the same you should find the neo4j.conf file.

    Since i'm using a windows 10 machine and community edition of neo4j i could find the same in the below path.

    C:\Users\{username}\AppData\Roaming\Neo4j Community Edition
    

    Edit the conf file and comment out the line

    dbms.directories.import=import
    

    Doing the above steps enabled me to load the csv file.

    0 讨论(0)
  • 2021-02-20 11:29

    I had the same problem. I solved it by putting /// instead of F:/ or F:///.

    So if your source is

    F:/FolderOne/FolderTwo/file.csv
    

    It becomes

    ///FolderOne/FolderTwo/file.csv
    

    Remember that in order to add the file you must put file: in front of the source. So finally

    file:///FolderOne/FolderTwo/file.csv
    
    0 讨论(0)
  • 2021-02-20 11:32

    Are you using 2.3.0 Community Edition?

    try:

    USING PERIODIC COMMIT 10000 LOAD CSV FROM 'file:///F:\\Neo4JData\\Destination.csv

    0 讨论(0)
提交回复
热议问题