Skip to content

nativelogix/ml-panamapapers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MarkLogic Panama Papers

Provides an exploratory search + semantics application to help bootstrap your knowledge of using MarkLogic + Semantics.

Getting Started

Running the app requires the following:

Installing Application

> git clone https://github.com/nativelogix/ml-panamapapers.git
> cd ml-panamapapers
> ./ml bootstrap local
> ./ml deploy modules local

Loading Data

  • Unzip the data.zip file into {project-root}/data
  • The run.bat file has all the necessary mlcp commands to load the content. An .sh version will come shortly, but should be enough to get started.
  • Make sure you set your credentials to match your admin or ml-panama-paper user credentials.

Some useful queries

The following are queries that can provide some useful insight into the dataset.

Count properties(predicates) in dataset

## Count properties(predicates) in dataset
PREFIX pp: <http://panamapapers.icij.org/>
PREFIX pprel: <http://panamapapers.icij.org/rel/>
PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?p (COUNT(?p) as ?count)
WHERE {
  ?s ?p ?o
}
GROUP BY ?p
ORDER BY DESC(?count)
LIMIT 200

Get a list of types of entities and their count

## Count Entities by Type
PREFIX pp: <http://panamapapers.icij.org/>
PREFIX pprel: <http://panamapapers.icij.org/rel/>
PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?o (COUNT(?o) as ?type)
WHERE {?s rdf:type ?o}
GROUP BY ?o

Select the top countries where entities do business

#Top Countries group descending
PREFIX pp: <http://panamapapers.icij.org/>
PREFIX pprel: <http://panamapapers.icij.org/rel/>
PREFIX rdf: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?ftype ?country (count(?ftype) as ?count) 
WHERE {
  ?from rdf:type ?ftype .
  ?from (pprel:registeredAddress|pprel:sameAsAddress) ?to . 
  ?to rdf:type ?ttype FILTER(?ttype = pp:Address) .
  ?to pp:countries ?country
}
GROUP BY ?ftype ?country 
ORDER BY ?ftype DESC(?count)
LIMIT 10

About

Panama Papers using MarkLogic Semantics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published