refactoring
Changing the structure of a graph without changing what it represents, usually to make queries simpler, faster or more logical.
Example
Before, the country a film was made in is a property of the film.
After, it is a node the films share.
cypher
MATCH (m:Movie)
MERGE (c:Country {name: m.country})
MERGE (m)-[:RELEASED_IN]->(c)
REMOVE m.countryBoth graphs record the same two facts. In the second, a query reaches Apollo 13 from Toy Story by following two relationships. Before, it had to scan the country property of every film.
Lessons that use this term
The lesson and course links below open in a new tab.
No published lesson uses this term yet.