csv 通过neo4j-admin导入在Neo4J中嵌入矢量失败,属性类型未知“LIST< FLOAT>”

czq61nw1  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(167)

我有一个CSV头文件和数据文件,我想使用neo4j-admin database沿着其他文件一起导入Neo4J。
这是我的文件
HEADER

id:ID,:LABEL,amount:double,measureUnit:string,gramWeight:double,embedding:LIST<FLOAT>

字符串
DATA

FFP_0_321358,FoodPortion_3_0_0,2,"tablespoon",33.9,[0.1671835333108902,-0.7092851996421814,0.14913123846054077,0.7785872220993042,-0.312934011220932,0.08211034536361694,-0.028107712045311928,-0.25594303011894226,0.5699977278709412,0.6135631799697876,0.19823063910007477,0.09847097098827362,-0.6676387190818787,0.004426721017807722,-0.5394071340560913,0.9914360046386719,0.37802284955978394,0.2705143392086029,-0.06354071199893951,-0.3283253610134125,-0.12500542402267456,0.5226773023605347,-0.5599125623703003,-0.17582887411117554,0.33407628536224365,0.8492608666419983,1.6623034477233887,1.037268877029419,0.22571976482868195,0.5713614821434021,0.004049248062074184,-0.3291890323162079,-0.2762421667575836,0.2313031107187271,-0.1946457028388977,-0.17294952273368835,-0.08332429081201553,0.3433372676372528,0.5293984413146973,1.145921230316162,-0.6517155170440674,0.8047919273376465,0.012163370847702026,0.3513254225254059,-0.04551488906145096,0.2955775856971741,-0.023389466106891632,0.06517010182142258,-0.1647074818611145,-0.0821857675909996,0.23624971508979797,-0.7499469518661499,0.3026871979236603,-0.996300995349884,0.4166252911090851,0.338083416223526,1.4630589485168457,0.3421212434768677,-0.740848183631897,0.10450270026922226,-0.5746254920959473,0.9487141370773315,-0.6349362134933472,0.6473907232284546,0.737545907497406,0.631997287273407,-0.585864782333374,-1.2288835048675537,-0.4180561304092407,-0.2542168200016022,0.2972530126571655,0.14671950042247772,-0.22330710291862488,-0.602167546749115,0.29623106122016907,0.7523813247680664,-0.7711286544799805,-0.46698877215385437,-0.6049727201461792,0.5525864362716675,0.3214971125125885,-0.0008972518844529986,0.024934018030762672,0.09121513366699219,-0.99419105052948,0.01268870010972023,-0.25948208570480347,0.0844053328037262,-0.198614239692688,-0.03724987059831619,-0.6223516464233398,0.616694450378418,-0.7710570693016052,0.1813107579946518,0.2166164517402649,-0.2937754690647125,0.03168824687600136,-0.09738413244485855,-0.9887257814407349,-0.2576909363269806,-0.003925889730453491,0.039951808750629425,-0.1942584365606308,0.01654890924692154,0.027941200882196426,0.060958266258239746,0.31667277216911316,-0.5193405747413635,-0.5178394317626953,0.2285129725933075,-0.3170968294143677,-0.2246341109275818,0.2833319902420044,-0.5099343657493591,-0.49715498089790344,-0.3493226170539856,0.3292626142501831,0.24636048078536987,0.7207037210464478,0.16913318634033203,-0.6909018754959106,0.06924944370985031,0.4800015687942505,-0.2168654501438141,0.5917078852653503,0.23160593211650848,0.537395715713501,0.7937036752700806,0.17396502196788788,-0.3983372151851654,0.8670725226402283,-0.21596691012382507,0.7286391854286194,0.338647723197937,-0.541279137134552,-0.24414321780204773,0.7341932058334351,0.4927745461463928,-0.7745022177696228,0.8004167079925537,-0.6826944947242737,0.13118436932563782,-0.19548332691192627,0.07437360286712646,-0.5719180703163147,0.24923273921012878,-0.5927393436431885,0.8679149150848389,0.5983684062957764,-0.027823010459542274,0.7718298435211182,-0.4654153287410736,-1.3462893962860107,0.7995166182518005,-0.011185641400516033,-0.4824565351009369,0.5111072063446045,-0.44001948833465576,-0.3706497848033905,-0.5190173983573914,0.32828569412231445,-0.08511803299188614,-0.2909694015979767,0.6947621703147888,-0.48054996132850647,0.9403616786003113,0.9104567766189575,-0.3861950635910034,0.12150025367736816,-1.0906805992126465,-0.4025906026363373,0.9348596930503845,-1.0202574729919434,0.20373153686523438,-0.523996114730835,0.053802911192178726,0.24222053587436676,0.3762281537055969,-0.5176705121994019,-0.20220249891281128,0.03934430330991745,0.09392368793487549,0.7321622967720032,-0.14787785708904266,0.09097499400377274,-1.0559947490692139,0.48921504616737366,0.05759872868657112,0.8594281077384949,0.7001445293426514,-0.5685751438140869,-1.088683009147644,-0.6474522948265076,0.7292926907539368,0.09484611451625824,-0.13430261611938477,0.5815054774284363,-0.12725986540317535,-0.2390153408050537,-0.5564658641815186,0.03633316978812218,-0.13943913578987122,0.8008201122283936,-0.03932861611247063,-0.592444121837616,-0.28947505354881287,-1.3887320756912231,-0.2919691503047943,0.10906774550676346,-0.16127485036849976,0.4028816521167755,0.18391253054141998,-0.4581294655799866,0.7862441539764404,-0.8642418384552002,-0.8036615252494812,-0.20525407791137695,0.0392296127974987,0.9526417255401611,0.42765557765960693,0.33285951614379883,-0.5506075620651245,-0.6694586873054504,0.07510815560817719,-0.038032107055187225,-0.03092881664633751,-0.04241414740681648,0.1725407838821411,-0.5417670607566833,-0.5349268317222595,-0.5855259299278259,0.5592337250709534,0.4357283115386963,-0.47289806604385376,0.4332028329372406,-0.8731499910354614,0.6391263604164124,-0.5809072256088257,0.13061028718948364,0.1224871352314949,-0.35391929745674133,0.005123510956764221,-0.035462722182273865,-0.3733997642993927,-0.28362974524497986,-0.5538771152496338,0.3602936565876007,-0.6868255138397217,-0.03687463328242302,-0.02161470241844654,-0.01347095426172018,0.33665063977241516,0.17859768867492676,-0.11408817768096924,0.9829856157302856,0.2166203111410141,-0.8720398545265198,0.5416585206985474,0.4413844347000122,-0.45122820138931274,0.6702153086662292,-0.8764693140983582,-0.2828983664512634,-0.3100939989089966,-0.12255239486694336,-1.0492029190063477,-0.8187520503997803,0.24328432977199554,-0.6477587223052979,-0.5662667155265808,0.5299931168556213,-0.16486720740795135,-0.5515258312225342,-0.4993116557598114,0.20804063975811005,0.5959509611129761,-0.5303364992141724,0.33830690383911133,0.6449111104011536,0.15322712063789368,-0.5701629519462585,-0.8095422387123108,0.299686998128891,-0.15813173353672028,-0.42938998341560364,0.01225562859326601,0.2296690195798874,-0.003090759040787816,-0.4748457670211792,-0.6214565634727478,-0.34394094347953796,0.25212395191192627,0.6680505275726318,-0.4346116781234741,0.05700011923909187,-0.5419701337814331,-0.06856900453567505,0.22415021061897278,0.39412787556648254,0.15209266543388367,-0.12497655302286148,-0.14452865719795227,0.10466565191745758,-0.885491669178009,0.16965919733047485,0.3295234143733978,0.5647721886634827,0.6704097390174866,0.3424019515514374,-0.03930060938000679,-0.09012854844331741,-0.4867702126502991,-0.19723494350910187,-0.3999251127243042,-0.12402091920375824,-0.3148922622203827,-0.03522349148988724,0.08981114625930786,-0.5273032784461975,-0.2906345725059509,-0.008796274662017822,0.10828336328268051,-0.5253278017044067,0.32934826612472534,0.1370808184146881,0.40024134516716003,0.15117497742176056,-0.39427340030670166,0.28206363320350647,0.03590822592377663,-0.5984677076339722,-0.7090610861778259,-0.9651968479156494,0.2385367751121521,-0.6296990513801575,0.4865530729293823,-0.3372344374656677,-0.4074413478374481,0.40377700328826904,0.2570020258426666,0.4174588918685913,0.8144797086715698,0.36606156826019287,0.3249886631965637,-0.3144724667072296,-0.13040763139724731,0.11302396655082703,-0.5673134326934814,-0.302737295627594,0.07992523908615112,0.8787054419517517,1.172546148300171,0.4492942988872528,-0.030851297080516815,0.2505459785461426,0.41262075304985046,-0.49564653635025024,0.8719723224639893,0.07523376494646072,-1.1572521924972534,-0.01636483334004879,-0.26380544900894165,-1.4837547540664673,0.5048713088035583,-0.08823634684085846,0.07521479576826096,-0.49488142132759094,0.26249536871910095,-0.6110193729400635,-0.2207442820072174,-0.6484773755073547,1.0147236585617065,-0.44640663266181946,-0.5317413806915283,-0.14681464433670044,-1.1751823425292969,0.23739926517009735,0.7769442796707153,0.5977027416229248,-0.09468377381563187,-0.1947668194770813,0.8031347990036011,-0.27485743165016174,0.3829503059387207,0.008609862998127937,-0.12533974647521973,-0.14479875564575195,0.09938973188400269,0.32281163334846497,0.9557879567146301,0.44236403703689575,-0.3139778673648834,-0.6251403093338013,-0.9560933709144592,-0.026251723989844322,1.0045522451400757,-0.37324783205986023,-1.1330887079238892,-0.7285730242729187,-0.8578240871429443,0.283489465713501,0.3208872675895691,-0.19238921999931335,0.018476346507668495,-0.5433160066604614,0.7849560379981995,0.6621338725090027,-0.04260914772748947,0.5969443321228027,0.44642236828804016,-0.26311758160591125,-0.9876590371131897,0.3932715058326721,-0.15448811650276184,0.13365773856639862,-0.0799962505698204,0.7488629817962646,-0.6475675106048584,-0.009853999130427837,-0.7468257546424866,0.47061026096343994,-0.3518182933330536,-0.18345221877098083,-0.5140756368637085,0.1674567610025406,-0.9340670704841614,-0.025641120970249176,-0.34011444449424744,-0.8153799176216125,-0.26087984442710876,0.3495074212551117,-0.07597187161445618,0.6782748699188232,-0.12641578912734985,1.2685917615890503,-0.8028026819229126,0.5285968780517578,0.5295302271842957,0.3867567479610443,-0.1515539586544037,-1.0572096109390259,-0.49948495626449585,-0.39823028445243835,-0.8323652744293213,-0.9415347576141357,0.6449390053749084,-0.14691118896007538,0.04789162799715996,1.2827277183532715,-0.09551580995321274,0.603675901889801,0.09274474531412125,1.0837756395339966,0.4858129918575287,-0.9330762028694153,0.09257236123085022,-0.6846525073051453,0.6818339824676514,0.4644860029220581,0.8943250179290771,-0.5759118795394897,-0.05204038321971893,-1.039456844329834,-0.7968854308128357,0.25239646434783936,0.4111694395542145,0.0011898776283487678,0.04329173266887665,-0.7683977484703064,0.09674887359142303,0.5332443118095398,-0.8648918271064758,-0.4710420072078705,0.2660006582736969,0.22469790279865265,0.5526612401008606,-0.2161717712879181,-0.48416608572006226,-0.924457848072052,0.5668873190879822,0.4644615948200226,0.016160206869244576,-0.16353924572467804,-0.13962322473526,-0.3175646960735321,0.4352322518825531,0.6779831051826477,0.9168933033943176,-0.7922529578208923,0.5794135332107544,-0.05354280769824982,-0.3465318977832794,0.06871140003204346,-0.2459251582622528,-0.05720151960849762,0.32953858375549316,-0.44721513986587524,0.050602808594703674,0.8087331056594849,-0.5344159603118896,0.305500328540802,-0.18340158462524414,-0.19031253457069397,-0.309244304895401,-0.2884880304336548,0.11887530237436295,0.18470722436904907,0.199752539396286,-0.06084237992763519,0.24666717648506165,-0.26213422417640686,0.49224817752838135,0.48226016759872437,-0.5415734052658081,-0.3253564238548279,1.3615599870681763,0.5222530364990234,-0.32182902097702026,0.46122345328330994,0.24173259735107422,-0.0673547014594078,0.5831491351127625,1.2432188987731934,0.49218353629112244,-0.5042010545730591,0.7092238664627075,0.06750074774026871,-0.09383261948823929,-0.0081543093547225,0.44860950112342834,-0.1970268189907074,-0.28806084394454956,0.6269216537475586,-0.803895890712738,-0.22598743438720703,0.5601255893707275,-0.3778359591960907,0.2135166972875595,-0.7522717118263245,-0.779211163520813,0.1779584139585495,-0.11637934297323227,-0.5567536354064941,0.4780929386615753,0.07993963360786438,1.180921196937561,-1.0012739896774292,1.0854748487472534,1.2030161619186401,-0.39551323652267456,-0.3470480144023895,-0.5964025259017944,-0.003305548569187522,-0.5828757882118225,0.6706764698028564,-0.07850617915391922,0.16851960122585297,-0.20571738481521606,-0.268282413482666,-0.7996156215667725,0.33568376302719116,-0.12711429595947266,-0.25941455364227295,-0.015434486791491508,0.42356789112091064,-0.13292774558067322,0.0037969565019011497,-0.18581432104110718,0.9464324116706848,0.8409354090690613,0.4372020363807678,-0.6313837170600891,-0.055603086948394775,0.09673861414194107,0.3239489793777466,-0.06169762834906578,-0.7502389550209045,0.7076743245124817,-0.45781442523002625,-0.16617447137832642,0.38411039113998413,1.180161476135254,0.21009182929992676,0.11365732550621033,0.5472085475921631,1.1442530155181885,0.2281898409128189,0.2820669710636139,0.9721088409423828,0.5765435099601746,0.4725164771080017,0.8732017874717712,-0.15962526202201843,-0.06697147339582443,0.9765822291374207,-0.6608487963676453,0.43563368916511536,0.46180063486099243,0.11050009727478027,0.5212056636810303,0.6355578899383545,-0.280332088470459,0.11997316777706146,-0.800595760345459,-0.287690669298172,0.43648675084114075,0.026447953656315804,-0.4591667354106903,-0.9742065072059631,-0.11056825518608093,0.07913459837436676,0.3082919120788574,0.22297149896621704,0.4662155508995056,0.24451857805252075,-0.3344615399837494,0.6512241363525391,0.04811880365014076,-0.011844181455671787,-0.10874098539352417,-0.20612436532974243,-0.27597931027412415,0.6450008749961853,0.038915444165468216,-0.8701965808868408,0.19781824946403503,-0.5256267189979553,-0.1740768998861313,-0.16985800862312317,0.12679293751716614,-0.4636904299259186,-0.16456031799316406,-0.21601201593875885,0.27244970202445984,0.41580191254615784,0.47157996892929077,-1.0791044235229492,0.27602824568748474,-0.12321404367685318,-0.1431848406791687,-0.016102466732263565,-0.11164054274559021,0.3355039954185486,0.7526078820228577,0.3873237371444702,0.43889203667640686,0.020581483840942383,0.0665377601981163,0.7098839282989502,-1.2233948707580566,-0.8678389191627502,-0.30513134598731995,0.3215208649635315,-0.3935432434082031,-0.5412213206291199,1.115997314453125,0.9920573830604553,0.914484977722168,-0.9107837677001953,0.017293615266680717,-0.2077222615480423,0.2669888138771057,0.22706453502178192,0.649146318435669,-0.4583829343318939,-0.22682905197143555,0.2800329625606537,-1.0090821981430054,-0.362485408782959,0.4176114797592163,0.1970158964395523,-0.38053134083747864,0.5054555535316467,0.6325038075447083,-0.4901634752750397,0.21487581729888916,0.31514257192611694,0.20230068266391754,-0.10582146048545837,0.22879809141159058,0.8290401101112366,-0.5272077918052673,-0.1003471314907074,-0.4193391501903534,-0.3952881693840027,-0.5583227872848511,-0.6888096332550049,-0.0452975295484066,-0.13799642026424408,-0.62837815284729,-0.4729372262954712,-0.14849378168582916,1.0821017026901245,0.9769520163536072,-1.0336458683013916,-0.852587878704071,0.9743750691413879,0.370536208152771,-0.6756088137626648,-0.23825114965438843,-0.1673172116279602,-0.07628379762172699,-0.5976764559745789,0.7753019332885742,0.6446144580841064,0.5124966502189636,0.31413015723228455,-0.00003639691567514092,-0.8735217452049255,0.5028191208839417,0.49051231145858765,0.2277340292930603,-0.6177209615707397,-0.30641138553619385,-0.605127215385437,-0.2127356231212616,0.28962069749832153,0.7604162096977234,-0.3130319118499756,-0.11445695906877518,0.4159240424633026,0.6234878301620483,0.2780379056930542,0.5945948958396912,0.37354910373687744,-1.0610800981521606,0.521527111530304,0.31822124123573303,0.33180931210517883,-0.10160930454730988,-0.513020396232605,0.570996105670929,0.47622430324554443,-0.8863240480422974,-0.44037914276123047,-0.3269352912902832,-1.8785266876220703,-0.6457673907279968,0.8876060247421265,-0.08890876173973083,-1.0130339860916138,-0.2681725323200226,-0.025494800880551338,0.30071747303009033,-0.7092866897583008,0.8538867831230164,-0.08444361388683319,0.1759151965379715,-0.0645117536187172,-0.6093289852142334,0.3150272071361542,0.6975864768028259,-0.7012813687324524,-0.22271794080734253,0.649813711643219,0.5986615419387817,-0.08681211620569229,0.04726758971810341,-0.36053359508514404,0.36199748516082764,-0.09300746023654938,-0.1462542563676834,-0.13827596604824066,-0.6411302089691162,0.06707187741994858,0.31476008892059326,0.3629421889781952,-1.0855286121368408]


