Last active
August 29, 2015 14:01
-
-
Save jmatsushita/0fc1b6ce96d1dbfe240a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= OpenOil - BP Data Import (100 Records) | |
== Setup | |
//setup | |
//hide | |
[source, cypher] | |
---- | |
LOAD CSV FROM 'https://raw.githubusercontent.com/iilab/openoil/master/data/BP100.csv' AS line | |
MERGE (c:Company { name: line[0], ID: line[6], sourceURL: line[7], sourcePubDate: line[9]}) | |
MERGE (p:Company { name: line[2]}) | |
MERGE (j:Country { name: line[4]}) | |
MERGE (conf:Confidence { level: line[8]}) | |
MERGE (c)-[dir:DIRECT { immediate: line[1]}]->(p) | |
MERGE (c)-[jur:JURISDICTION]->(j) | |
MERGE (c)-[con:CONFIDENCE]->(conf) | |
---- | |
== Query | |
[source, cypher] | |
---- | |
MATCH (n) | |
RETURN n | |
LIMIT 200 | |
---- | |
//graph_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= OpenOil - BP Data Import | |
== Setup | |
//setup | |
//hide | |
[source, cypher] | |
---- | |
LOAD CSV FROM 'https://raw.githubusercontent.com/iilab/openoil/master/data/BP500.csv' AS line | |
MERGE (c:Company { name: line[0], corporateId: line[6], sourceURL: line[7], sourcePubDate: line[9]}) | |
MERGE (p:Company { name: line[2]}) | |
MERGE (j:Country { name: line[4]}) | |
MERGE (c)-[d:DIRECT { immediate: line[1]}]->(p) | |
MERGE (c)-[e:JURISDICTION]->(j) | |
---- | |
== Query | |
[source, cypher] | |
---- | |
MATCH (n) | |
RETURN n | |
LIMIT 200 | |
---- | |
//graph_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= OpenOil - BP Data Import | |
== Setup | |
//setup | |
//hide | |
[source, cypher] | |
---- | |
LOAD CSV FROM 'https://raw.githubusercontent.com/iilab/openoil/master/data/BP%20Dataset%202014.05.28%20%28Full%20AR2013%20Scrape%20-%20edited%29%20-%20Sheet1.csv' AS line | |
MERGE (c:Company { name: line[0], corporateId: line[6], sourceURL: line[7], sourcePubDate: line[9]}) | |
MERGE (p:Company { name: line[2]}) | |
MERGE (j:Country { name: line[4]}) | |
MERGE (c)-[d:DIRECT { immediate: line[1]}]->(p) | |
MERGE (c)-[e:JURISDICTION]->(j) | |
---- | |
== Query | |
[source, cypher] | |
---- | |
MATCH (n) | |
RETURN n | |
LIMIT 200 | |
---- | |
//graph_result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= OpenOil - BP Data Import | |
== Setup | |
[source, cypher] | |
---- | |
CREATE (c:Company { name: 'BP Exploration (Epsilon) Limited', ID: 'gb/01004984', sourceURL: 'https://docs.google.com/file/d/0B5ORBm2amqZSY2NvOFQwbTZvemM', sourcePubDate: '7/6/2013'}) | |
MERGE (p:Company { name: 'BP Exploration Operating Company Limited'}) | |
MERGE (j:Country { name: 'Bahamas'}) | |
MERGE (conf:Confidence { level: 'High Confidence'}) | |
MERGE (c)-[dir:DIRECT { immediate: '100'}]->(p) | |
MERGE (c)-[jur:JURISDICTION]->(j) | |
MERGE (c)-[con:CONFIDENCE]->(conf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment