输入错误:预期'--nodes'至少具有1个有效项目,但具有0 []

时间:2019-01-25 22:06:08

标签: csv import neo4j path filepath

我在这里已经阅读了很多有关此问题的文章,但是我似乎仍然无法解决这个问题。我一直在尝试对已有的一些大型基因组数据CSV使用Neo4j导入,但似乎无法识别这些文件。我的命令行输入如下:

user@LenovoPC ~/.config/Neo4j Desktop/Application/neo4jDatabases/database-2f182948-e170-45b1-b9f4-19d236ff5d43/installation-3.5.1 $ \
bin/neo4j-import --into data/databases/graph.db --id-type string \
--nodes:Allele variants.csv --nodes:Chromosome chromosome.csv --nodes:Phenotype phenotypes.csv \
--nodes:Sample samples.csv --relationships:BELONGS_TO variant_chromosomes.csv \
--relationships: sample_phenotypes.csv --relationships:ALTERNATIVE_TO variant_variants.csv \
--relationships:HAS sample_variants50-99.csv.gz

但是我遇到以下错误:

WARNING: neo4j-import is deprecated and support for it will be removed in a future version of Neo4j; please use neo4j-admin import instead.
Input error: Expected '--nodes' to have at least 1 valid item, but had 0 []

Caused by:Expected '--nodes' to have at least 1 valid item, but had 0 []
java.lang.IllegalArgumentException: Expected '--nodes' to have at least 1 valid item, but had 0 []
    at org.neo4j.kernel.impl.util.Validators.lambda$atLeast$6(Validators.java:144)
    at org.neo4j.helpers.Args.validated(Args.java:670)
    at org.neo4j.helpers.Args.interpretOptionsWithMetadata(Args.java:637)
    at org.neo4j.tooling.ImportTool.extractInputFiles(ImportTool.java:623)
    at org.neo4j.tooling.ImportTool.main(ImportTool.java:445)
    at org.neo4j.tooling.ImportTool.main(ImportTool.java:380)

我使用的是Neo4j Desktop,因此包含了文件路径,不确定是否具有其他文件结构?我的csv文件存储在import文件夹中(但以防万一,我还在当前文件夹和graph.db文件夹中有副本)。

导入目录如下:

user@LenovoPC ~/.config/Neo4j Desktop/Application/neo4jDatabases/database-2f182948-e170-45b1-b9f4-19d236ff5d43/installation-3.5.1/import $ dir
chromosomes.csv        samples.csv          variants.csv
phenotypes.csv         sample_variants50-99.csv.gz  variants.csv.gz
sample_phenotypes.csv  variant_chromosomes.csv      
variant_variants.csv

我只能假定这是我的文件路径,但是我尝试了很多替代方法,但是一点都不走运。如果有人可以阐明问题的根源,我将不胜感激!

1 个答案:

答案 0 :(得分:0)

最好将CD放入桌面目录,将csv文件放入导入文件夹。

然后您可以做:

cd ~/.config/Neo4j Desktop/Application/neo4jDatabases/database-2f182948-e170-45b1-b9f4-19d236ff5d43/installation-3.5.1

bin/neo4j-import --into data/databases/graph.db --id-type string \
--nodes:Allele import/variants.csv \
--nodes:Chromosome import/chromosome.csv \
--nodes:Phenotype import/phenotypes.csv \
--nodes:Sample import/samples.csv \
--relationships:BELONGS_TO import/variant_chromosomes.csv \
--relationships import/sample_phenotypes.csv \
--relationships:ALTERNATIVE_TO import/variant_variants.csv \
--relationships:HAS import/sample_variants50-99.csv.gz

更多注意事项:

  • HAS是一种非常通用的关系类型
  • 我在这里省略了冒号:--relationships import/sample_phenotypes.csv不确定文件中是否具有rel类型
  • 这是一个文件吗? --relationships:HAS import/sample_variants50-99.csv.gz