This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH date({ year: 2019, month: 12, day: 31 }) as lastDay | |
UNWIND range(1, lastDay.ordinalDay) as iterator | |
WITH date(toString(lastDay.year) + CASE WHEN iterator <= 9 THEN "00" WHEN iterator > 9 AND iterator <= 99 THEN "0" ELSE "" END + toString(iterator)) as day | |
FOREACH(day IN CASE WHEN (day.dayOfWeek > 5) THEN [day] ELSE [] END | | |
CREATE (:Weekend { day: day, workingHours: 0 }) | |
) | |
FOREACH(day IN CASE WHEN (day.dayOfWeek < 6) THEN [day] ELSE [] END | | |
CREATE (:WorkingDay { day: day, workingHours: 8 }) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UNWIND apoc.coll.pairsMin(range(1, 365)) as pair | |
MATCH (w1) | |
WHERE (w1:WorkingDay OR w1:Weekend) AND w1.day.ordinalDay = pair[0] | |
MATCH (w2) | |
WHERE (w2:WorkingDay OR w2:Weekend) AND w2.day.ordinalDay = pair[1] | |
MERGE (w1)-[:NEXT]->(w2) | |
RETURN w1, w2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MERGE (g:Genius { name: "Leonardo da Vinci" }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (g:Genius) | |
SET g.dateOfBirth = date({ year: 1452, month: 4, day: 15 }), g.dateOfDeath = date({ year: 1519, month: 5, day: 2 }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (g:Genius) | |
MERGE (mom:Person { name: "Caterina", occupation: "peasant woman" }) | |
MERGE (dad:Person { name: "Messer Piero", occupation: "notary" }) | |
MERGE (mom)-[:MOTHER_OF]->(g)<-[:FATHER_OF]-(dad) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (g:Genius) | |
MERGE (v:Region { name: "Vinci" }) | |
MERGE (f:City { name: "Florence" }) | |
MERGE (g)-[:BIRTH_PLACE]->(v)-[:NEAR_BY]->(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (g:Genius) | |
WITH ['Painter', 'Sculptor', 'Architect', 'Musician', 'Scientist', 'Mathematician', 'Engineer', 'Inventor', 'Anatomist', 'Geologist', 'Cartographer', 'Botanist', 'Writer'] as knowns, g | |
UNWIND knowns as known | |
MERGE (g)-[:KNOWN_FOR]->(o:Occupation { name: known }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (o:Occupation { name: "Painter" }) | |
WITH ['The Annunciation', 'The Baptism of Christ', 'Madonna of the Carnation', 'Ginevra de\' Benci', 'Benois Madonna', 'The Adoration of the Magi', 'Saint Jerome in the Wilderness', 'Madonna Litta', 'Virgin of the Rocks', 'Portrait of a Musician', 'Lady with an Ermine', 'The Last Supper', 'La belle ferronnière', 'Sala delle Asse', 'The Virgin and Child with St Anne and St John the Baptist', 'Portrait of Isabella d\'Este', 'The Madonna of the Yarnwinder', 'The Madonna of the Yarnwinder', 'The Virgin and Child with St. Anne', 'Mona Lisa', 'Salvator Mundi', 'Head of a Woman', 'St. John the Baptist'] as artworks, o | |
UNWIND artworks as artwork | |
MERGE (o)-[:CREATE]->(a:Artwork { name: artwork }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (a:Artwork) | |
WHERE a.name = 'The Last Supper' OR a.name = 'Mona Lisa' | |
SET a:Masterpiece |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (o:Occupation { name: "Inventor" }) | |
WITH ['Parachute', 'Aerial Screw', 'Ornithopter', 'Robots', 'Machine Gun', 'Viola Organista', 'Diving Suit', 'Self-Propelled Cart', 'Armored Vehicle', 'Cannons'] as inventions, o | |
UNWIND inventions as invention | |
MERGE (o)-[:INVENT]->(i:Invention { name: invention }) |
OlderNewer