Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-27-2022 07:34 PM
helpp, im stuck at this question. can anybody help? it is the learning module in neo4j
Write and run refactor code to:
MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie)
)MERGE
) a Role node setting it’s name to the role in the ACTED_IN relationship.MERGE
) the PLAYED relationship between the Actor and the Role nodes.MERGE
) the IN_MOVIE relationship between the Role and the Movie nodes.04-03-2022 07:02 AM
MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie) MERGE (x:Role {name: r.role}) MERGE (a)-[:PLAYED]→(x) MERGE (x)-[:IN_MOVIE]→(m) SET r.role = null
This is given as the solution code but it's not working. I Updated it as below, still not working. Can somebody help?
MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie) WHERE r.role is NOT NULL MERGE (x:Role {name: r.role}) MERGE (a)-[:PLAYED]-(x) MERGE (x)-[:IN_MOVIE]-(m) SET r.role = null
04-04-2022 05:46 AM
Hello @prabhitha3 and welcome to the Neo4j Community!
What error are you getting when you run the solution code?
It is possible that your graph has been refactored to a state that is not expected in the challenge.
I recommend that you do the following:
Elaine
07-27-2022 10:39 PM
Hi,
I'm facing the same issue. I tried to terminate the sandbox and restart the challenge. However, I still face the same issue. It says "You havent passed the Test". When I check the graph data, I see all the expected Nodes and relationships correctly built. Is there a way to see what the error is?
08-01-2022 05:17 AM
If you terminate your sandbox and refresh the page for this challenge, it should put the graph in the state it should be for the beginning of this challenge. It will take a least a minute for the sandbox to be created. It is usable after the $neo4j prompt appears.
Note: Make sure you are not using this blank sandbox for any other purpose than this course.
If you execute the Cypher code shown as the solution to this challenge, the database should verify.
Can you try again?
Elaine
08-03-2022 09:59 AM
SET r.role = null NOT needed
Run in Sandbox
// Find an actor that acted in a Movie
MATCH (a:Actor)-[r:ACTED_IN]->(m:Movie)
// Create a Role node
MERGE (x:Role {name: r.role})
// Create the PLAYED relationship
// relationship between the Actor and the Role nodes.
MERGE (a)-[:PLAYED]->(x)
// Create the IN_MOVIE relationship between
// the Role and the Movie nodes.
MERGE (x)-[:IN_MOVIE]->(m)
This query should add 5 labels, create 5 nodes, set 5 properties, and create 10 relationships.
Click Run in Sandbox to execute the query and then click the Try again… button to verify that the query has succeeded.
If the numbers do not match up, try refreshing your browser to reset the data in your Sandbox instance.
All the sessions of the conference are now available online