Skip to content

Instantly share code, notes, and snippets.

@jmatsushita
Last active August 29, 2015 14:03
Show Gist options
  • Save jmatsushita/09e142ef14759f1c14c5 to your computer and use it in GitHub Desktop.
Save jmatsushita/09e142ef14759f1c14c5 to your computer and use it in GitHub Desktop.
OpenOil-Structr-Monomorphic
= OpenOil - Structr
== Setup Data Model
[source, cypher]
----
CREATE (company:Company { name: 'BP Exploration (Epsilon) Limited', aliases: 'BP Exp, BP Exp LTD', oc_id: 'gb/01004984', headquarters:'', people:'', founded_in:'1992', website:'', document:''})
CREATE (country:Country { name: 'Nigeria'})
CREATE (companytype:CompanyType { name:'Limited Liability Company'})
CREATE (contract:Contract { name: 'Another Nigeria Indirect Prod Contract', official_title:'', description:'', value_usd:'', value_currency_amount:'10000000', value_currency_unit: 'EUR', announced_at:'2012-08', started_at:'2014', ended_at: '', duration_months:'48', field:'', license_area:''})
CREATE (contracttype:ContractType { name:'Service Contract'})
CREATE (docu:Document { name:'The Doc', summary: 'Something about it', raw:'More about it', file:'Some blob'})
// Relationships
CREATE (company)-[:HAS_DOCUMENT {version: '1'} ]->(docu)
CREATE (company)-[:IS_OWNER { immediate:'100', ultimate:'100', ownership_type:'', start_date:'', end_date:'', source_url: 'https://opencorporates.com/companies/gb/01004984', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(company)
CREATE (company)-[:HAS_JURISDICTION {source_url: 'https://opencorporates.com/companies/gb/01004984', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(country)
CREATE (company)-[:HAS_TYPE {source_url: 'https://opencorporates.com/companies/gb/01004984', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(companytype)
CREATE (company)-[:ISSUES {source_url: 'http://www.nestoilgroup.com/projects.php', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(contract)
CREATE (contract)-[:HAS_CONTRACTOR {contract_share:'', source_url: 'http://www.nestoilgroup.com/projects.php', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(company)
CREATE (contract)-[:CONTRACT_TYPE {source_url: 'https://opencorporates.com/companies/gb/01004984', source_date: '2014-05-15', confidence: 'high', source_type:'', log_message: ''}]->(contracttype)
CREATE (country)-[:ISSUES {source_url: 'http://www.nestoilgroup.com/projects.php', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(contract)
CREATE (contract)-[:HAS_OPERATOR {contract_share:'', source_url: 'http://www.nestoilgroup.com/projects.php', source_date: '2014-05-15', confidence: 'high', source_type:'secondary', log_message: ''}]->(company)
----
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment