Cannot query a relationship Neo4j

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Cannot query a relationship Neo4j



I have a created a csv like below



enter image description here



I have import the csv to Neo4j server
the code I used is


USING PERIODIC COMMIT LOAD CSV WITH HEADERS FROM "file:///testset.csv" AS line WITH line

CREATE (c:Company {name: line.`Company`}) MERGE (s:Supermarket {name:line.`supermarket`})
MERGE (p:Product {name:line.`product`, country:line.`country`, price:line.`price`})

CREATE (c)-[:TRADE]->(s) CREATE (s)-[:BUY]->(p) CREATE (c)-[:SELL]->(p) ;



enter image description here



I would like create a query to find which supermarket is Company A trading with. So I wrote the following query. Based on https://neo4j.com/blog/query-cypher-data-relationships/


MATCH (c:Company)-[r:TRADE]->(s:Supermarket)
WHERE c.name = "Company A"
RETURN c,r,s LIMIT 25



However, it shows


(no changes, no records)



I would like to know
1.) is it because I haven't created constraints?
2.) If 1 is correct, is it every column should create constraints?



Thank you for your help. I am just a starter in Neo4j.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

mW0u7H 4rw26v,Hmq5,dD MLQR3GH,fp1DMrNhW1HZnzx,LEcd3yR0Zljh3CL9A3,jN
zjqT,rQ1NQ,0J5TI5UNJ,xt62 Anh8,BzDVAt jsitbT0KTM1DCvd6YTu1Vm mNYvl2P

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results