这就是我的命令

neo4j-admin database import full --nodes=datasets/bulk/t/ff_sr_fndds_food_portions_header.csv,datasets/bulk/t/ff_sr_fndds_food_portions.csv --relationships=datasets/bulk/t/ff_sr_fndds_food_portions_relations_header.csv,datasets/bulk/t/ff_sr_fndds_food_portions_relations.csv


它失败,并出现以下错误

org.neo4j.internal.batchimport.input.HeaderException: Unable to parse header, unknown property type 'LIST<FLOAT>'
    at org.neo4j.internal.batchimport.input.csv.DataFactories.parsePropertyType(DataFactories.java:483)
    at org.neo4j.internal.batchimport.input.csv.DataFactories$AbstractDefaultFileHeaderParser.propertyExtractor(DataFactories.java:280)
    at org.neo4j.internal.batchimport.input.csv.DataFactories$DefaultNodeFileHeaderParser.create(DataFactories.java:410)
    at org.neo4j.internal.batchimport.input.csv.DataFactories.parseHeaderEntries(DataFactories.java:196)
    at org.neo4j.internal.batchimport.input.csv.DataFactories$AbstractDefaultFileHeaderParser.create(DataFactories.java:221)
    at org.neo4j.internal.batchimport.input.csv.CsvInput.verifyHeaders(CsvInput.java:164)
    at org.neo4j.internal.batchimport.input.csv.CsvInput.<init>(CsvInput.java:145)
    at org.neo4j.internal.batchimport.input.csv.CsvInput.<init>(CsvInput.java:108)
    at org.neo4j.importer.CsvImporter.doImport(CsvImporter.java:175)
    at org.neo4j.importer.ImportCommand$Base.doExecute(ImportCommand.java:431)
    at org.neo4j.importer.ImportCommand$Full.execute(ImportCommand.java:590)
    at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:92)
    at org.neo4j.cli.AbstractCommand.call(AbstractCommand.java:37)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
    at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
    at picocli.CommandLine.execute(CommandLine.java:2170)
    at org.neo4j.cli.AdminTool.execute(AdminTool.java:94)
    at org.neo4j.cli.AdminTool.main(AdminTool.java:82)
