Graph Data Modeling Fundamentals Adding a role node

helpp, im stuck at this question. can anybody help? it is the learning module in neo4j

Write and run refactor code to:

  1. Find an actor that acted in a Movie ( MATCH (a:Actor)-[r:ACTED_IN]-(m:Movie) )
  2. Create (using MERGE ) a Role node setting it’s name to the role in the ACTED_IN relationship.
  3. Create (using MERGE ) the PLAYED relationship between the Actor and the Role nodes.
  4. Create (using MERGE ) the IN_MOVIE relationship between the Role and the Movie nodes.
  5. Remove the role property from the ACTED_IN relationship (set it to null)

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?

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

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.