Panama Papers¶
This example is based on the work of Will Lyon and Michael Hunger as part of a technical article about using graph databases to for journalistic analysis.
The family of Azerbaijan President Ilham Aliyev leads a charmed, glamorous life, thanks in part to financial interests in almost every sector of the economy. His wife, Mehriban, comes from the privileged and powerful Pashayev family that owns banks, insurance and construction companies, a television station and a line of cosmetics. She has led the Heydar Aliyev Foundation, Azerbaijan’s pre-eminent charity behind the construction of schools, hospitals and the country’s major sports complex.
Their eldest daughter, Leyla, editor of Baku magazine, and her sister, Arzu, have financial stakes in a firm that won rights to mine for gold in the western village of Chovdar and Azerfon, the country’s largest mobile phone business. Arzu is also a significant shareholder in SW Holding, which controls nearly every
operation related to Azerbaijan Airlines (“Azal”), from meals to airport taxis. Both sisters and brother Heydar own property in Dubai valued at roughly 75 million USD in 2010. Heydar is the legal owner of nine luxury mansions in Dubai purchased for some 44 million USD.

Creating the graph¶
The Cypher script to set-up the nodes and relationships can be copied from below:
CREATE
(leyla: Officer {name:"Leyla Aliyeva"})-[:IOO_BSD]->(ufu:Company {name:"UF Universe Foundation"}),
(mehriban: Officer {name:"Mehriban Aliyeva"})-[:IOO_PROTECTOR]->(ufu),
(arzu: Officer {name:"Arzu Aliyeva"})-[:IOO_BSD]->(ufu),
(mossack_uk: Client {name:"Mossack Fonseca & Co (UK)"})-[:REGISTERED]->(ufu),
(mossack_uk)-[:REGISTERED]->(fm_mgmt: Company {name:"FM Management Holding Group S.A."}),
(leyla)-[:IOO_BSD]->(kingsview:Company {name:"Kingsview Developents Limited"}),
(leyla2: Officer {name:"Leyla Ilham Qizi Aliyeva"}),
(leyla3: Officer {name:"LEYLA ILHAM QIZI ALIYEVA"})-[:HAS_SIMILIAR_NAME]->(leyla),
(leyla2)-[:HAS_SIMILIAR_NAME]->(leyla3),
(leyla2)-[:IOO_BENEFICIARY]->(exaltation:Company {name:"Exaltation Limited"}),
(leyla3)-[:IOO_SHAREHOLDER]->(exaltation),
(arzu2:Officer {name:"Arzu Ilham Qizi Aliyeva"})-[:IOO_BENEFICIARY]->(exaltation),
(arzu2)-[:HAS_SIMILIAR_NAME]->(arzu),
(arzu2)-[:HAS_SIMILIAR_NAME]->(arzu3:Officer {name:"ARZU ILHAM QIZI ALIYEVA"}),
(arzu3)-[:IOO_SHAREHOLDER]->(exaltation),
(arzu)-[:IOO_BSD]->(exaltation),
(leyla)-[:IOO_BSD]->(exaltation),
(arzu)-[:IOO_BSD]->(kingsview),
(redgold:Company {name:"Redgold Estates Ltd"}),
(:Officer {name:"WILLY & MEYRS S.A."})-[:IOO_SHAREHOLDER]->(redgold),
(:Officer {name:"LONDEX RESOURCES S.A."})-[:IOO_SHAREHOLDER]->(redgold),
(:Officer {name:"FAGATE MINING CORPORATION"})-[:IOO_SHAREHOLDER]->(redgold),
(:Officer {name:"GLOBEX INTERNATIONAL LLP"})-[:IOO_SHAREHOLDER]->(redgold),
(:Client {name:"Associated Trustees"})-[:REGISTERED]->(redgold)
Question 1¶
How can you describe the graph structure ?
Answer:
CALl db.schema.visualization()
which results in :

Question 2¶
In a next step, you investigate the properties that are attached to a Node or a relationship between nodes.
How can many officers are there in the network ? (answer:11). But how many of those persons can be linked to the Aliyev-family ?
You can assume that if the last name contains “aliyev”, this person has ties to the president.
Answer:
MATCH (o:Officer)
WHERE toLower(o.name) CONTAINS "aliyev"
RETURN o
Question 3¶
You can now move one step further in your analysis and find those companies that are linked to persons linked to the Aliyev family.
Answer:
MATCH (o:Officer) WHERE toLower(o.name) CONTAINS "aliyev"
MATCH (o)-[r]-(c:Company)
RETURN o,r,c
This is the picture you should obtain (check !) .. figure:: figures/overview_company.png
Question 4¶
Make a list of all the Officers and the roles they take in the companies.
Answer:
MATCH (c:Company)-[r]-(o:Officer)
RETURN c.name as company , o.name as officer ,type(r) as role
Question 5¶
Some of the familiy members are jointly involved in more than one company. Make a list of those relationships.
Answer:
MATCH (o1:Officer)-[r1]->(c:Company)<-[r2]-(o2:Officer)
WITH o1.name AS first, o2.name AS second, count(*) AS nbr, collect(c.name) AS involvements
WHERE nbr > 1 and first > second
RETURN first, second, involvements, nbr
Question 6¶
A single family member could appear in different reports with different names: upper case, more than one first name, etc…
Taking the first name as a reference point, find those names that are linked to more than one of the the same first name.
Answer:
MATCH (o:Officer)
WITH toLower(split(o.name," ")[0]) as first_name, collect(o.name) as names, count(*) as count
WHERE count >1
RETURN first_name , names
Question 7¶
Create a new node type “Person”. This node type is then linked to the Officer it was derived from. This is an elegant way to resolve duplicates.
Answer:
MATCH (o:Officer)
WITH split(toLower(o.name), " ") AS name_parts, o
WITH name_parts[0]+ " " + name_parts[-1] AS name, collect(o) AS officers
WHERE name CONTAINS "aliyev"
CREATE (p:Person { name:name })
FOREACH (o IN officers | CREATE (o)-[:IDENTIY]->(p))
The graph schema now changes :

Extra¶
Two persons are missing in the overview:
The president (Ilham Aliyev) who was not on the radar so far.
The younger brother (Heydar Aliyev)
Only the two sisters (Leyla and Arzu) and the president’s wife (Mehriban) were mentioned as officers in the company network.
Let’s create these two missing persons (Ilham and Heydar) and create family ties between them.
We will introduce three new relationships:
CHILD_OF
MARRIED_TO
SILING_OF
CREATE (ilham:Person {name:"ilham aliyev"})
CREATE (heydar:Person {name:"heydar aliyev"})
WITH ilham, heydar
MATCH (mehriban:Person {name:"mehriban aliyeva"})
MATCH (leyla:Person {name:"leyla aliyeva"})
MATCH (arzu:Person {name:"arzu aliyeva"})
FOREACH (child in [leyla,arzu,heydar] | CREATE (ilham)-[:CHILD_OF]->(child) CREATE (mehriban)-[:CHILD_OF]->(child))
CREATE (leyla)-[:SIBLING_OF]->(arzu)
CREATE (leyla)-[:SIBLING_OF]->(heydar)
CREATE (arzu)-[:SIBLING_OF]->(heydar)
CREATE (ilham)-[:MARRIED_TO]->(mehriban)
Last change: Oct 30, 2023