Caused by: java.lang.IllegalArgumentException: 'LIST<FLOAT>'
    at org.neo4j.csv.reader.Extractors.valueOf(Extractors.java:199)
    at org.neo4j.internal.batchimport.input.csv.DataFactories.parsePropertyType(DataFactories.java:481)
    ... 22 more
root@51d13ae3cbf2:/var/lib/neo4j/import#


我在docker中使用neo4j,版本如下

root@51d13ae3cbf2:/var/lib/neo4j/import# neo4j version
neo4j 5.13.0


似乎管理员命令只理解简单的类型,如STRINGINT等,所以,我如何解决这个问题?

sz81bmfz

sz81bmfz1#

我能够在两个步骤中解决这个问题

第一步:修复头文件

id:ID,:LABEL,amount:double,measureUnit:string,gramWeight:double,embedding:float[]

字符串
注意float[]作为类型

第二步:创建数组

这涉及两个步骤

Step 2.1:为数组创建一个有效的数组

const embedding = await createEmbedding(embeddingInput);
const embeddingString = embedding.join(ARRAY_DELIMITER);


其中ARRAY_DELIMITER|

Step 2.2更新import命令,告诉你如何安装

neo4j-admin database import full --array-delimiter='|' // and so on...


注意--array-delimiter='|'
这帮助我解决了这个问题。

相关问题