Example of Neo4j Advanced Cypher Query with APOC

May 9: Immortal Regiment, One Month Graph Challenge

Vlad Batushkov
3 min readMay 9, 2019

--

Welcome word

In this series of small posts I do one simple graph daily. Domain model of graph somehow related to day’s history, some historical event, celebration or person. I do this challenge to learn Neo4j Data Modeling and Cypher. Every day. One month. Follow me. Maybe you will be inspired and next month would be yours One Month Graph Challenge. #OMGChallenge

Domain model

I hope all of you knows, that 9 of May is one of the most important celebrations in Post Soviet countries and basically in whole world. It is a Victory Day. Day of celebration of the victory of the Red Army and the Soviet people over Nazi Germany in the Great Patriotic War of 1941–1945.

In this day in many cities hold ceremonies and parades in honor of people who defeat Hitler’s army.

One of the greates and wonderful initiatives is international public civil patriotic movement knowns as Immortal Regiment. Annually on this day, 9 of May, thousands of people are convoyed through the streets of own cities with photos of their relatives — veterans of the army and navy, partisans, underground fighters, resistance fighters, home front workers, concentration camp prisoners, blockademen, children of war. Usually in Moscow participated around 500.000 of people, St. Petersburg — 200.000, Tula — 100.000, Tomsk — 70.000, Novosibirsk — 50.000 and also smaller numbers in many other cities across Russia and other Post Soviet countries.

Today I want to build very small graph with list all cities joined this movement to represent how wide the size of memory and honor.

Graph

Grab data from wikipedia with using of APOC load HTML, tricks of jquery, magic of regex and few Cypher string functions:

I do not plan do much with this data, just provide some ordered output. List, that ordered by year with number of joined countries + total + enumeration of countries:

Resume

I would like to hear more ideas from you guys on topic of data manipulations, aggregations and working with lists in Cypher. Even with this small piece of data. I also want to point your attention, that today’s topic is not only an example of some wonderful Cypher features, but also great example of people respect and love to family and Homeland. All peace.

Resources

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Vlad Batushkov
Vlad Batushkov

Written by Vlad Batushkov

Engineering Manager @ Agoda. Neo4j Ninja. Articles brewed on modern tech, hops and indie rock’n’roll.

No responses yet

Write a response