Awesome
Resource Watch Knowledge Graph
Online Data browser
http://104.131.87.76:7474/browser/
Data model
Current node types
- CONCEPT
- DATASET
Current relationship types
- RELATED_TO This is a generic relationship used whenever it's not possible to use one of the more specific types
- TYPE_OF
- PART_OF
- LOCATED_AT
- TAGGED_WITH
- AFFECTS
- IS_A
- CAN_AFFECT
- IS_INVOLVED_IN
- IS_SIMILAR_TO
Current database schema
Database creation
The knowledge graph of concepts is generated from the information stated in this Google Spreadsheet.
Step by step guide to import the Graph
- Download the aforementioned spreadsheet as a CSV file
- Upload it to the server using scp
- Copy it to the folder called import that is located inside the Neo4j installation
- Download the JSON file resulting from this request to the WRI API https://api.resourcewatch.org/dataset/?app=rw&includes=vocabulary
- Execute the JAVA program: [src/main/java/com/vizzuality/CreateDatasetTagCSV.java]
- Upload the resulting file to the server using scp
- Copy it to the folder called import that is located inside the Neo4j installation
- Execute the various Cypher statements included in the file: ImportDBCypher.txt
Steps 4-7 can be skipped in the case you're not interested in adding the screenshot of datasets and their tags as a proof of concept
Examples of queries
Get all concepts that are descendants of the term 'energy'
MATCH (n:CONCEPT)-[*]->(e:CONCEPT {id: 'energy'})
RETURN n,e
Get all datasets tagged with water or any of the descendants of water
MATCH (d:DATASET)-[:TAGGED_WITH]->(c:CONCEPT)-[*]->(c2:CONCEPT)
WHERE c.id='water' OR c2.id='water'
RETURN d,c,c2
Whole graph
MATCH p=()-[]-() return p
Not recommended for computers with performance problems