Cypher code for loading relationships into neo4j ignoring data in csv column -
i'm loading relationships neo4j. worked fine me:
using periodic commit 500 load csv headers "<link topic relationships.csv>" csvline match (work:work {id: csvline.recordidentifier}),(topic:subject {topic: csvline.topicid}) create work-[:isabout]->topic;
but similar scenario not working me:
neo4j-sh (?)$ load csv headers "<link authorrel.csv on github>" csvline match (c:creator { name: csvline.creatorid}), (w:work { id: csvline.recordidentifier}) create c-[:created]->w; +--------------------------------------------+ | no data returned, , nothing changed. | +--------------------------------------------+ 493 ms neo4j-sh (?)$
this part works,
neo4j-sh (?)$ load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/master/graphdata/authorrel.csv" csvline return csvline;
and works
neo4j-sh (?)$ load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/master/graphdata/authorrel.csv" csvline match (w:work { id: csvline.recordidentifier}) return w;
but breaks down when try match on :creator name:
load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/master/graphdata/authorrel.csv" csvline match (c:creator { name: csvline.creatorid}) return c;
i got error message null values, tried (from create neo4j database using csv files):
neo4j-sh (?)$ using periodic commit 500 load csv headers "https://raw.githubusercontent.com/heardlibrary/graphs-without-ontologies/master/graphdata/authorrel.csv" csvline match (w:work { name: csvline.recordidentifier}) merge (c:creator { name: coalesce(csvline.creatorid, "no name")}) create (c)-[:created]->(w); +-------------------+ | no data returned. | +-------------------+ nodes created: 1 relationships created: 52 properties set: 1 labels added: 1 998 ms neo4j-sh (?)$ match (c)-[r:created]->(w) return c,r,w limit 10; | node[278478]{name:"no name"} | :created[26273]{} | node[278029]{name:"oai:dash.harvard.edu:1/2031670"} | | node[278478]{name:"no name"} | :created[26272]{} | node[278030]{name:"oai:dash.harvard.edu:1/2019322"} | | node[278478]{name:"no name"} | :created[26275]{} | node[278031]{name:"oai:dash.harvard.edu:1/2031713"} | | node[278478]{name:"no name"} | :created[26274]{} | node[278031]{name:"oai:dash.harvard.edu:1/2031713"} | | node[278478]{name:"no name"} | :created[26277]{} | node[278031]{name:"oai:dash.harvard.edu:1/2031713"} | | node[278478]{name:"no name"} | :created[26276]{} | node[278031]{name:"oai:dash.harvard.edu:1/2031713"} | | node[278478]{name:"no name"} | :created[26279]{} | node[278032]{name:"oai:dash.harvard.edu:1/2026618"} | | node[278478]{name:"no name"} | :created[26278]{} | node[278033]{name:"oai:dash.harvard.edu:1/2027194"} | | node[278478]{name:"no name"} | :created[26281]{} | node[278033]{name:"oai:dash.harvard.edu:1/2027194"} | | node[278478]{name:"no name"} | :created[26280]{} | node[278034]{name:"oai:dash.harvard.edu:1/2027199"} |
the name data not being picked csv. please advise.
you seem have typo in scenario "is not working" you. work
node's property name should name
, not id
.
Comments
Post a Comment