In this Challenge, you will be working with the data you previously imported with the Data Importer.
This challenge has 2 steps:
-
Transform the Movie properties to lists.
-
View the types stored in the graph.
Step 1: Transform the Movie properties to lists
Execute this code in the sandbox on the right to view the multi-value properties of the Movie nodes.
Unresolved directive in lesson.adoc - include::{repository-raw}/main/modules/3-refactoring-imported-data/lessons/4-c-transform-lists/return-properties.cypher[]
Copy this code into the sandbox on the right, modify it to transform the three multi-value properties (languages, countries, genres) of Movie nodes, and execute it:
Unresolved directive in lesson.adoc - include::{repository-raw}/main/modules/3-refactoring-imported-data/lessons/4-c-transform-lists/set-properties.cypher[]
// add the transformation for the languages and genres properties
Your code should have set 279 properties.
Step 2: View the types stored in the graph
Now that you have transformed properties in the graph to match what we want for numeric and date values in the graph, confirm that their types are correct:
Unresolved directive in lesson.adoc - include::{repository-raw}/main/shared/apoc-meta-nodetypeproperties.cypher[]
Validate Results
Once you completed the steps of this Challenge, click the Check Database button and we will check the database for you.
Hint
To transform the lists you set three properties, countries, languages, and genres. You set them with one SET clause and each property being set is separated by a comma. You use split/coalesce to set each property.
Solution
Here is the code to transform the three properties to lists:
Unresolved directive in questions/verify.adoc - include::{repository-raw}/main/modules/3-refactoring-imported-data/lessons/4-c-transform-lists/solution.cypher[]
If your graph does not verify, you may need to:
-
Clear the graph with:
Unresolved directive in questions/verify.adoc - include::{repository-raw}/main/shared/detach-delete-all-nodes.cypher[]
-
Re-import the data once again with the Data Importer
-
Transform the genres, countries, languages properties to lists
Summary
In this challenge, you transformed the multi-value string data to list (StringArray) types to match our target data model. In the next lesson, you learn how to refactor the graph to add labels.