How the ICIJ Used Neo4j to Unravel the Panama Papers
A presentation on how journalists used Neo4j to discover who's been keeping their money in offshore tax havens.
Join the DZone community and get the full member experience.Join For Free
i work for the international consortium of investigative journalists (icij) and even though i’m a journalist i work with developers, and we use tech like neo4j to tell great stories.
about the icij
in case you don’t know about the icij, we are a network of around 200 journalists in more than 65 countries that work together to do cross-border investigations and issues of global concern that speak about systemic problems that are happening in society.
you might remember us from our 2013 investigation, offshore leaks , an investigation into data from tax havens based on only 260 gb. later, in january 2014, the spinoff of that investigation, china leaks , looking at more than 37,000 names connected to china, taiwan and hong kong.
afterwards that same year, in november 2014 we received a different leak on secret tax agreements between big corporations and the government of luxembourg to cut on taxes. finally, around a year ago we worked on this investigation called swiss leaks which is based on a leak of stolen data from hsbc in switzerland and the information of more than 100,000 clients and around $100 billion of swiss bank accounts.
all those were leak-based investigations. we’ve also done investigations based on public data, but i’m going to cover how we work with leaks and graph databases. you’ve most likely heard about the panama papers :
my colleagues at sueddeutsche zeitung , a newspaper in germany, received these messages a while ago from john doe, an anonymous source that told them that he had access to the mossack fonseca data.
of course, as data journalists we are always looking for data. the next step was to keep the sources anonymous, and after that we had to figure out how to process 2.6 terabytes of information.
the importance of sharing leaked data
normally, this is how journalists deal with data:
we get a data leak, and we hold onto it like the one ring. we don’t share it with anybody because it’s our treasure, our precious. i’m sure that many of you will relate to this because it probably happens in your company too. there’s a certain department that has access to particularly precious data. it’s their treasure, and they don’t want to share it with anybody else.
that’s why these two journalists in germany are heroes to me because instead of holding onto the ring, to that 2.6 tb of information, they decided to share it with the icij.
the icij brings reporters to work together, as i said before, from our network of journalists from media organizations, and for the panama papers investigation we built the biggest team that has ever worked on an investigation ever in journalism. we built a team of more than 370 journalists in more than 100 media organizations and 76 countries to work together for one year in secret and start looking into those files in secret.
beyond our team of reporters, i have three developers on my team who built and implemented all of the tools that icij used to mine these 11.5 million files that we got in the panama papers leak.
why trust was essential to the panama papers investigation
this is a photo of me doing trapeze:
one thing i learned doing trapeze is that it’s a leap of faith. there’s a moment where you just have to jump, and of course you have these guides and you know you’re not going to die, but you just have to jump and wait until somebody catches you.
to me, that moment where that person catches you is one of the most amazing moments in life because all of a sudden you feel you have a backup. you feel that somebody else is with you and that you’re working in a team.
even though i’m going to talk about tech today, the key to everything we did in the panama papers investigation was dependent on that leap of faith, that trust that was built among all the reporters in the investigation.
within journalism circles, i get asked this question a lot: “how did you manage to keep this a secret with journalists for over a year? journalists are so nosy.”
the answer is that we trusted each other, and we felt we were part of a team. you didn’t want to be the weakest link or the person that made a leak within the leak.
when you’re working in a team and sharing data with so many people for so long, it’s important to leave your ego at the door. on april 3rd of this year, we published the panama papers investigation . nobody knew what this was before we ran the story.
what we uncovered in the panama papers investigation
we basically exposed how offshore tax havens are used at scale by elites from anywhere in the world. we exposed how billionaires, sports stars (like lionel messi) and politicians all use tax havens to hide their money. one of the most surprising things about the investigation was the 140 names of politicians in more than 50 countries that we found in the data and we found them through a collaborative effort.
among those 140 politicians there were 12 current or former heads of state. some of them may be familiar to you because they’ve been in the spotlight, like iceland’s prime minister – or i should say iceland’s former prime minister – because after our revelations he actually had to resign because he had not declared an offshore company he had with his wife.
but that wasn’t even the most interesting thing we found. inside those 11.5 million files that belonged to the panamanian law firm mossack fonseca we found a number of criminal and corruption connections. we discovered that there were 33 blacklisted companies by the u.s. government that were in the data and that mossack fonseca was doing business with them.
we also found interesting enablers of the system such as the banks that were involved. we found that there were around more than 500 banks that served as intermediaries asking mossack fonseca to create around 16,000 companies in tax havens.
here in the u.k. we worked with the guardian that put resources to work in this investigation and their amazing data team did this investigation that looked into how properties in london are being bought through offshore companies. nearly one in ten of these tax haven companies that are connected to properties in london were linked to mossack fonseca.
there were hundreds of stories published by our partnering media organizations. in my native spain, journalists are still publishing stories today even weeks after publication. you can imagine how many stories there are in 11.5 million files.
because the way we worked together for a year during the investigation, we shared everything and then published it all at the same time. that’s why #panamapapers became a trending topic on twitter for days and still is.
the challenge of journalist collaboration
the panama papers is bigger than what we have ever worked with. i know for some of you 2.6 tb of data is nothing but in the journalism world, you get gigabytes. you get things passed to you on a flash drive.
so the first question for us was how do we deal with so much information? how do we deal with so much data? and the second question was how to share it with so many reporters in a secure way and that’s accessible from anywhere in the world at any given time?
that’s where technology became crucial and where our previous experience with leaks, databases and collaborative teams became handy. the first thing we did was to look for open source tools that allowed us to solve our problems.
the first challenge we faced: we needed our journalists to communicate amongst themselves around this data. these journalists did not belong to the same newsroom or know each other at all. they all came from different media cultures, different company cultures, different national cultures and different languages.
how would we get all these people to talk and share? we found an open source social network tool called oxwall that we tweaked to our advantage. we basically created a private social network for our reporters.
it has a news feed much like facebook where you see the latest things happening in the network, and you can add have forum posts much like any other forum. you can share links, you can share files, and you also have a private messaging feature where reporters can speak to each other individually.
for us, it was very important to have some security measures in place as well. in this investigation, we determined that governments were not a threat. that actually allowed us to be less paranoid about security.
but it was important to enable things like two-step authentication, for example, so that our reporters had to authenticate through two devices every time they logged in. of course, everything is served over https as well.
it was essential to have reporters communicating with each other because if they hadn’t, the guardian reports would have found one aspect of the story, le monde would have found a different one, a spanish paper would find something else entirely and nobody would understand the bigger picture or know what the others had found.
dissecting the panama papers data
so, what was inside the 2.6 terabytes of data?
as you can see, the majority of the data was emails. we also had pdfs and images that we had to process, and it all took a long time. imagine images of scans, records of incorporation, records in the british virgin islands, in samoa and in panama, and all of that passed through a scanner and put in pdf files. we had to spend a quite a bit of time at the beginning just processing the documents.
how did we process all that? we harnessed as much cloud power as possible, building an army of 30-40 servers at a time to do parallel processing of all those documents that had not been converted into optical character recognition (ocr) .
we created a small program ourselves which we called extract which is actually in our github account that allowed us to do this parallel processing. extract would get a file and try to see if it could recognize the content. if it couldn’t recognize the content, then we would do ocr and then send it to our document searching platform, which was apache solr .
based on apache solr, we created an index, and then we used project blacklight , another open source tool that was originally used for libraries, as our front-end tool. for example, columbia university library, where i studied, used this tool.
we tweaked it and made it available to reporters who mostly just wanted to use it for searching. they just wanted a private mini-google where they could do searches, look at a document, download it if they wanted and do some faceting based on year, path, file type, etc.
helping reporters search the panama papers data
what i liked about these tools especially – and the tools i’m going to talk about next connected to graphs – is that they allowed me to cater to my two different types of users. on one side of the spectrum, i have very good investigative journalists that have been in the business forever. everyone tells them secrets, even stones would tell them secrets if they could. but these journalist users are not very tech savvy. for some of them, email is a big achievement.
on the other side of the spectrum, i have developers and very tech-savvy journalists. these people worked with the snowden files, and they know how to query data in very sophisticated ways. what i like about blacklight and solr is that they not only allowed journalists to search any word and do the typical boolean searches. they also allowed for more advanced querying features like proximity search.
so if in the example below we’re searching for joaquin loera, within two steps you also get results like joaquin guzmán loera, and it allows you to search with regular expressions.
blacklight also allows you to do searches on the api if you have that enabled, so you could do more complex searches. it’s open source, so we were able to tweak it as well.
for example, one thing reporters requested a lot was to search by inserting a whole list of politicians (rather than searching for each one individually). we then built in a feature to do batch searching. our reporters then just had to upload a csv file with a list of names – let’s say the politicians in their country – and within seconds, they got a csv back with the results and the possible documents that had interesting information for them.
all of these customizations are why we turned to open source: because we were able to improve it and adapt it to our needs.
tying it all together with graph visualization
to review, the first platform we had to implement was to help reporters communicate. the second step was to give reporters access to the 11.5 million files and to be able to search inside them.
the third step was how to visually organize more than 210,000 companies in tax havens across 21 jurisdictions and all the people behind them: shareholders, beneficiaries, intermediaries, addresses, etc.
inside the 2.6 tb, if you look closely, you find that we had a lot of documents that were in a database format that came from mossack fonseca’s internal database. we had to reconstruct that internal database, and once we had it in microsoft sql server, we were able to conduct deeper investigations.
at the beginning of the panama papers investigation, we knew we had to use a platform to communicate and a platform to search the documents in the form of graphs. how did we know that? because we’d done it before.
before the panama papers investigation, we completed the offshore leaks database . it was three years in the making and was the most visited website the icij or our parent organization, the center for public integrity, has ever done. it has still received, three years later, more pageviews than any other story we’ve published.
released in june 2013, the offshore leaks database is a simple search box. you search and you can find a name like carmen thyssen, one of the main art collectors in spain. you probably have gone to the thyssen museum if you’ve been in madrid. some of the pieces in the museum include a van gogh, water mill at gennep , that is being shown there.
back then, when we noticed that this graph visualization was so well-used, we realized that it could be really helpful for our reporting process as well. so, we started looking for graph visualization tools.
that’s when we found linkurious .
linkurious is software that allows you to visualize graphs very easily. you get a license, you put it in your server, and if you have a database in neo4j you just plug it in and within hours you have the system set up. it also has this private system where our reporters can login or logout.
it basically had everything we needed and that’s when we started working with linkurious and neo4j. we started working with them in the swiss leaks investigation in 2014, but it’s not until now that i think we’ve grasped the full potential of what graph databases can bring into our reporting.
as i was telling you, our databases in offshore leaks and in the case of the panama papers were in sql, but thanks to another open source tool – in this case talend – and extractions from a load tool, we were able to easily transform our database into neo4j, plug in linkurious and get reporters to search.
below is one of the graphs where linkurious allows you to search visually:
in the top left, you can make searches like they do in google. results appear as dots, and then reporters can simply expand dots. remember that many of these reporters are not very tech savvy.
the good thing about linkurious is that the reporters or the developers at the other end of the spectrum can also make highly technical cypher queries if they want to start looking more in depth at the data. i really liked the fact that we could cater to both sides of the spectrum, get it to search, get reporters to even share the visualizations amongst themselves and keep collaborating not just with words and through documents but also with graphs.
just by expanding dots, my reporters found a lot of information that they had not found previously. they found a lot of connections that they had missed when they had just looked at the documents individually.
our database ended up having around 950,000 nodes and 1.2 million edges, and the size of it is around four gb. i know some of you may think that’s pretty small, but if we could handle this project with just three developers, imagine what you can do with more development power and with way more data at your company.
why the icij loves neo4j and linkurious
some cool features of neo4j and linkurious that we especially like: not only do we like the fact that our reporters were able to share the graph visualizations amongst themselves, but we also liked the magic of finding the shortest path.
most of my reporters don’t know how to do queries in cypher, so the fact that they can ask whether mar cabra is connected to david cameron and that neo4j tells them immediately with just one click was pretty amazing.
we also like the fact that neo4j and linkurious had fuzzy searching. i remember a finnish reporter telling me that she had found so many other finnish clients of mossack fonseca that she’d found thanks to fuzzy matching techniques, because in many of our languages, names can sound similar.
the public-facing features of linkurious were another plus. even though the whole dataset was private, we could actually select a graph visualization, publish it to the web and embed it like you would embed any youtube videos through an iframe. these visualizations could then be embedded into a story.
linkurious also has an api that we’re currently working with so that we can build the new offshore leaks database.
the future of data journalism at the icij
i like the fact that we were able to implement technology in the reporting in a way that i would dare to say has never been done before. we worked with the largest data leak in history . but to me one of the main reasons why we do the type of work is not only to bring down prime ministers, but also to expose crime and corruption. if crime and corruption and drug trafficking and weapons trafficking are global, reporters need to work globally.
a closing note about the icij: while we have three developers, our full-time staff is only 12 people, and we are a non-profit media organization. that means that instead of depending on commercial funding from big corporations like many companies do, we depend on donors like you.
if you really like our work, if you really think we’re doing a good job, i would encourage you to think of donating because thanks to the donations of people like you we get to do the work we do.
Published at DZone with permission of Mar Cabra, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.