├── .gitignore ├── README.adoc ├── code ├── gedcom │ ├── ancestry.cypher │ ├── gedcom2csv.py │ └── gedcom2neo4j.py ├── nodes-neodash-dashboard.json └── podcasts.cypher ├── connect-aura.adoc ├── data ├── 99-invisible-full.json ├── 99-invisible.json ├── Discover NODES - Sessions.csv ├── Discover NODES - Speakers.csv ├── GraphConnect Schedule.csv ├── GraphConnect Talks.csv ├── complaints-nov-2021.csv ├── data-importer-gc-schedule.zip ├── data-importer-goodreads-small.zip ├── data-importer-nft-2021-01-01.zip ├── esc │ ├── esc-1975-2019.csv │ ├── esc-2021.csv │ ├── esc-2022.csv │ ├── esc-countries.csv │ ├── esc-import.cypher │ └── esc-load-tests.cypher ├── neo4j_importer_model_movies_denormalized.json ├── nft_2021-01-01.csv ├── nobel-prizes │ ├── complete.csv │ ├── json_award.json │ ├── json_laureates.json │ ├── laureate.csv │ ├── laureates.json │ ├── nobel-prize-neo4j_importer_model_2023-01-16.json │ ├── nobelPrizes.json │ ├── nominees.json │ ├── prize.csv │ └── prize2.csv ├── nodes-sessions-data-importer-2022-09-26.zip ├── podcasts-active.json ├── pres2020.ged ├── presidents-data-importer.zip ├── presidents.csv ├── royal92.ged ├── royals.csv ├── wom-btw-2021.csv └── wordle.csv ├── img ├── NBAGraph.png ├── Resonatemodel.png ├── attrition-bloom-job.png ├── attrition-department-bloom.png ├── attrition-model.png ├── aura-browser.png ├── aura-connect.png ├── aura-create-free.png ├── aura-credentials.png ├── aura-workspace.png ├── aurads.png ├── bb_csv.png ├── bbgmodel.png ├── bluesky-bloom-coordinate.png ├── bluesky-bloom-force.png ├── bluesky-bloom-hierarchical.png ├── bluesky-browser-shortest.png ├── bluesky-browser-thread.png ├── bluesky-jaz-graph.jpg ├── bluesky-jaz-thread.png ├── bluesky-timeline.png ├── books-aura.png ├── books-data.png ├── books-goodreads.png ├── books-import.png ├── books-reco-collab.png ├── books-tag-sherlock.png ├── books-user-ratings.png ├── chessmodel.png ├── chessmovechain.png ├── citations-dataimporter.png ├── citations-nature-data-importer.png ├── citations-nature-explore.png ├── citations-nature-query.png ├── citations-nature-visualization.png ├── codespace.png ├── complaints-schema-graph-viz.png ├── consumer-complaints.png ├── consumer-complaints.svg ├── data-import-bloom-northwind.png ├── data-import-credentials.png ├── data-import-graphacademy.png ├── data-import-model-export.png ├── data-import-movie-files.png ├── data-import-movie-mapping-rel.png ├── data-import-movie-mapping.png ├── data-import-movie-model.png ├── data-import-movie-results.png ├── data-import-movies-denormalized.png ├── data-import-movies-genres-bloom.png ├── data-import-northwind-model.png ├── data-import-northwind-results.png ├── data-importer-overview.png ├── desktop-dump.png ├── election-party-topic.png ├── esc-2022-gt15.png ├── esc-import-all.png ├── fast.gif ├── gc-schedule-bloom-recommendation.png ├── gc-schedule-bloom-saved-query.png ├── gc-schedule-bloom.png ├── gc-schedule-browser-all.png ├── gc-schedule-data-importer.png ├── gc-schedule-model.png ├── gc-schedule-recommendation.png ├── gc-schedule-session.png ├── gc-sessions-spreadsheet.png ├── gdelt-model.png ├── gdelt-overlap.png ├── gedcom-bloom-all.png ├── gedcom-bloom-core-families.png ├── gedcom-bloom-lincoln.png ├── gedcom-bloom-styling.png ├── gedcom-browser-kennedy.png ├── gedcom-browser.png ├── gedcom-data-importer.png ├── gedcom-family-ancestors.png ├── gedcom-import-results.png ├── gedcom-model.png ├── gedcom-siblings.png ├── german-election-bloom.png ├── git-bloom-shortest-path.png ├── git-bloom.png ├── git-data-importer.png ├── git-import-preview.png ├── git-import-results.png ├── git-model.png ├── git-query-long-path.png ├── git-query-path.png ├── git-query-profile.png ├── git-query-profile2.png ├── git-query.png ├── hamilton-data-model.png ├── hamilton-data-model.svg ├── hamilton-model.png ├── hamilton-sfo.jpg ├── hamilton-themes.png ├── hamilton-washington.png ├── img_data.png ├── img_repo.png ├── jaz-bluesky-graph.png ├── kickstarter-categories.png ├── kickstarter-datamodel.png ├── kickstarter-dataset.png ├── kickstarter-meta.png ├── kickstarter-projects.png ├── marvel-account.png ├── marvel-api-character.png ├── marvel-api.png ├── marvel-bloom-comics-stories.png ├── marvel-bloom-shortest-path.png ├── marvel-brower-load-data.png ├── marvel-browser-characters.png ├── marvel-browser-clusters.png ├── marvel-browser-overview.png ├── marvel-graphql-query.png ├── marvel-groot.png ├── marvel-model.png ├── marvel-teams.png ├── marvel-vimeo.png ├── movies-db.png ├── movies-guide.png ├── nft-bloom-collection.png ├── nft-bloom-seller.png ├── nft-bloom-style-transaction-color.png ├── nft-bloom-style-transaction-size.png ├── nft-import-results.png ├── nft-model.png ├── nft-transaction-mapping.png ├── nobel-prize-data-importer-preview.png ├── nobel-prize-data-importer-preview2.png ├── nobel-prize-data-importer.png ├── nobel-prize-explore-harvard-medical.png ├── nobel-prize-explore-show-graph.png ├── nobel-prize-kg-model.png ├── nobel-prize-model.png ├── nobel-prize-query-institutions.png ├── nobel-prize-query-laureats-per-prize.png ├── nobel-prize-query-multiple-prizes.png ├── nobel-prize-query-oldest.png ├── nobel-prize-query-youngest.png ├── nodes-dashboard.png ├── nodes-data-importer-preview.png ├── nodes-data-importer.png ├── nodes-explore-session.png ├── nodes-explore-show-graph.png ├── nodes-labs-tools.png ├── nodes-promo.png ├── nodes-sessionize-api.png ├── nodes-sessionize-export-csv.png ├── nytimes-articles.png ├── nytimes-metadata.png ├── nytimes-topics.png ├── nzcc.png ├── opencitations-search.png ├── opencitations-single.png ├── podcasts-model.png ├── podcasts-tags.png ├── ranys.png ├── recommendations-guide.png ├── sandbox-backup.png ├── shirley-hamilton.png ├── spreadsheet-publish.png ├── stackoverflow.png ├── upload-dump.png ├── wordle-bloom.png ├── wordle-crash.png ├── wordle-diver.png ├── wordle-example-progress.png ├── wordle-example-solved.png ├── wordle-model.png ├── wordle-rel-model-exclusions.png ├── wordle-rel-model.png ├── wordle-shared-letters.png ├── wordle-shared-letters2.png ├── wordle-solver.png ├── wordle_neo4j.gif └── zq99chessrepo.png ├── rdbms2neo4j ├── week-1.adoc ├── week-10.adoc ├── week-11.adoc ├── week-12.adoc ├── week-13.adoc ├── week-14.adoc ├── week-15.adoc ├── week-16.adoc ├── week-17.adoc ├── week-18.adoc ├── week-19.adoc ├── week-2.adoc ├── week-20.adoc ├── week-21.adoc ├── week-22.adoc ├── week-23.adoc ├── week-24.adoc ├── week-25-european-song-contest.adoc ├── week-26-goodreads.adoc ├── week-27-graphconnect-talks.adoc ├── week-28-graphconnect-audience.adoc ├── week-29-cybersecurity.adoc ├── week-3.adoc ├── week-30-airbnb-listings.adoc ├── week-31-london-underground.adoc ├── week-32-marvel-api-data.adoc ├── week-33-podcasts.adoc ├── week-34-citations.adoc ├── week-35-nodes-sessions.adoc ├── week-36-nodes-schedule-api-recommendations.adoc ├── week-36-nodes-schedule-recommendations.adoc ├── week-37-maston-api-graph.adoc ├── week-39-nobel-prizes.adoc ├── week-4.adoc ├── week-40-weather-api-data.adoc ├── week-43-hotel-reviews-bloom-spatial.adoc ├── week-44-git-logs.adoc ├── week-5.adoc ├── week-6.adoc ├── week-7.adoc ├── week-8.adoc └── week-9.adoc /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = Discover Neo4j Aura Free Live Stream 2 | :toclevels: 2 3 | :toc: macro 4 | :sectlinks: 5 | 6 | ==== 7 | *_More drama than a cat video! ((C) Mike on Twitch chat)_* 8 | ==== 9 | 10 | A repo with cypher and examples from the Discover *Neo4j Aura Free* https://twitch.tv/neo4j[Twitch stream^]. All streams will roughly follow the following format: 11 | 12 | * Review a data set 13 | * Decide what questions to ask from it 14 | * Put together an initial data model 15 | * Load the data into https://dev.neo4j.com/discover-aura[Neo4j Aura Free^] and query! 16 | 17 | Got a data set you'd like us to explore? Provided it's a public data set and can be accessed from a URI, let us know! Either raise an issue on the repo, or tweet @ellazal or @alexandererdl or @mesirii on Twitter. 18 | 19 | == Join us live for the stream! 20 | 21 | Every Monday alternating between 22 | 23 | * a "morning session" 8am UTC | 10am CET | 2:30pm IST | 5pm SGT 24 | * an "afternoon session" 10am ET | 3pm UTC | 4pm CET | 8:30pm IST | 7am PT (sorry) 25 | 26 | * https://twitch.tv/neo4j[On Twitch^] 27 | * https://youtube.com/neo4j/live[On YouTube^] 28 | 29 | Following along? Don't forget to get your https://dev.neo4j.com/discover-aura[*Free* Neo4j Aura instance^] up and running. 30 | 31 | == Previous episodes: 32 | 33 | ifdef::env-github[] 34 | * link:week-1.adoc[Week 1 - The NBA data set] 35 | * link:week-2.adoc[Week 2 - The Board Game Geek data set] 36 | * link:week-3.adoc[Week 3 - The Caruana - Carlsen Chess Game data set] 37 | * link:week-4.adoc[Week 4 - The Resonate music data api] 38 | * link:week-5.adoc[Week 5 - Rest areas across New York state data set] 39 | * link:week-6.adoc[Week 6 - New Zealand credit card spend data set] 40 | * link:week-7.adoc[Week 7 - Jungle of German Election Landscape] 41 | * link:week-8.adoc[Week 8 - StackOverflow] 42 | * link:week-9.adoc[Week 9 - GDelt Project] 43 | * link:week-10.adoc[Week 10 - Getting Dumps and Example Projects into Aura Free] 44 | * link:week-11.adoc[Week 11 - Importing and Querying Kickstarter Projects] 45 | * link:week-12.adoc[Week 12 - Importing Data from Relational Databases] 46 | * link:week-13.adoc[Week 13 - Exploring a Kaggle HR Attrition Dataset] 47 | * link:week-14.adoc[Week 14 - Consumer Complaints Database] 48 | * link:week-15.adoc[Week 15 - Hamilton Musical Graph] 49 | * link:week-16.adoc[Week 16 - CSV Data Importer Tool] 50 | * link:week-17.adoc[Week 17 - Analysing NFT Trades] 51 | * link:week-18.adoc[Week 18 - Week 18 - Importing gedcom files and exploring Genealogy/Ancestry data as a graph] 52 | * link:week-19.adoc[Week 19 - The Wordle Graph] 53 | endif::[] 54 | 55 | //// 56 | ifndef::env-github[] 57 | toc::[] 58 | :leveloffset: +1 59 | 60 | include::week-1.adoc[Week 1 - The NBA data set] 61 | include::week-2.adoc[Week 2 - The Board Game Geek data set] 62 | include::week-3.adoc[Week 3 - The Caruana - Carlsen Chess Game data set] 63 | include::week-4.adoc[Week 4 - The Resonate music data api] 64 | include::week-5.adoc[Week 5 - Rest areas across New York state data set] 65 | include::week-6.adoc[Week 6 - New Zealand credit card spend data set] 66 | include::week-7.adoc[Week 7 - Jungle of German Election Landscape] 67 | include::week-8.adoc[Week 8 - StackOverflow] 68 | include::week-9.adoc[Week 9 - GDelt Project] 69 | include::week-10.adoc[Week 10 - Getting Dumps and Example Projects into Aura Free] 70 | include::week-11.adoc[Week 11 - Importing and Querying Kickstarter Projects] 71 | include::week-12.adoc[Week 12 - Importing Data from Relational Databases] 72 | include::week-13.adoc[Week 13 - Exploring a Kaggle HR Attrition Dataset] 73 | include::week-14.adoc[Week 14 - Consumer Complaints Database] 74 | include::week-15.adoc[Week 15 - Hamilton Musical Graph] 75 | include::week-16.adoc[Week 16 - CSV Data Importer Tool] 76 | include::week-17.adoc[Week 17 - Analysing NFT Trades] 77 | include::week-18.adoc[Week 18 - Week 18 - Importing gedcom files and exploring Genealogy/Ancestry data as a graph] 78 | include::week-19.adoc[Week 19 - The Wordle Graph] 79 | 80 | endif::[] 81 | //// -------------------------------------------------------------------------------- /code/gedcom/gedcom2csv.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # usage: ./gedcom2csv.py file.ged > file.csv 3 | # https://pypi.org/project/python-gedcom/ 4 | import sys 5 | from gedcom.element.individual import IndividualElement 6 | from gedcom.parser import Parser 7 | 8 | file_path = sys.argv[1] 9 | gedcom_parser = Parser() 10 | gedcom_parser.parse_file(file_path) 11 | 12 | root_child_elements = gedcom_parser.get_root_child_elements() 13 | 14 | print("first,last,birth,death,gender,id,mother,father") 15 | root_child_elements = gedcom_parser.get_root_child_elements() 16 | for e in root_child_elements: 17 | if isinstance(e, IndividualElement): 18 | (first,last) = e.get_name() 19 | data = [first, last, str(e.get_birth_year()),str(e.get_death_year()),e.get_gender(),e.get_pointer()] 20 | parents = gedcom_parser.get_parents(e) 21 | data = data + ([p.get_pointer() for p in parents if p.get_gender() == 'F'] or ['']) 22 | data = data + ([p.get_pointer() for p in parents if p.get_gender() == 'M'] or ['']) 23 | print(",".join(data)) 24 | 25 | -------------------------------------------------------------------------------- /code/gedcom/gedcom2neo4j.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | # usage: NEO4J_URI="bolt://localhost" NEO4J_PASSWORD=secret ./gedcom2neo4j.py file.ged 3 | # https://pypi.org/project/python-gedcom/ 4 | # https://pypi.org/project/neo4j/ 5 | 6 | import sys 7 | import os 8 | from gedcom.element.individual import IndividualElement 9 | from gedcom.parser import Parser 10 | from neo4j import GraphDatabase 11 | 12 | driver = GraphDatabase.driver(os.getenv('NEO4J_URI'), auth=("neo4j", os.getenv('NEO4J_PASSWORD'))) 13 | 14 | file_path = sys.argv[1] 15 | gedcom_parser = Parser() 16 | gedcom_parser.parse_file(file_path) 17 | 18 | root_child_elements = gedcom_parser.get_root_child_elements() 19 | 20 | statement_w_cleanup = """ 21 | UNWIND $data as row 22 | MERGE (p:Person {id:row.id}) 23 | SET p += row {.first, .last,.sex, 24 | death: toInteger(row.death),birth:toInteger(row.birth)} 25 | SET p.name = p.first + ' ' + p.last 26 | MERGE (m:Person {id:coalesce(row.mother,'unknown')}) 27 | MERGE (p)-[:MOTHER]->(m) 28 | MERGE (f:Person {id:coalesce(row.father,'unknown')}) 29 | MERGE (p)-[:FATHER]->(f) 30 | WITH count(*) as total 31 | MATCH (d:Person {id:'unknown'}) 32 | DETACH DELETE d 33 | RETURN distinct total 34 | """ 35 | 36 | 37 | statement_conditional = """ 38 | UNWIND $data as row 39 | MERGE (p:Person {id:row.id}) 40 | SET p += row {.first, .last,.sex, 41 | death: toInteger(row.death),birth:toInteger(row.birth)} 42 | SET p.name = p.first + ' ' + p.last 43 | CALL { WITH row, p 44 | WITH * WHERE NOT coalesce(row.mother,'') = '' 45 | MERGE (m:Person {id:row.mother}) 46 | MERGE (p)-[:MOTHER]->(m) 47 | RETURN count(*) as mothers 48 | } 49 | CALL { WITH row, p 50 | WITH * WHERE NOT coalesce(row.father,'') = '' 51 | MERGE (f:Person {id:row.father}) 52 | MERGE (p)-[:FATHER]->(f) 53 | RETURN count(*) as fathers 54 | } 55 | RETURN count(*) AS total 56 | """ 57 | data = [] 58 | root_child_elements = gedcom_parser.get_root_child_elements() 59 | for e in root_child_elements: 60 | if isinstance(e, IndividualElement): 61 | (first,last) = e.get_name() 62 | row = {"first":first, "last":last} 63 | row["birth"]=e.get_birth_year() 64 | row["death"]=e.get_death_year() 65 | row["gender"]=e.get_gender() 66 | row["id"]=e.get_pointer() 67 | parents = gedcom_parser.get_parents(e) 68 | row["mother"]=next(iter([p.get_pointer() for p in parents if p.get_gender() == 'F']),None) 69 | row["father"]=next(iter([p.get_pointer() for p in parents if p.get_gender() == 'M']),None) 70 | data= data + [row] 71 | 72 | with driver.session() as session: 73 | total = session.write_transaction( 74 | lambda tx: tx.run(statement_w_cleanup, data = data).single()['total']) 75 | print("Entries added {total}".format(total=total)) 76 | 77 | -------------------------------------------------------------------------------- /code/nodes-neodash-dashboard.json: -------------------------------------------------------------------------------- 1 | { 2 | "title": "NODES 2022", 3 | "version": "2.1", 4 | "settings": { 5 | "pagenumber": 1, 6 | "editable": true, 7 | "fullscreenEnabled": true, 8 | "parameters": {} 9 | }, 10 | "pages": [ 11 | { 12 | "title": "Main Page", 13 | "reports": [ 14 | { 15 | "x": 6, 16 | "y": 0, 17 | "title": "Topics", 18 | "query": "MATCH (s:Session)-[:TOPIC]->(t:Topic)\nRETURN t.name as name, count(*) as c\nORDER BY name asc", 19 | "width": 4, 20 | "type": "bar", 21 | "height": 2, 22 | "selection": { 23 | "index": "name", 24 | "value": "c", 25 | "key": "(none)" 26 | }, 27 | "settings": { 28 | "nodePositions": {} 29 | } 30 | }, 31 | { 32 | "title": "Levels", 33 | "query": "MATCH (s:Session)-[:LEVEL]->(t:Level)\nRETURN t.name as name, count(*) as c\nORDER BY name asc\n\n\n", 34 | "width": 3, 35 | "height": 2, 36 | "x": 0, 37 | "y": 0, 38 | "type": "pie", 39 | "selection": { 40 | "index": "name", 41 | "value": "c", 42 | "key": "(none)" 43 | }, 44 | "settings": {} 45 | }, 46 | { 47 | "title": "Use-Cases", 48 | "query": "MATCH (s:Session)-[:TOPIC]->(t:Topic)\nRETURN t.name as name, count(*) as c\nORDER BY name asc\n\n\n", 49 | "width": 3, 50 | "height": 2, 51 | "x": 3, 52 | "y": 0, 53 | "type": "bar", 54 | "selection": { 55 | "index": "name", 56 | "value": "c", 57 | "key": "(none)" 58 | }, 59 | "settings": {} 60 | }, 61 | { 62 | "title": "Countries", 63 | "query": "MATCH (s:Session)-[:TIMEZONE]->(t:Timezone)\nRETURN t.country as country, count(*) as c\nORDER BY c desc\n\n\n", 64 | "width": 3, 65 | "height": 2, 66 | "x": 0, 67 | "y": 4, 68 | "type": "table", 69 | "selection": {}, 70 | "settings": {} 71 | }, 72 | { 73 | "title": "Timezones", 74 | "query": "MATCH (s:Speaker)-[:TIMEZONE]->(t:Timezone)\nWHERE t.tzLoc is not null\nRETURN t { label:\"Timezone\", id:id(t), .timezone, .tzLoc} as tz", 75 | "width": 3, 76 | "height": 2, 77 | "x": 3, 78 | "y": 2, 79 | "type": "map", 80 | "selection": { 81 | "Timezone": "name" 82 | }, 83 | "settings": { 84 | "layerType": "heatmap", 85 | "clusterMarkers": true, 86 | "defaultNodeSize": "medium" 87 | } 88 | }, 89 | { 90 | "title": "Speakers", 91 | "query": "MATCH (sp:Speaker)\nRETURN sp.fullName, sp.tagLine, sp.company, size((sp)-[:PRESENTS]->()) as sessions\norder by sessions desc\n\n", 92 | "width": 3, 93 | "height": 2, 94 | "x": 9, 95 | "y": 2, 96 | "type": "table", 97 | "selection": {}, 98 | "settings": {} 99 | }, 100 | { 101 | "title": "Talks", 102 | "query": "MATCH (s:Session)\nRETURn s.title, [(s)-[:LEVEL]->(l) |l.name] as levels, [(s)-[:TOPIC]->(l) |l.name] as topics\n\n", 103 | "width": 3, 104 | "height": 2, 105 | "x": 6, 106 | "y": 2, 107 | "type": "table", 108 | "selection": {}, 109 | "settings": {} 110 | }, 111 | { 112 | "title": "Submissions", 113 | "query": "MATCH (n:Session)\nRETURN count(*)\n\n", 114 | "width": 2, 115 | "height": 1, 116 | "x": 10, 117 | "y": 0, 118 | "type": "value", 119 | "selection": {}, 120 | "settings": {} 121 | }, 122 | { 123 | "title": "Speakers", 124 | "query": "MATCH (:Speaker)\nRETURN count(*)\n\n", 125 | "width": 2, 126 | "height": 1, 127 | "x": 10, 128 | "y": 1, 129 | "type": "value", 130 | "selection": {}, 131 | "settings": {} 132 | }, 133 | { 134 | "title": "Type", 135 | "query": "MATCH (s:Session)-[:FORMAT]->(f:Format)\nRETURN f.name, count(*)\n\n", 136 | "width": 3, 137 | "height": 2, 138 | "x": 0, 139 | "y": 2, 140 | "type": "pie", 141 | "selection": { 142 | "index": "f.name", 143 | "value": "count(*)", 144 | "key": "(none)" 145 | }, 146 | "settings": {} 147 | }, 148 | { 149 | "title": "Timezones", 150 | "query": "MATCH (t:Timezone)\nWITH t.offset as off, t.timezone as tz, count(*) as c\nWHERE c > 0\nWITH *\nORDER BY off ASC\nRETURN tz, c\n\n\n", 151 | "width": 3, 152 | "height": 2, 153 | "x": 3, 154 | "y": 4, 155 | "type": "bar", 156 | "selection": { 157 | "index": "tz", 158 | "value": "c", 159 | "key": "(none)" 160 | }, 161 | "settings": {} 162 | } 163 | ] 164 | }, 165 | { 166 | "title": "Discover NODES", 167 | "reports": [ 168 | { 169 | "title": "Session Count", 170 | "query": "MATCH (:Session)\nRETURN count(*)\n\n\n", 171 | "width": 2, 172 | "height": 1, 173 | "x": 0, 174 | "y": 0, 175 | "type": "value", 176 | "selection": {}, 177 | "settings": { 178 | "nodePositions": {} 179 | } 180 | }, 181 | { 182 | "title": "Session Titles and Speakers", 183 | "query": "MATCH (s:Session)<-[:PRESENTS]-(sp:Speaker)\nRETURn s.Title as session, collect(sp.FirstName + \" \" + sp.LastName) as speakers\n\n\n", 184 | "width": 3, 185 | "height": 2, 186 | "x": 2, 187 | "y": 0, 188 | "type": "table", 189 | "selection": {}, 190 | "settings": { 191 | "nodePositions": {} 192 | } 193 | }, 194 | { 195 | "title": "Topics", 196 | "query": "MATCH (t:Topic)<-[:HAS_TOPIC]-(s:Session)\nRETURN t.name as name, count(*) as c\nORDER BY c DESC\n\n\n", 197 | "width": 3, 198 | "height": 2, 199 | "x": 5, 200 | "y": 0, 201 | "type": "bar", 202 | "selection": { 203 | "index": "name", 204 | "value": "c", 205 | "key": "(none)" 206 | }, 207 | "settings": { 208 | "nodePositions": {} 209 | } 210 | }, 211 | { 212 | "title": "Levels", 213 | "query": "MATCH (s:Session)-[:OF_LEVEL]->(l:Level)\nRETURN l.name, count(*)\n\n", 214 | "width": 3, 215 | "height": 2, 216 | "x": 8, 217 | "y": 0, 218 | "type": "pie", 219 | "selection": { 220 | "index": "l.name", 221 | "value": "count(*)", 222 | "key": "(none)" 223 | }, 224 | "settings": { 225 | "nodePositions": {} 226 | } 227 | }, 228 | { 229 | "title": "Map of Speakers", 230 | "query": "MATCH (sp:Speaker)\nWHERE sp.location is not null\nRETURN sp\n\n\n", 231 | "width": 3, 232 | "height": 2, 233 | "x": 0, 234 | "y": 2, 235 | "type": "map", 236 | "selection": { 237 | "Speaker": "FirstName" 238 | }, 239 | "settings": { 240 | "nodePositions": {} 241 | } 242 | }, 243 | { 244 | "title": "Description", 245 | "query": "This is a Dashboard of the accepted NODES sessions.\n\n\n", 246 | "width": 2, 247 | "height": 1, 248 | "x": 0, 249 | "y": 1, 250 | "type": "text", 251 | "selection": {}, 252 | "settings": { 253 | "nodePositions": {} 254 | } 255 | }, 256 | { 257 | "title": "", 258 | "query": "match p=()-->() return p limit 100", 259 | "width": 3, 260 | "height": 2, 261 | "x": 3, 262 | "y": 2, 263 | "type": "graph", 264 | "selection": { 265 | "Session": "(label)", 266 | "Topic": "name", 267 | "UseCase": "name", 268 | "Level": "name" 269 | }, 270 | "settings": { 271 | "nodePositions": {} 272 | } 273 | } 274 | ] 275 | } 276 | ], 277 | "parameters": {} 278 | } -------------------------------------------------------------------------------- /connect-aura.adoc: -------------------------------------------------------------------------------- 1 | == Create a Neo4j AuraDB Free Instance 2 | :imagesdir: img 3 | 4 | Go to https://dev.neo4j.com/neo4j-aura to register or log into the service (you might need to verify your email address). 5 | 6 | // image::aura-create.png[] 7 | 8 | After clicking `Create Database` you can create a new *Neo4j AuraDB Free* instance. 9 | 10 | Choose the "Empty Instance" option as we want to import our data ourselves. 11 | 12 | image::aura-create-free.png[] 13 | 14 | On the Credentials popup, make sure to save the password somewhere safe, best is to download the credentials file, which you can also use for your app development. 15 | 16 | The default username is always `neo4j`. 17 | 18 | image::aura-credentials.png[width=400] 19 | 20 | Then wait 2-3 minutes for your instance to be created. 21 | 22 | Afterwards you can connect via the "Open" Button with Workspace (you'll need the password), which offers the "Import" (Data Importer), "Explore" (Neo4j Bloom) and "Query" (Neo4j Browser) tabs to work with your data. 23 | 24 | On the database tile you can also find the connection URL: `neo4j+s://xxx.databases.neo4j.io` (it is also contained in your credentials env file). 25 | 26 | image::aura-workspace.png[] 27 | 28 | If you want to see examples for programmatically connecting to the database go to the "Connect" tab of your instance and pick the language of your choice 29 | 30 | image::aura-connect.png[] 31 | -------------------------------------------------------------------------------- /data/99-invisible.json: -------------------------------------------------------------------------------- 1 | {"type":"series","id":116582,"slug":"99-invisible","access":"public","currentURL":"http://feeds.99percentinvisible.org/99percentinvisible/","url":"http://feeds.99percentinvisible.org/99percentinvisible/","author":"Roman Mars","updatedAt":1637809373,"descriptionFingerprint":"AyHLGjcDj1JxgmfZNtN8kXy8BQmP9CUvQCMc1ufo6Jw","title":"99% Invisible","home":"http://99percentinvisible.org","language":"en","imageURL":"http://cdn-99percentinvisible.prx.org/wp-content/uploads/powerpress/99-1400.png","fetch":{"status":"ok","confidence":3},"archived":{"at":1488121136,"reason":"manual","replacement":{"type":"series","id":8452,"slug":"ninety-nine-percent-invisible","title":"99% Invisible","image":{"type":"image","id":22731,"url":"https://image.simplecastcdn.com/images/5b7d8c77-15ba-4eff-a999-2e725db21db5/c43e134f-15e6-41ae-9a2e-5e57cf761473/3000x3000/stitcher-cover-99percentinvisible-3000x3000-r2021-final.jpg?aid=rss_feed","urlBase":"https://cdn.player.fm/images/22731/series/J7gyATAyUCGIuphf","palette":["f6dc18","4f4d42"],"suffix":"jpg"},"backgroundColor":"#D81422","network":{"name":"Roman Mars"},"tags":[{"type":"tag","id":268,"title":"Architecture","rawTitle":"architectur","language":"en","polar":0.7,"topic":{"id":806,"owner":{"id":3},"title":"Architecture"},"ancestors":null,"series":{"amount":458,"centile":0.982},"sources":["featured"]},{"type":"tag","id":38,"title":"Society","rawTitle":"societi","language":"en","polar":0.7,"topic":{"id":691,"owner":{"id":3},"title":"Society"},"ancestors":null,"series":{"amount":151771,"centile":1.0},"sources":["featured"]},{"type":"tag","id":7357,"title":"Architecture Education","rawTitle":"architectur-educ","shortTitle":"Architecture Edu","language":"en","polar":0.7,"topic":{"id":1695738,"owner":{"id":3},"title":"Architecture Education"},"ancestors":null,"series":{"amount":5,"centile":0.09},"sources":["featured"]},{"type":"tag","id":5283,"title":"Business Education","rawTitle":"busi-educ","shortTitle":"Business Edu","language":"en","polar":0.7,"topic":{"id":932128,"owner":{"id":3},"title":"Business Education"},"ancestors":null,"series":{"amount":115,"centile":0.941},"sources":["featured"]},{"type":"tag","id":982,"title":"Graphic Design","rawTitle":"graphic-design","language":"en","polar":0.7,"topic":{"id":6595997,"owner":{"id":3},"title":"Graphic Design"},"ancestors":null,"series":{"amount":4649,"centile":0.99},"sources":["categories"]},{"type":"tag","id":770915,"title":"Roman Mars","rawTitle":"roman-mar","language":"en","polar":0.5,"sources":["owner"]},{"type":"tag","id":774122,"title":"99 Invisible","rawTitle":"99-invis","language":"en","polar":0.5,"sources":["inferred"]},{"type":"tag","id":51,"title":"Arts","rawTitle":"art","language":"en","polar":0.7,"topic":{"id":932125,"owner":{"id":3},"title":"Arts"},"ancestors":null,"series":{"amount":87136,"centile":0.996},"sources":["featured"]},{"type":"tag","id":1,"title":"Podcasting Education","rawTitle":"educ","language":"en","polar":0.7,"topic":{"id":1695787,"owner":{"id":3},"title":"Podcasting Education"},"ancestors":null,"series":{"amount":97180,"centile":0.996},"sources":["featured"]}]}},"fetchStatus":"ok","lookup":"https://player.fm/series/116582.json","latestLookup":"https://player.fm/series/116582/at/1637809373.json","relatedLookup":"https://player.fm/related-to/99-invisible.json","share":"https://player.fm/series/99-invisible","stats":{"numberOfSubscriptions":17,"numberOfEpisodes":264,"averageDuration":null,"averageInterval":896,"earliestPublishedAt":1285275921,"latestPublishedAt":1487715093,"manualSubscriptionsCentile":0.055,"shortTrendCentile":0.0,"longTrendCentile":0.0},"tags":[{"type":"tag","id":51,"title":"Arts","rawTitle":"art","language":"en","polar":0.7,"topic":{"id":932125,"owner":{"id":3},"title":"Arts"},"ancestors":null,"series":{"amount":87136,"centile":0.996},"sources":["categories"]},{"type":"tag","id":982,"title":"Graphic Design","rawTitle":"graphic-design","language":"en","polar":0.7,"topic":{"id":6595997,"owner":{"id":3},"title":"Graphic Design"},"ancestors":null,"series":{"amount":4649,"centile":0.99},"sources":["categories"]},{"type":"tag","id":6624,"title":"United States","rawTitle":"unit-state","language":"en","polar":0.5,"sources":["inferred"]}],"image":{"type":"image","id":1048062,"url":"http://cdn-99percentinvisible.prx.org/wp-content/uploads/powerpress/99-1400.png","urlBase":"https://cdn.player.fm/images/1048062/series/QPH5gr66IvZ5i3Lk","palette":["fedb00","0a0900"],"suffix":"png"},"description":"Design is everywhere in our lives, perhaps most importantly in the places where we’ve just stopped noticing. 99% Invisible is a weekly exploration of the process and power of design and architecture. From award winning producer Roman Mars. Learn more at 99percentinvisible.org.
A proud member of Radiotopia, from PRX. Learn more at radiotopia.fm.","subtitle":"A tiny radio show about design, architecture & the 99% invisible activity that shapes our world.","backgroundColor":"#D81422","network":{"name":null},"versionInfo":"1.1.0"} -------------------------------------------------------------------------------- /data/data-importer-gc-schedule.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/data/data-importer-gc-schedule.zip -------------------------------------------------------------------------------- /data/data-importer-goodreads-small.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/data/data-importer-goodreads-small.zip -------------------------------------------------------------------------------- /data/data-importer-nft-2021-01-01.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/data/data-importer-nft-2021-01-01.zip -------------------------------------------------------------------------------- /data/esc/esc-2021.csv: -------------------------------------------------------------------------------- 1 | from,to,total,jury,public 2 | al,rs,1,1,0 3 | al,se,1,0,1 4 | at,no,1,0,1 5 | au,no,1,0,1 6 | au,ru,1,1,0 7 | az,bg,1,1,0 8 | be,no,1,0,1 9 | be,pt,1,1,0 10 | bg,se,1,0,1 11 | cy,pt,1,1,0 12 | cz,lt,1,0,1 13 | de,no,1,0,1 14 | dk,il,1,1,0 15 | dk,ua,1,0,1 16 | ee,mt,1,1,0 17 | ee,se,1,0,1 18 | es,gr,1,1,0 19 | fi,mt,1,1,0 20 | fr,fi,1,0,1 21 | gb,be,1,1,0 22 | ge,mt,1,1,0 23 | hr,al,1,0,1 24 | hr,pt,1,1,0 25 | ie,bg,1,1,0 26 | ie,se,1,0,1 27 | il,bg,1,1,0 28 | il,is,1,0,1 29 | is,no,1,0,1 30 | lt,il,1,1,0 31 | lt,se,1,0,1 32 | lv,se,1,0,1 33 | md,cy,1,1,0 34 | mt,sm,1,1,0 35 | nl,al,1,1,0 36 | no,az,1,0,1 37 | no,gr,1,1,0 38 | pl,se,1,0,1 39 | pt,nl,1,1,0 40 | ro,de,1,1,0 41 | ro,il,1,0,1 42 | ru,is,1,0,1 43 | se,be,1,1,0 44 | se,rs,1,0,1 45 | si,il,1,1,0 46 | sm,ru,1,0,1 47 | ua,no,1,1,0 48 | al,az,2,2,0 49 | at,de,2,2,0 50 | au,bg,2,2,0 51 | au,rs,2,0,2 52 | az,pt,2,2,0 53 | bg,nl,2,2,0 54 | ch,az,2,2,0 55 | ch,ua,2,0,2 56 | cy,ch,2,2,0 57 | cy,il,2,0,2 58 | es,fi,2,0,2 59 | fi,gr,2,2,0 60 | fi,md,2,0,2 61 | fr,cy,2,2,0 62 | gb,es,2,2,0 63 | gb,no,2,0,2 64 | ge,md,2,0,2 65 | ge,nl,2,2,0 66 | gr,az,2,0,2 67 | hr,az,2,0,2 68 | hr,lt,2,2,0 69 | ie,az,2,2,0 70 | ie,pt,2,0,2 71 | is,ru,2,2,0 72 | it,md,2,0,2 73 | it,no,2,2,0 74 | lt,bg,2,2,0 75 | lv,mt,2,2,0 76 | lv,no,2,0,2 77 | md,lt,2,0,2 78 | md,pt,2,2,0 79 | mk,fi,2,0,2 80 | mk,ru,2,1,1 81 | nl,az,2,2,0 82 | nl,it,2,0,2 83 | pt,gr,2,0,2 84 | ro,bg,2,2,0 85 | rs,ch,2,1,1 86 | rs,cy,2,0,2 87 | rs,il,2,2,0 88 | ru,lt,2,0,2 89 | si,no,2,0,2 90 | sm,al,2,2,0 91 | ua,pt,2,2,0 92 | ua,se,2,0,2 93 | at,lt,3,0,3 94 | at,nl,3,3,0 95 | au,fi,3,0,3 96 | au,nl,3,3,0 97 | az,be,3,3,0 98 | az,sm,3,0,3 99 | bg,ch,3,0,3 100 | bg,il,3,3,0 101 | ch,ru,3,3,0 102 | ch,se,3,0,3 103 | cz,be,3,3,0 104 | de,rs,3,0,3 105 | dk,fr,3,0,3 106 | es,il,3,3,0 107 | fr,rs,3,0,3 108 | fr,se,3,1,2 109 | gb,it,3,0,3 110 | gb,sm,3,3,0 111 | gr,be,3,3,0 112 | gr,ru,3,2,1 113 | hr,mt,3,3,0 114 | ie,be,3,3,0 115 | il,cy,3,3,0 116 | it,sm,3,0,3 117 | lt,mt,3,3,0 118 | md,se,3,0,3 119 | mk,az,3,0,3 120 | mk,se,3,3,0 121 | nl,lt,3,0,3 122 | pl,be,3,3,0 123 | pl,no,3,0,3 124 | pl,ru,3,1,2 125 | ro,lt,3,0,3 126 | ru,be,3,3,0 127 | se,ru,3,3,0 128 | al,ua,4,0,4 129 | au,cy,4,4,0 130 | az,ch,4,0,4 131 | bg,az,4,0,4 132 | bg,es,4,4,0 133 | cy,be,4,4,0 134 | cz,bg,4,4,0 135 | de,se,4,4,0 136 | dk,lt,4,0,4 137 | ee,no,4,0,4 138 | fi,no,4,0,4 139 | fr,sm,4,4,0 140 | gb,ua,4,0,4 141 | ge,bg,4,4,0 142 | ge,ru,4,0,4 143 | gr,ch,4,0,4 144 | il,az,4,2,2 145 | il,fi,4,0,4 146 | is,gr,4,4,0 147 | is,lt,4,0,4 148 | is,mt,4,1,3 149 | it,fr,4,3,1 150 | it,il,4,4,0 151 | it,rs,4,0,4 152 | lt,ru,4,0,4 153 | mk,is,4,4,0 154 | mk,ua,4,0,4 155 | mt,rs,4,0,4 156 | nl,fi,4,0,4 157 | nl,il,4,4,0 158 | pl,lt,4,0,4 159 | pl,mt,4,4,0 160 | pt,mt,4,4,0 161 | pt,se,4,0,4 162 | ro,az,4,0,4 163 | rs,az,4,0,4 164 | rs,se,4,4,0 165 | ru,mt,4,4,0 166 | se,il,4,4,0 167 | ua,ru,4,0,4 168 | al,bg,5,0,5 169 | al,sm,5,5,0 170 | at,bg,5,5,0 171 | at,fi,5,1,4 172 | az,fi,5,0,5 173 | az,se,5,5,0 174 | bg,mt,5,5,0 175 | bg,rs,5,0,5 176 | ch,fi,5,1,4 177 | ch,lt,5,4,1 178 | cy,lt,5,0,5 179 | cz,fi,5,1,4 180 | dk,it,5,0,5 181 | dk,sm,5,5,0 182 | ee,pt,5,5,0 183 | fi,ru,5,4,1 184 | ge,fr,5,0,5 185 | hr,il,5,5,0 186 | ie,fi,5,0,5 187 | it,be,5,5,0 188 | lt,no,5,0,5 189 | lv,bg,5,5,0 190 | md,fi,5,0,5 191 | md,is,5,5,0 192 | mk,mt,5,5,0 193 | mt,is,5,0,5 194 | pl,fr,5,0,5 195 | pt,be,5,5,0 196 | pt,fi,5,0,5 197 | rs,pt,5,5,0 198 | ru,il,5,5,0 199 | si,mt,5,5,0 200 | sm,bg,5,3,2 201 | sm,fi,5,1,4 202 | sm,ua,5,0,5 203 | ua,mt,5,5,0 204 | al,fi,6,3,3 205 | at,mt,6,4,2 206 | au,lt,6,0,6 207 | az,fr,6,4,2 208 | be,bg,6,6,0 209 | bg,pt,6,6,0 210 | bg,ua,6,0,6 211 | ch,mt,6,6,0 212 | cy,ua,6,0,6 213 | dk,bg,6,6,0 214 | dk,mt,6,4,2 215 | ee,bg,6,6,0 216 | ee,ru,6,0,6 217 | es,cy,6,6,0 218 | es,lt,6,2,4 219 | es,pt,6,5,1 220 | es,ua,6,0,6 221 | fr,be,6,6,0 222 | gb,il,6,6,0 223 | gb,mt,6,0,6 224 | gr,fi,6,0,6 225 | gr,ua,6,1,5 226 | hr,fi,6,0,6 227 | ie,it,6,0,6 228 | il,be,6,6,0 229 | it,pt,6,6,0 230 | lt,pt,6,6,0 231 | lv,fr,6,3,3 232 | mt,cy,6,4,2 233 | mt,fr,6,3,3 234 | mt,gr,6,6,0 235 | mt,lt,6,0,6 236 | mt,ua,6,5,1 237 | nl,be,6,6,0 238 | nl,pt,6,0,6 239 | no,bg,6,6,0 240 | no,fi,6,0,6 241 | pl,il,6,6,0 242 | rs,bg,6,6,0 243 | rs,gr,6,3,3 244 | rs,ru,6,0,6 245 | ru,bg,6,6,0 246 | ru,ch,6,1,5 247 | ru,fr,6,0,6 248 | si,be,6,6,0 249 | sm,lt,6,6,0 250 | ua,az,6,3,3 251 | al,md,7,0,7 252 | at,pt,7,7,0 253 | at,ua,7,0,7 254 | az,mt,7,7,0 255 | az,no,7,0,7 256 | be,lt,7,0,7 257 | be,mt,7,5,2 258 | be,ru,7,7,0 259 | be,se,7,4,3 260 | bg,ru,7,0,7 261 | ch,al,7,0,7 262 | cy,fi,7,3,4 263 | cz,mt,7,7,0 264 | cz,ru,7,2,5 265 | de,cy,7,7,0 266 | de,ru,7,2,5 267 | dk,al,7,7,0 268 | fr,is,7,3,4 269 | fr,md,7,0,7 270 | gb,pt,7,7,0 271 | ge,is,7,6,1 272 | ge,sm,7,0,7 273 | gr,al,7,0,7 274 | gr,sm,7,7,0 275 | hr,ru,7,4,3 276 | ie,no,7,7,0 277 | il,it,7,0,7 278 | it,mt,7,7,0 279 | it,ru,7,0,7 280 | lt,fi,7,0,7 281 | lt,is,7,4,3 282 | md,az,7,6,1 283 | md,ch,7,3,4 284 | md,mt,7,7,0 285 | mt,pt,7,7,0 286 | ru,gr,7,7,0 287 | ru,ua,7,0,7 288 | se,lt,7,0,7 289 | si,ua,7,0,7 290 | sm,ch,7,4,3 291 | sm,mt,7,7,0 292 | ua,be,7,6,1 293 | ua,il,7,7,0 294 | al,mt,8,8,0 295 | be,is,8,3,5 296 | cz,ch,8,5,3 297 | cz,gr,8,0,8 298 | de,fi,8,0,8 299 | de,mt,8,8,0 300 | fi,lt,8,3,5 301 | fi,se,8,5,3 302 | ge,az,8,5,3 303 | ge,pt,8,8,0 304 | gr,bg,8,8,0 305 | hr,ua,8,0,8 306 | ie,ch,8,5,3 307 | is,bg,8,8,0 308 | md,it,8,0,8 309 | mk,cy,8,2,6 310 | mk,il,8,8,0 311 | nl,mt,8,7,1 312 | nl,ru,8,8,0 313 | nl,ua,8,3,5 314 | no,fr,8,4,4 315 | no,il,8,8,0 316 | no,ua,8,3,5 317 | pl,fi,8,2,6 318 | pl,pt,8,8,0 319 | pt,md,8,0,8 320 | rs,ua,8,0,8 321 | ru,fi,8,0,8 322 | si,fi,8,4,4 323 | si,fr,8,2,6 324 | sm,cy,8,0,8 325 | ua,fi,8,0,8 326 | al,cy,9,7,2 327 | az,md,9,8,1 328 | bg,fi,9,1,8 329 | cy,ru,9,6,3 330 | de,is,9,3,6 331 | de,ua,9,5,4 332 | ee,ua,9,4,5 333 | gb,ch,9,8,1 334 | gr,mt,9,6,3 335 | lt,be,9,7,2 336 | mt,fi,9,2,7 337 | no,ch,9,7,2 338 | si,ru,9,8,1 339 | az,gr,10,10,0 340 | az,it,10,0,10 341 | be,it,10,2,8 342 | bg,gr,10,8,2 343 | ch,bg,10,10,0 344 | ch,is,10,5,5 345 | cz,ua,10,0,10 346 | es,it,10,0,10 347 | fi,bg,10,10,0 348 | fi,ua,10,0,10 349 | fr,il,10,5,5 350 | fr,it,10,0,10 351 | fr,ru,10,10,0 352 | ge,ch,10,10,0 353 | gr,md,10,10,0 354 | il,mt,10,5,5 355 | is,se,10,0,10 356 | it,al,10,0,10 357 | md,fr,10,4,6 358 | md,ua,10,0,10 359 | mk,al,10,0,10 360 | mt,ch,10,10,0 361 | mt,no,10,0,10 362 | nl,gr,10,0,10 363 | pt,it,10,3,7 364 | ro,pt,10,10,0 365 | se,ch,10,5,5 366 | se,no,10,2,8 367 | ua,is,10,4,6 368 | ua,lt,10,0,10 369 | au,fr,11,7,4 370 | cy,mt,11,10,1 371 | dk,no,11,3,8 372 | ee,is,11,8,3 373 | ee,it,11,3,8 374 | es,mt,11,8,3 375 | gb,fi,11,4,7 376 | is,ua,11,3,8 377 | lv,ru,11,1,10 378 | pt,is,11,8,3 379 | pt,ru,11,10,1 380 | si,gr,11,3,8 381 | sm,md,11,5,6 382 | at,rs,12,0,12 383 | az,il,12,0,12 384 | be,fr,12,0,12 385 | bg,md,12,12,0 386 | ch,rs,12,0,12 387 | cy,bg,12,5,7 388 | cz,fr,12,10,2 389 | cz,it,12,6,6 390 | cz,md,12,0,12 391 | cz,pt,12,12,0 392 | de,ch,12,10,2 393 | dk,se,12,2,10 394 | ee,lt,12,2,10 395 | es,bg,12,4,8 396 | es,is,12,7,5 397 | fr,gr,12,12,0 398 | fr,ua,12,0,12 399 | gb,lt,12,0,12 400 | ge,gr,12,0,12 401 | is,it,12,7,5 402 | is,pt,12,10,2 403 | lv,fi,12,4,8 404 | md,bg,12,12,0 405 | mk,fr,12,7,5 406 | mt,al,12,12,0 407 | mt,it,12,0,12 408 | nl,ch,12,5,7 409 | no,is,12,2,10 410 | no,it,12,5,7 411 | no,lt,12,0,12 412 | pl,sm,12,12,0 413 | pl,ua,12,0,12 414 | pt,bg,12,12,0 415 | pt,ua,12,2,10 416 | ro,ch,12,7,5 417 | ro,fr,12,4,8 418 | ro,ua,12,5,7 419 | rs,is,12,7,5 420 | ru,az,12,8,4 421 | se,fi,12,0,12 422 | se,fr,12,6,6 423 | se,ua,12,8,4 424 | si,ch,12,7,5 425 | si,rs,12,0,12 426 | au,it,13,6,7 427 | de,it,13,6,7 428 | de,lt,13,1,12 429 | fi,fr,13,7,6 430 | fr,ch,13,7,6 431 | gb,bg,13,5,8 432 | ge,lt,13,3,10 433 | ge,ua,13,7,6 434 | gr,fr,13,5,8 435 | hr,ch,13,8,5 436 | hr,fr,13,6,7 437 | il,lt,13,10,3 438 | is,fr,13,6,7 439 | it,ua,13,1,12 440 | lt,fr,13,5,8 441 | lv,ua,13,7,6 442 | mk,ch,13,6,7 443 | pt,ch,13,7,6 444 | ro,it,13,3,10 445 | se,it,13,10,3 446 | si,is,13,10,3 447 | al,gr,14,6,8 448 | al,it,14,4,10 449 | at,fr,14,8,6 450 | at,it,14,6,8 451 | az,ua,14,6,8 452 | be,fi,14,8,6 453 | ee,ch,14,12,2 454 | fi,it,14,6,8 455 | gr,it,14,4,10 456 | hr,is,14,10,4 457 | ie,mt,14,10,4 458 | ie,ua,14,6,8 459 | it,is,14,8,6 460 | lt,ch,14,8,6 461 | pl,ch,14,7,7 462 | ro,fi,14,8,6 463 | ro,mt,14,12,2 464 | ru,cy,14,2,12 465 | se,mt,14,12,2 466 | at,ch,15,10,5 467 | au,ch,15,10,5 468 | au,ua,15,5,10 469 | ch,pt,15,7,8 470 | cy,fr,15,7,8 471 | cz,is,15,8,7 472 | dk,fi,15,8,7 473 | lv,is,15,10,5 474 | lv,it,15,8,7 475 | md,gr,15,8,7 476 | no,mt,15,12,3 477 | pl,it,15,5,10 478 | ru,md,15,12,3 479 | sm,gr,15,8,7 480 | ua,ch,15,8,7 481 | ua,fr,15,10,5 482 | al,fr,16,10,6 483 | be,ch,16,12,4 484 | fr,pt,16,8,8 485 | ie,lt,16,4,12 486 | il,fr,16,8,8 487 | il,ua,16,4,12 488 | lv,ch,16,12,4 489 | mt,se,16,8,8 490 | bg,fr,17,7,10 491 | ee,fr,17,10,7 492 | es,ch,17,10,7 493 | gb,fr,17,12,5 494 | il,ru,17,7,10 495 | is,fi,17,5,12 496 | it,lt,17,12,5 497 | rs,fi,17,10,7 498 | se,is,17,7,10 499 | az,ru,18,12,6 500 | ch,fr,18,12,6 501 | ch,it,18,8,10 502 | cy,it,18,8,10 503 | dk,ch,18,12,6 504 | ie,is,18,8,10 505 | il,ch,18,12,6 506 | is,ch,18,12,6 507 | it,fi,18,10,8 508 | lv,lt,18,6,12 509 | mk,it,18,10,8 510 | nl,is,18,10,8 511 | no,se,18,10,8 512 | pl,is,18,10,8 513 | pt,fr,18,6,12 514 | ro,md,18,6,12 515 | ee,fi,19,7,12 516 | fi,ch,19,12,7 517 | hr,rs,19,7,12 518 | ie,fr,19,12,7 519 | au,is,20,8,12 520 | au,mt,20,12,8 521 | be,ua,20,10,10 522 | fi,is,20,8,12 523 | gb,is,20,10,10 524 | ge,it,20,12,8 525 | lt,it,20,10,10 526 | rs,it,20,8,12 527 | ru,it,20,10,10 528 | at,is,22,12,10 529 | bg,it,22,10,12 530 | de,fr,22,12,10 531 | dk,is,22,10,12 532 | hr,it,22,12,10 533 | md,ru,22,10,12 534 | rs,fr,22,12,10 535 | si,it,22,12,10 536 | sm,fr,22,12,10 537 | sm,it,22,10,12 538 | al,ch,24,12,12 539 | cy,gr,24,12,12 540 | es,fr,24,12,12 541 | gr,cy,24,12,12 542 | lt,ua,24,12,12 543 | mk,rs,24,12,12 544 | nl,fr,24,12,12 545 | ua,it,24,12,12 -------------------------------------------------------------------------------- /data/esc/esc-2022.csv: -------------------------------------------------------------------------------- 1 | from,to,total,jury,public 2 | al,md,1,0,1 3 | al,pt,1,1,0 4 | am,gb,1,0,1 5 | at,ch,1,1,0 6 | au,ee,1,1,0 7 | az,fr,1,1,0 8 | be,au,1,1,0 9 | ch,no,1,1,0 10 | ch,pl,1,0,1 11 | cy,am,1,0,1 12 | cz,au,1,1,0 13 | cz,fi,1,0,1 14 | de,ro,1,1,0 15 | ee,es,1,0,1 16 | es,ch,1,1,0 17 | es,pl,1,0,1 18 | fi,am,1,1,0 19 | fi,fr,1,0,1 20 | fr,ro,1,0,1 21 | ge,fr,1,1,0 22 | gr,fr,1,0,1 23 | hr,ch,1,1,0 24 | hr,fr,1,0,1 25 | ie,is,1,1,0 26 | is,rs,1,0,1 27 | it,fi,1,1,0 28 | it,pt,1,0,1 29 | lt,rs,1,1,0 30 | lv,fi,1,0,1 31 | md,az,1,1,0 32 | me,az,1,1,0 33 | mk,ch,1,1,0 34 | mk,lt,1,0,1 35 | mt,fi,1,0,1 36 | mt,gr,1,1,0 37 | nl,ee,1,0,1 38 | no,ch,1,1,0 39 | pt,am,1,1,0 40 | ro,fr,1,0,1 41 | rs,gb,1,1,0 42 | se,be,1,1,0 43 | se,nl,1,0,1 44 | sm,ch,1,1,0 45 | sm,ro,1,0,1 46 | ua,cz,1,1,0 47 | ua,es,1,0,1 48 | al,be,2,2,0 49 | al,fi,2,0,2 50 | am,lt,2,0,2 51 | at,de,2,0,2 52 | au,az,2,2,0 53 | au,lt,2,0,2 54 | az,au,2,0,2 55 | be,cz,2,2,0 56 | ch,de,2,0,2 57 | cy,be,2,2,0 58 | cy,lt,2,0,2 59 | de,ch,2,2,0 60 | dk,ch,2,2,0 61 | ee,de,2,0,2 62 | es,gr,2,2,0 63 | fi,it,2,2,0 64 | fi,lt,2,0,2 65 | fr,cz,2,2,0 66 | gb,ch,2,2,0 67 | gb,rs,2,1,1 68 | ge,fi,2,0,2 69 | ge,pl,2,2,0 70 | gr,cz,2,2,0 71 | hr,ee,2,0,2 72 | hr,nl,2,2,0 73 | ie,au,2,2,0 74 | ie,ro,2,0,2 75 | il,cz,2,2,0 76 | is,cz,2,2,0 77 | it,au,2,2,0 78 | lt,is,2,2,0 79 | lt,no,2,0,2 80 | lv,au,2,2,0 81 | lv,rs,2,0,2 82 | md,fr,2,0,2 83 | md,pt,2,2,0 84 | me,lt,2,2,0 85 | me,no,2,0,2 86 | mk,no,2,0,2 87 | mk,pl,2,2,0 88 | mt,az,2,2,0 89 | no,ee,2,0,2 90 | pl,gr,2,2,0 91 | pl,lt,2,0,2 92 | pt,ch,2,2,0 93 | pt,no,2,0,2 94 | ro,gr,2,2,0 95 | ro,no,2,0,2 96 | rs,fr,2,0,2 97 | se,am,2,2,0 98 | si,gb,2,2,0 99 | sm,no,2,0,2 100 | ua,am,2,2,0 101 | ua,no,2,0,2 102 | al,az,3,3,0 103 | al,rs,3,0,3 104 | at,es,3,2,1 105 | au,pl,3,0,3 106 | az,pl,3,2,1 107 | be,az,3,3,0 108 | bg,az,3,3,0 109 | bg,it,3,1,2 110 | bg,no,3,2,1 111 | cy,pl,3,0,3 112 | cz,gr,3,3,0 113 | de,it,3,0,3 114 | dk,ee,3,0,3 115 | dk,is,3,1,2 116 | ee,az,3,3,0 117 | es,no,3,0,3 118 | fi,az,3,3,0 119 | fi,es,3,0,3 120 | fr,gr,3,3,0 121 | fr,it,3,0,3 122 | gb,pt,3,3,0 123 | gb,ro,3,0,3 124 | ge,az,3,0,3 125 | gr,pt,3,3,0 126 | hr,gr,3,3,0 127 | il,nl,3,1,2 128 | is,lt,3,1,2 129 | it,ch,3,3,0 130 | it,pl,3,0,3 131 | lv,ch,3,3,0 132 | me,ee,3,0,3 133 | me,nl,3,3,0 134 | mk,be,3,3,0 135 | mk,ee,3,0,3 136 | mt,cz,3,3,0 137 | mt,ro,3,0,3 138 | nl,rs,3,0,3 139 | nl,se,3,1,2 140 | no,rs,3,0,3 141 | pl,nl,3,3,0 142 | pt,it,3,0,3 143 | ro,nl,3,3,0 144 | rs,cz,3,3,0 145 | se,lt,3,0,3 146 | si,no,3,0,3 147 | si,pt,3,3,0 148 | ua,au,3,3,0 149 | al,am,4,4,0 150 | am,nl,4,4,0 151 | at,gr,4,4,0 152 | at,pl,4,0,4 153 | au,cz,4,4,0 154 | au,it,4,3,1 155 | au,md,4,0,4 156 | az,nl,4,4,0 157 | bg,pt,4,4,0 158 | bg,ro,4,0,4 159 | ch,au,4,4,0 160 | ch,md,4,0,4 161 | cy,ro,4,0,4 162 | de,no,4,3,1 163 | dk,pl,4,0,4 164 | ee,nl,4,1,3 165 | ee,no,4,0,4 166 | es,pt,4,0,4 167 | fr,nl,4,4,0 168 | gb,gr,4,4,0 169 | ge,gr,4,3,1 170 | ge,nl,4,4,0 171 | gr,nl,4,4,0 172 | gr,se,4,0,4 173 | ie,no,4,0,4 174 | ie,pt,4,4,0 175 | il,be,4,4,0 176 | il,no,4,0,4 177 | is,pl,4,0,4 178 | it,no,4,0,4 179 | lv,es,4,0,4 180 | lv,nl,4,4,0 181 | md,lt,4,0,4 182 | me,pl,4,0,4 183 | mk,az,4,4,0 184 | mt,no,4,0,4 185 | no,am,4,4,0 186 | no,md,4,0,4 187 | pl,it,4,4,0 188 | pl,no,4,0,4 189 | pt,gr,4,4,0 190 | rs,it,4,0,4 191 | sm,md,4,0,4 192 | sm,pl,4,4,0 193 | ua,fi,4,0,4 194 | ua,se,4,4,0 195 | al,ee,5,0,5 196 | am,gr,5,2,3 197 | au,be,5,5,0 198 | cy,se,5,5,0 199 | cz,no,5,2,3 200 | cz,pt,5,5,0 201 | de,au,5,5,0 202 | dk,es,5,4,1 203 | dk,md,5,0,5 204 | es,be,5,5,0 205 | fi,md,5,0,5 206 | fi,nl,5,5,0 207 | ge,lt,5,0,5 208 | gr,gb,5,0,5 209 | hr,no,5,0,5 210 | il,au,5,5,0 211 | is,pt,5,5,0 212 | it,se,5,0,5 213 | lt,md,5,0,5 214 | md,be,5,4,1 215 | me,gb,5,5,0 216 | mk,au,5,5,0 217 | mk,cz,5,0,5 218 | mt,ee,5,5,0 219 | no,nl,5,5,0 220 | no,pl,5,0,5 221 | pl,ch,5,5,0 222 | pl,rs,5,0,5 223 | ro,ch,5,5,0 224 | ro,ee,5,0,5 225 | rs,lt,5,2,3 226 | rs,ro,5,0,5 227 | se,cz,5,5,0 228 | se,pl,5,0,5 229 | si,ch,5,5,0 230 | si,es,5,1,4 231 | si,se,5,0,5 232 | ua,az,5,5,0 233 | ua,ee,5,0,5 234 | am,md,6,1,5 235 | am,rs,6,0,6 236 | at,am,6,6,0 237 | at,it,6,3,3 238 | au,pt,6,6,0 239 | az,gr,6,3,3 240 | az,rs,6,0,6 241 | be,pt,6,5,1 242 | be,rs,6,4,2 243 | bg,be,6,6,0 244 | cy,it,6,1,5 245 | cz,ch,6,6,0 246 | de,az,6,6,0 247 | ee,gr,6,6,0 248 | ee,md,6,0,6 249 | fi,gr,6,6,0 250 | fr,be,6,6,0 251 | gb,au,6,6,0 252 | gb,no,6,0,6 253 | gr,no,6,0,6 254 | ie,it,6,6,0 255 | ie,rs,6,5,1 256 | il,md,6,0,6 257 | is,es,6,3,3 258 | is,it,6,6,0 259 | is,md,6,0,6 260 | lv,pt,6,6,0 261 | md,au,6,6,0 262 | md,no,6,0,6 263 | mt,au,6,6,0 264 | mt,pl,6,4,2 265 | mt,rs,6,0,6 266 | nl,pl,6,0,6 267 | pl,au,6,6,0 268 | pt,is,6,6,0 269 | pt,lt,6,5,1 270 | ro,au,6,6,0 271 | rs,fi,6,6,0 272 | rs,se,6,5,1 273 | sm,au,6,6,0 274 | ua,ch,6,6,0 275 | ua,md,6,0,6 276 | am,fr,7,7,0 277 | at,md,7,0,7 278 | au,gb,7,0,7 279 | az,no,7,0,7 280 | az,pt,7,7,0 281 | be,pl,7,0,7 282 | bg,ch,7,7,0 283 | bg,md,7,0,7 284 | cz,pl,7,0,7 285 | de,rs,7,0,7 286 | ee,pt,7,7,0 287 | es,md,7,0,7 288 | fr,pt,7,1,6 289 | gb,az,7,7,0 290 | gb,ee,7,5,2 291 | gb,lt,7,0,7 292 | ge,pt,7,7,0 293 | ge,rs,7,0,7 294 | ie,cz,7,7,0 295 | ie,md,7,0,7 296 | il,pl,7,6,1 297 | il,rs,7,0,7 298 | it,be,7,7,0 299 | lt,ch,7,7,0 300 | lt,it,7,4,3 301 | lt,nl,7,6,1 302 | lv,gr,7,7,0 303 | lv,md,7,0,7 304 | md,ch,7,7,0 305 | me,md,7,0,7 306 | mk,md,7,0,7 307 | nl,au,7,7,0 308 | pl,es,7,1,6 309 | pl,md,7,0,7 310 | pt,se,7,0,7 311 | ro,pt,7,7,0 312 | ro,rs,7,0,7 313 | rs,pt,7,7,0 314 | rs,ua,7,0,7 315 | se,az,7,7,0 316 | se,fi,7,0,7 317 | si,md,7,0,7 318 | sm,az,7,7,0 319 | ua,gr,7,7,0 320 | al,se,8,8,0 321 | at,nl,8,8,0 322 | be,md,8,0,8 323 | cy,au,8,8,0 324 | cz,md,8,0,8 325 | de,nl,8,4,4 326 | de,pl,8,0,8 327 | dk,no,8,0,8 328 | dk,pt,8,8,0 329 | ee,au,8,8,0 330 | es,au,8,8,0 331 | es,rs,8,6,2 332 | fi,au,8,8,0 333 | fr,rs,8,0,8 334 | gb,md,8,0,8 335 | ge,md,8,0,8 336 | ge,se,8,8,0 337 | gr,au,8,8,0 338 | gr,it,8,1,7 339 | gr,rs,8,0,8 340 | hr,md,8,0,8 341 | ie,lt,8,0,8 342 | it,am,8,8,0 343 | it,ro,8,0,8 344 | lt,ee,8,0,8 345 | lv,ee,8,0,8 346 | me,se,8,7,1 347 | mk,gb,8,8,0 348 | mk,ua,8,0,8 349 | mt,ua,8,0,8 350 | nl,no,8,3,5 351 | nl,pt,8,8,0 352 | no,es,8,7,1 353 | pl,ee,8,0,8 354 | pl,pt,8,7,1 355 | pt,md,8,0,8 356 | pt,rs,8,3,5 357 | ro,it,8,4,4 358 | rs,be,8,8,0 359 | rs,no,8,0,8 360 | si,nl,8,7,1 361 | sm,it,8,3,5 362 | sm,rs,8,0,8 363 | sm,se,8,5,3 364 | ua,is,8,0,8 365 | cy,gb,9,3,6 366 | ee,gb,9,4,5 367 | ee,lt,9,2,7 368 | gr,md,9,6,3 369 | gr,ro,9,7,2 370 | hr,se,9,5,4 371 | is,nl,9,4,5 372 | me,pt,9,4,5 373 | ro,es,9,1,8 374 | am,it,10,10,0 375 | at,no,10,5,5 376 | at,pt,10,10,0 377 | at,rs,10,0,10 378 | au,no,10,0,10 379 | be,nl,10,0,10 380 | bg,am,10,5,5 381 | bg,rs,10,0,10 382 | ch,it,10,2,8 383 | ch,nl,10,10,0 384 | ch,se,10,7,3 385 | cy,az,10,10,0 386 | cz,rs,10,0,10 387 | de,es,10,8,2 388 | de,md,10,0,10 389 | dk,lt,10,3,7 390 | dk,nl,10,10,0 391 | ee,it,10,10,0 392 | fi,ee,10,0,10 393 | fi,no,10,4,6 394 | fr,md,10,0,10 395 | ge,am,10,0,10 396 | ge,it,10,10,0 397 | gr,pl,10,10,0 398 | gr,ua,10,0,10 399 | hr,it,10,4,6 400 | hr,lt,10,7,3 401 | hr,pt,10,10,0 402 | ie,pl,10,0,10 403 | it,gr,10,10,0 404 | lv,no,10,5,5 405 | md,ro,10,0,10 406 | mk,se,10,6,4 407 | nl,be,10,6,4 408 | nl,ch,10,10,0 409 | no,pt,10,10,0 410 | se,au,10,10,0 411 | se,ee,10,6,4 412 | ua,lt,10,0,10 413 | ua,pt,10,10,0 414 | ch,gb,11,6,5 415 | cy,rs,11,4,7 416 | es,gb,11,3,8 417 | ge,es,11,5,6 418 | il,es,11,3,8 419 | il,it,11,8,3 420 | it,rs,11,4,7 421 | lt,es,11,5,6 422 | lv,gb,11,8,3 423 | lv,lt,11,1,10 424 | md,es,11,3,8 425 | pl,gb,11,8,3 426 | pt,nl,11,7,4 427 | ro,gb,11,8,3 428 | ua,nl,11,8,3 429 | al,es,12,5,7 430 | al,gr,12,0,12 431 | al,nl,12,6,6 432 | am,pt,12,8,4 433 | am,se,12,5,7 434 | at,ua,12,0,12 435 | az,se,12,8,4 436 | be,it,12,8,4 437 | be,se,12,7,5 438 | bg,ua,12,0,12 439 | ch,gr,12,12,0 440 | ch,pt,12,5,7 441 | ch,rs,12,0,12 442 | cz,ee,12,8,4 443 | de,se,12,7,5 444 | dk,gb,12,6,6 445 | dk,gr,12,12,0 446 | ee,ua,12,0,12 447 | es,az,12,12,0 448 | es,ua,12,0,12 449 | fi,ua,12,0,12 450 | fr,am,12,7,5 451 | fr,es,12,5,7 452 | fr,pl,12,8,4 453 | gb,ua,12,0,12 454 | gr,az,12,12,0 455 | it,gb,12,6,6 456 | it,ua,12,0,12 457 | md,ee,12,5,7 458 | nl,es,12,5,7 459 | nl,gb,12,4,8 460 | nl,gr,12,12,0 461 | nl,md,12,2,10 462 | nl,ua,12,0,12 463 | no,gb,12,6,6 464 | no,lt,12,2,10 465 | ro,md,12,0,12 466 | rs,az,12,12,0 467 | rs,md,12,0,12 468 | se,rs,12,4,8 469 | se,ua,12,0,12 470 | si,gr,12,4,8 471 | si,lt,12,10,2 472 | ua,pl,12,0,12 473 | at,se,13,7,6 474 | bg,gb,13,10,3 475 | ch,ua,13,3,10 476 | cz,es,13,7,6 477 | ee,fi,13,5,8 478 | es,se,13,7,6 479 | hr,es,13,6,7 480 | ie,se,13,10,3 481 | lt,se,13,3,10 482 | md,gb,13,10,3 483 | md,se,13,8,5 484 | mk,it,13,7,6 485 | se,no,13,3,10 486 | al,gb,14,10,4 487 | ch,es,14,8,6 488 | cy,es,14,6,8 489 | cz,gb,14,12,2 490 | es,ro,14,4,10 491 | fi,gb,14,10,4 492 | fi,rs,14,7,7 493 | fr,gb,14,12,2 494 | ie,gb,14,8,6 495 | is,gb,14,7,7 496 | it,nl,14,12,2 497 | lt,gb,14,10,4 498 | rs,es,14,4,10 499 | se,es,14,12,2 500 | se,gb,14,8,6 501 | sm,gb,14,8,6 502 | sm,ua,14,2,12 503 | am,ee,15,3,12 504 | au,se,15,10,5 505 | az,es,15,5,10 506 | az,it,15,10,5 507 | be,gb,15,12,3 508 | cz,se,15,10,5 509 | es,it,15,10,5 510 | gb,es,15,10,5 511 | ie,ua,15,3,12 512 | it,md,15,5,10 513 | lt,pt,15,8,7 514 | mt,se,15,10,5 515 | no,ua,15,3,12 516 | am,ua,16,6,10 517 | au,rs,16,8,8 518 | be,es,16,10,6 519 | bg,es,16,8,8 520 | cz,ua,16,4,12 521 | gb,se,16,12,4 522 | ge,gb,16,12,4 523 | lv,se,16,10,6 524 | me,es,16,8,8 525 | me,it,16,10,6 526 | me,ua,16,6,10 527 | no,se,16,8,8 528 | pt,gb,16,10,6 529 | ro,se,16,10,6 530 | rs,ee,16,10,6 531 | al,ua,17,7,10 532 | dk,se,17,7,10 533 | dk,ua,17,5,12 534 | gr,es,17,5,12 535 | ie,es,17,12,5 536 | il,se,17,12,5 537 | mt,it,17,7,10 538 | sm,gr,17,10,7 539 | au,es,18,12,6 540 | az,ua,18,6,12 541 | be,ua,18,6,12 542 | bg,gr,18,12,6 543 | de,gb,18,12,6 544 | gb,pl,18,8,10 545 | ge,ua,18,6,12 546 | hr,ua,18,8,10 547 | is,no,18,8,10 548 | si,it,18,12,6 549 | si,rs,18,6,12 550 | si,ua,18,8,10 551 | au,ua,19,7,12 552 | cy,ua,19,7,12 553 | il,ua,19,7,12 554 | mt,es,19,12,7 555 | no,gr,19,12,7 556 | ua,gb,19,12,7 557 | al,it,20,12,8 558 | am,es,20,12,8 559 | at,gb,20,12,8 560 | az,gb,20,12,8 561 | fi,se,20,12,8 562 | il,gb,20,10,10 563 | is,se,20,12,8 564 | mt,gb,20,8,12 565 | pl,se,20,10,10 566 | pt,ua,20,8,12 567 | cy,gr,22,12,10 568 | de,ua,22,10,12 569 | ee,se,22,12,10 570 | fr,ua,22,10,12 571 | is,ua,22,10,12 572 | mk,es,22,12,10 573 | mk,rs,22,10,12 574 | pt,es,22,12,10 575 | ro,ua,22,12,10 576 | sm,es,22,12,10 577 | hr,rs,24,12,12 578 | lt,ua,24,12,12 579 | lv,ua,24,12,12 580 | md,ua,24,12,12 581 | me,rs,24,12,12 582 | pl,ua,24,12,12 -------------------------------------------------------------------------------- /data/esc/esc-countries.csv: -------------------------------------------------------------------------------- 1 | code,name 2 | al,Albania 3 | ad,Andorra 4 | am,Armenia 5 | au,Australia 6 | at,Austria 7 | az,Azerbaijan 8 | by,Belarus 9 | be,Belgium 10 | ba,Bosnia & Herzegovina 11 | bg,Bulgaria 12 | hr,Croatia 13 | cy,Cyprus 14 | cz,Czech Republic 15 | dk,Denmark 16 | ee,Estonia 17 | fi,Finland 18 | fr,France 19 | ge,Georgia 20 | de,Germany 21 | gr,Greece 22 | hu,Hungary 23 | is,Iceland 24 | ie,Ireland 25 | il,Israel 26 | it,Italy 27 | lv,Latvia 28 | lt,Lithuania 29 | lu,Luxembourg 30 | mt,Malta 31 | md,Moldova 32 | mc,Monaco 33 | me,Montenegro 34 | ma,Morocco 35 | nl,Netherlands 36 | mk,North Macedonia 37 | no,Norway 38 | pl,Poland 39 | pt,Portugal 40 | ro,Romania 41 | ru,Russia 42 | sm,San Marino 43 | rs,Serbia 44 | cs,Serbia & Montenegro 45 | sk,Slovakia 46 | si,Slovenia 47 | es,Spain 48 | se,Sweden 49 | ch,Switzerland 50 | tr,Turkey 51 | ua,Ukraine 52 | gb,United Kingdom 53 | yu,Yugoslavia -------------------------------------------------------------------------------- /data/esc/esc-import.cypher: -------------------------------------------------------------------------------- 1 | create constraint on (c:Country) assert c.code is unique; 2 | create index on :Country(name); 3 | 4 | LOAD CSV WITH HEADERS FROM "https://github.com/neo4j-examples/discoveraurafree/raw/main/data/esc/esc-countries.csv" AS row 5 | MERGE (c:Country {code:row.code}) SET c.name = row.name; 6 | 7 | // votes 2022 8 | LOAD CSV WITH HEADERS FROM "https://github.com/neo4j-examples/discoveraurafree/raw/main/data/esc/esc-2022.csv" AS row 9 | WITH * WHERE toInteger(row.total) > 0 10 | MERGE (from:Country {code: row.from}) 11 | MERGE (to:Country {code: row.to}) 12 | MERGE (from)-[v:VOTES_2022]->(to) 13 | ON CREATE SET v.total = toInteger(row.total), 14 | v.jury = toInteger(row.jury), 15 | v.public = toInteger(row.public); 16 | 17 | // votes 2021 18 | LOAD CSV WITH HEADERS FROM "https://github.com/neo4j-examples/discoveraurafree/raw/main/data/esc/esc-2021.csv" AS row 19 | WITH * WHERE toInteger(row.total) > 0 20 | MERGE (from:Country {code: row.from}) 21 | MERGE (to:Country {code: row.to}) 22 | MERGE (from)-[v:VOTES_2021]->(to) 23 | ON CREATE SET v.total = toInteger(row.total), 24 | v.jury = toInteger(row.jury), 25 | v.public = toInteger(row.public); 26 | 27 | 28 | // votes 1975 to 2019 29 | LOAD CSV WITH HEADERS FROM "https://github.com/neo4j-examples/discoveraurafree/raw/main/data/esc/esc-1975-2019.csv" AS row fieldterminator ';' 30 | // year;round;edition;vote;from;to;points;duplicate 31 | WITH * WHERE coalesce(row.duplicate,'') <> 'x' AND row.round = 'f' AND row.from <> row.to 32 | WITH row.year as year, row.from as fromCountry, row.to as toCountry, 33 | sum(case row.vote when 'J' then toInteger(row.points) else 0 end) as jury, 34 | sum(case row.vote when 'T' then toInteger(row.points) else 0 end) as public 35 | WHERE public+jury > 0 36 | MERGE (from:Country {name: fromCountry}) 37 | MERGE (to:Country {name: toCountry}) 38 | WITH * 39 | CALL apoc.create.relationship(from, 'VOTES_'+year, {jury:jury, public:public, total:public+jury}, to) yield rel 40 | RETURN count(*); 41 | -------------------------------------------------------------------------------- /data/neo4j_importer_model_movies_denormalized.json: -------------------------------------------------------------------------------- 1 | {"version":"0.0.1","graph":{"nodes":[{"id":"n0","position":{"x":1667.889537009802,"y":-216.65265928427195},"caption":"Movie"},{"id":"n1","position":{"x":1288.3343726198955,"y":-216.65265928427195},"caption":"Person"}],"relationships":[{"id":"n0","type":"ACTED_IN","fromId":"n1","toId":"n0"}]},"dataModel":{"fileModel":{"fileSchemas":{"2-movieData-acted.csv":{"expanded":true,"fields":[{"name":"movieId","type":"string","sample":"1","include":true},{"name":"title","type":"string","sample":"Toy Story","include":true},{"name":"budget","type":"string","sample":"30000000.0","include":true},{"name":"countries","type":"string","sample":"USA","include":true},{"name":"movie_imdbId","type":"string","sample":"114709","include":true},{"name":"imdbRating","type":"string","sample":"8.3","include":true},{"name":"imdbVotes","type":"string","sample":"591836.0","include":true},{"name":"languages","type":"string","sample":"English","include":true},{"name":"plot","type":"string","sample":"A cowboy doll is profoundly threatened and jealous when a new spaceman figure supplants him as top toy in a boy's room.","include":true},{"name":"movie_poster","type":"string","sample":"https://image.tmdb.org/t/p/w440_and_h660_face/uXDfjJbdP4ijW5hWSBrPrlKpxab.jpg","include":true},{"name":"released","type":"string","sample":"1995-11-22","include":true},{"name":"revenue","type":"string","sample":"373554033.0","include":true},{"name":"runtime","type":"string","sample":"81.0","include":true},{"name":"movie_tmdbId","type":"string","sample":"862","include":true},{"name":"movie_url","type":"string","sample":"https://themoviedb.org/movie/862","include":true},{"name":"year","type":"string","sample":"1995.0","include":true},{"name":"genres","type":"string","sample":"Adventure|Animation|Children|Comedy|Fantasy","include":true},{"name":"work","type":"string","sample":"ACTED_IN","include":true},{"name":"role","type":"string","sample":"Slinky Dog (voice)","include":true},{"name":"bio","type":"string","sample":"James Albert \"Jim\" Varney, Jr.  (June 15, 1949 – February 10, 2000) was an American actor, voice artist, and comedian, best known for his role as Ernest P. Worrell, who was used in numerous television commercial campaigns and movies in the following years, giving Varney fame nationally in the United States...","include":true},{"name":"born","type":"string","sample":"1949-06-15","include":true},{"name":"bornIn","type":"string","sample":"","include":true},{"name":"died","type":"string","sample":"2000-02-10","include":true},{"name":"person_imdbId","type":"string","sample":"1815.0","include":true},{"name":"name","type":"string","sample":"Jim Varney","include":true},{"name":"person_tmdbId","type":"string","sample":"12899","include":true},{"name":"person_poster","type":"string","sample":"https://image.tmdb.org/t/p/w440_and_h660_face/j2De8KaACIbi4IX8WfUZGmCW1k2.jpg","include":true},{"name":"person_url","type":"string","sample":"https://themoviedb.org/person/12899","include":true}]}}},"graphModel":{"nodeSchemas":{"n0":{"label":"Movie","additionLabels":[],"labelProperties":[],"properties":[{"property":"movieId","type":"string"},{"property":"title","type":"string"},{"property":"budget","type":"string"},{"property":"countries","type":"string"},{"property":"movie_imdbId","type":"string"},{"property":"imdbRating","type":"string"},{"property":"imdbVotes","type":"string"},{"property":"languages","type":"string"},{"property":"plot","type":"string"},{"property":"movie_poster","type":"string"},{"property":"released","type":"string"},{"property":"revenue","type":"string"},{"property":"runtime","type":"string"},{"property":"movie_tmdbId","type":"string"},{"property":"movie_url","type":"string"},{"property":"year","type":"string"},{"property":"genres","type":"string"}],"key":{"properties":[0],"name":""}},"n1":{"label":"Person","additionLabels":[],"labelProperties":[],"properties":[{"property":"bio","type":"string"},{"property":"born","type":"string"},{"property":"bornIn","type":"string"},{"property":"died","type":"string"},{"property":"imdbId","type":"string"},{"property":"name","type":"string"},{"property":"tmdbId","type":"string"},{"property":"poster","type":"string"},{"property":"url","type":"string"}],"key":{"properties":[6],"name":""}}},"relationshipSchemas":{"n0":{"type":"ACTED_IN","sourceNodeSchema":"n1","targetNodeSchema":"n0","properties":[{"property":"role","type":"string"}]}}},"mappingModel":{"nodeMappings":{"n0":{"nodeSchema":"n0","fileSchema":"2-movieData-acted.csv","mappings":[{"field":"movieId"},{"field":"title"},{"field":"budget"},{"field":"countries"},{"field":"movie_imdbId"},{"field":"imdbRating"},{"field":"imdbVotes"},{"field":"languages"},{"field":"plot"},{"field":"movie_poster"},{"field":"released"},{"field":"revenue"},{"field":"runtime"},{"field":"movie_tmdbId"},{"field":"movie_url"},{"field":"year"},{"field":"genres"}]},"n1":{"nodeSchema":"n1","fileSchema":"2-movieData-acted.csv","mappings":[{"field":"bio"},{"field":"born"},{"field":"bornIn"},{"field":"died"},{"field":"person_imdbId"},{"field":"name"},{"field":"person_tmdbId"},{"field":"person_poster"},{"field":"person_url"}]}},"relationshipMappings":{"n0":{"relationshipSchema":"n0","mappings":[{"field":"role"}],"sourceMappings":[{"field":"person_tmdbId"}],"targetMappings":[{"field":"movieId"}],"fileSchema":"2-movieData-acted.csv"}}}},"configurations":{"hasAcceptedTermsAndConditions":false}} -------------------------------------------------------------------------------- /data/nodes-sessions-data-importer-2022-09-26.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/data/nodes-sessions-data-importer-2022-09-26.zip -------------------------------------------------------------------------------- /data/presidents-data-importer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/data/presidents-data-importer.zip -------------------------------------------------------------------------------- /img/NBAGraph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/NBAGraph.png -------------------------------------------------------------------------------- /img/Resonatemodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/Resonatemodel.png -------------------------------------------------------------------------------- /img/attrition-bloom-job.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/attrition-bloom-job.png -------------------------------------------------------------------------------- /img/attrition-department-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/attrition-department-bloom.png -------------------------------------------------------------------------------- /img/attrition-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/attrition-model.png -------------------------------------------------------------------------------- /img/aura-browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aura-browser.png -------------------------------------------------------------------------------- /img/aura-connect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aura-connect.png -------------------------------------------------------------------------------- /img/aura-create-free.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aura-create-free.png -------------------------------------------------------------------------------- /img/aura-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aura-credentials.png -------------------------------------------------------------------------------- /img/aura-workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aura-workspace.png -------------------------------------------------------------------------------- /img/aurads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/aurads.png -------------------------------------------------------------------------------- /img/bb_csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bb_csv.png -------------------------------------------------------------------------------- /img/bbgmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bbgmodel.png -------------------------------------------------------------------------------- /img/bluesky-bloom-coordinate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-bloom-coordinate.png -------------------------------------------------------------------------------- /img/bluesky-bloom-force.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-bloom-force.png -------------------------------------------------------------------------------- /img/bluesky-bloom-hierarchical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-bloom-hierarchical.png -------------------------------------------------------------------------------- /img/bluesky-browser-shortest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-browser-shortest.png -------------------------------------------------------------------------------- /img/bluesky-browser-thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-browser-thread.png -------------------------------------------------------------------------------- /img/bluesky-jaz-graph.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-jaz-graph.jpg -------------------------------------------------------------------------------- /img/bluesky-jaz-thread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-jaz-thread.png -------------------------------------------------------------------------------- /img/bluesky-timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/bluesky-timeline.png -------------------------------------------------------------------------------- /img/books-aura.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-aura.png -------------------------------------------------------------------------------- /img/books-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-data.png -------------------------------------------------------------------------------- /img/books-goodreads.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-goodreads.png -------------------------------------------------------------------------------- /img/books-import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-import.png -------------------------------------------------------------------------------- /img/books-reco-collab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-reco-collab.png -------------------------------------------------------------------------------- /img/books-tag-sherlock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-tag-sherlock.png -------------------------------------------------------------------------------- /img/books-user-ratings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/books-user-ratings.png -------------------------------------------------------------------------------- /img/chessmodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/chessmodel.png -------------------------------------------------------------------------------- /img/chessmovechain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/chessmovechain.png -------------------------------------------------------------------------------- /img/citations-dataimporter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/citations-dataimporter.png -------------------------------------------------------------------------------- /img/citations-nature-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/citations-nature-data-importer.png -------------------------------------------------------------------------------- /img/citations-nature-explore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/citations-nature-explore.png -------------------------------------------------------------------------------- /img/citations-nature-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/citations-nature-query.png -------------------------------------------------------------------------------- /img/citations-nature-visualization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/citations-nature-visualization.png -------------------------------------------------------------------------------- /img/codespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/codespace.png -------------------------------------------------------------------------------- /img/complaints-schema-graph-viz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/complaints-schema-graph-viz.png -------------------------------------------------------------------------------- /img/consumer-complaints.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/consumer-complaints.png -------------------------------------------------------------------------------- /img/data-import-bloom-northwind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-bloom-northwind.png -------------------------------------------------------------------------------- /img/data-import-credentials.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-credentials.png -------------------------------------------------------------------------------- /img/data-import-graphacademy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-graphacademy.png -------------------------------------------------------------------------------- /img/data-import-model-export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-model-export.png -------------------------------------------------------------------------------- /img/data-import-movie-files.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movie-files.png -------------------------------------------------------------------------------- /img/data-import-movie-mapping-rel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movie-mapping-rel.png -------------------------------------------------------------------------------- /img/data-import-movie-mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movie-mapping.png -------------------------------------------------------------------------------- /img/data-import-movie-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movie-model.png -------------------------------------------------------------------------------- /img/data-import-movie-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movie-results.png -------------------------------------------------------------------------------- /img/data-import-movies-denormalized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movies-denormalized.png -------------------------------------------------------------------------------- /img/data-import-movies-genres-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-movies-genres-bloom.png -------------------------------------------------------------------------------- /img/data-import-northwind-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-northwind-model.png -------------------------------------------------------------------------------- /img/data-import-northwind-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-import-northwind-results.png -------------------------------------------------------------------------------- /img/data-importer-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/data-importer-overview.png -------------------------------------------------------------------------------- /img/desktop-dump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/desktop-dump.png -------------------------------------------------------------------------------- /img/election-party-topic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/election-party-topic.png -------------------------------------------------------------------------------- /img/esc-2022-gt15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/esc-2022-gt15.png -------------------------------------------------------------------------------- /img/esc-import-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/esc-import-all.png -------------------------------------------------------------------------------- /img/fast.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/fast.gif -------------------------------------------------------------------------------- /img/gc-schedule-bloom-recommendation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-bloom-recommendation.png -------------------------------------------------------------------------------- /img/gc-schedule-bloom-saved-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-bloom-saved-query.png -------------------------------------------------------------------------------- /img/gc-schedule-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-bloom.png -------------------------------------------------------------------------------- /img/gc-schedule-browser-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-browser-all.png -------------------------------------------------------------------------------- /img/gc-schedule-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-data-importer.png -------------------------------------------------------------------------------- /img/gc-schedule-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-model.png -------------------------------------------------------------------------------- /img/gc-schedule-recommendation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-recommendation.png -------------------------------------------------------------------------------- /img/gc-schedule-session.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-schedule-session.png -------------------------------------------------------------------------------- /img/gc-sessions-spreadsheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gc-sessions-spreadsheet.png -------------------------------------------------------------------------------- /img/gdelt-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gdelt-model.png -------------------------------------------------------------------------------- /img/gdelt-overlap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gdelt-overlap.png -------------------------------------------------------------------------------- /img/gedcom-bloom-all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-bloom-all.png -------------------------------------------------------------------------------- /img/gedcom-bloom-core-families.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-bloom-core-families.png -------------------------------------------------------------------------------- /img/gedcom-bloom-lincoln.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-bloom-lincoln.png -------------------------------------------------------------------------------- /img/gedcom-bloom-styling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-bloom-styling.png -------------------------------------------------------------------------------- /img/gedcom-browser-kennedy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-browser-kennedy.png -------------------------------------------------------------------------------- /img/gedcom-browser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-browser.png -------------------------------------------------------------------------------- /img/gedcom-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-data-importer.png -------------------------------------------------------------------------------- /img/gedcom-family-ancestors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-family-ancestors.png -------------------------------------------------------------------------------- /img/gedcom-import-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-import-results.png -------------------------------------------------------------------------------- /img/gedcom-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-model.png -------------------------------------------------------------------------------- /img/gedcom-siblings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/gedcom-siblings.png -------------------------------------------------------------------------------- /img/german-election-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/german-election-bloom.png -------------------------------------------------------------------------------- /img/git-bloom-shortest-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-bloom-shortest-path.png -------------------------------------------------------------------------------- /img/git-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-bloom.png -------------------------------------------------------------------------------- /img/git-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-data-importer.png -------------------------------------------------------------------------------- /img/git-import-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-import-preview.png -------------------------------------------------------------------------------- /img/git-import-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-import-results.png -------------------------------------------------------------------------------- /img/git-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-model.png -------------------------------------------------------------------------------- /img/git-query-long-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-query-long-path.png -------------------------------------------------------------------------------- /img/git-query-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-query-path.png -------------------------------------------------------------------------------- /img/git-query-profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-query-profile.png -------------------------------------------------------------------------------- /img/git-query-profile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-query-profile2.png -------------------------------------------------------------------------------- /img/git-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/git-query.png -------------------------------------------------------------------------------- /img/hamilton-data-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/hamilton-data-model.png -------------------------------------------------------------------------------- /img/hamilton-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/hamilton-model.png -------------------------------------------------------------------------------- /img/hamilton-sfo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/hamilton-sfo.jpg -------------------------------------------------------------------------------- /img/hamilton-themes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/hamilton-themes.png -------------------------------------------------------------------------------- /img/hamilton-washington.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/hamilton-washington.png -------------------------------------------------------------------------------- /img/img_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/img_data.png -------------------------------------------------------------------------------- /img/img_repo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/img_repo.png -------------------------------------------------------------------------------- /img/jaz-bluesky-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/jaz-bluesky-graph.png -------------------------------------------------------------------------------- /img/kickstarter-categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/kickstarter-categories.png -------------------------------------------------------------------------------- /img/kickstarter-datamodel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/kickstarter-datamodel.png -------------------------------------------------------------------------------- /img/kickstarter-dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/kickstarter-dataset.png -------------------------------------------------------------------------------- /img/kickstarter-meta.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/kickstarter-meta.png -------------------------------------------------------------------------------- /img/kickstarter-projects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/kickstarter-projects.png -------------------------------------------------------------------------------- /img/marvel-account.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-account.png -------------------------------------------------------------------------------- /img/marvel-api-character.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-api-character.png -------------------------------------------------------------------------------- /img/marvel-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-api.png -------------------------------------------------------------------------------- /img/marvel-bloom-comics-stories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-bloom-comics-stories.png -------------------------------------------------------------------------------- /img/marvel-bloom-shortest-path.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-bloom-shortest-path.png -------------------------------------------------------------------------------- /img/marvel-brower-load-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-brower-load-data.png -------------------------------------------------------------------------------- /img/marvel-browser-characters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-browser-characters.png -------------------------------------------------------------------------------- /img/marvel-browser-clusters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-browser-clusters.png -------------------------------------------------------------------------------- /img/marvel-browser-overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-browser-overview.png -------------------------------------------------------------------------------- /img/marvel-graphql-query.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-graphql-query.png -------------------------------------------------------------------------------- /img/marvel-groot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-groot.png -------------------------------------------------------------------------------- /img/marvel-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-model.png -------------------------------------------------------------------------------- /img/marvel-teams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-teams.png -------------------------------------------------------------------------------- /img/marvel-vimeo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/marvel-vimeo.png -------------------------------------------------------------------------------- /img/movies-db.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/movies-db.png -------------------------------------------------------------------------------- /img/movies-guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/movies-guide.png -------------------------------------------------------------------------------- /img/nft-bloom-collection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-bloom-collection.png -------------------------------------------------------------------------------- /img/nft-bloom-seller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-bloom-seller.png -------------------------------------------------------------------------------- /img/nft-bloom-style-transaction-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-bloom-style-transaction-color.png -------------------------------------------------------------------------------- /img/nft-bloom-style-transaction-size.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-bloom-style-transaction-size.png -------------------------------------------------------------------------------- /img/nft-import-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-import-results.png -------------------------------------------------------------------------------- /img/nft-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-model.png -------------------------------------------------------------------------------- /img/nft-transaction-mapping.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nft-transaction-mapping.png -------------------------------------------------------------------------------- /img/nobel-prize-data-importer-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-data-importer-preview.png -------------------------------------------------------------------------------- /img/nobel-prize-data-importer-preview2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-data-importer-preview2.png -------------------------------------------------------------------------------- /img/nobel-prize-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-data-importer.png -------------------------------------------------------------------------------- /img/nobel-prize-explore-harvard-medical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-explore-harvard-medical.png -------------------------------------------------------------------------------- /img/nobel-prize-explore-show-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-explore-show-graph.png -------------------------------------------------------------------------------- /img/nobel-prize-kg-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-kg-model.png -------------------------------------------------------------------------------- /img/nobel-prize-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-model.png -------------------------------------------------------------------------------- /img/nobel-prize-query-institutions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-query-institutions.png -------------------------------------------------------------------------------- /img/nobel-prize-query-laureats-per-prize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-query-laureats-per-prize.png -------------------------------------------------------------------------------- /img/nobel-prize-query-multiple-prizes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-query-multiple-prizes.png -------------------------------------------------------------------------------- /img/nobel-prize-query-oldest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-query-oldest.png -------------------------------------------------------------------------------- /img/nobel-prize-query-youngest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nobel-prize-query-youngest.png -------------------------------------------------------------------------------- /img/nodes-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-dashboard.png -------------------------------------------------------------------------------- /img/nodes-data-importer-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-data-importer-preview.png -------------------------------------------------------------------------------- /img/nodes-data-importer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-data-importer.png -------------------------------------------------------------------------------- /img/nodes-explore-session.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-explore-session.png -------------------------------------------------------------------------------- /img/nodes-explore-show-graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-explore-show-graph.png -------------------------------------------------------------------------------- /img/nodes-labs-tools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-labs-tools.png -------------------------------------------------------------------------------- /img/nodes-promo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-promo.png -------------------------------------------------------------------------------- /img/nodes-sessionize-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-sessionize-api.png -------------------------------------------------------------------------------- /img/nodes-sessionize-export-csv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nodes-sessionize-export-csv.png -------------------------------------------------------------------------------- /img/nytimes-articles.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nytimes-articles.png -------------------------------------------------------------------------------- /img/nytimes-metadata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nytimes-metadata.png -------------------------------------------------------------------------------- /img/nytimes-topics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nytimes-topics.png -------------------------------------------------------------------------------- /img/nzcc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/nzcc.png -------------------------------------------------------------------------------- /img/opencitations-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/opencitations-search.png -------------------------------------------------------------------------------- /img/opencitations-single.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/opencitations-single.png -------------------------------------------------------------------------------- /img/podcasts-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/podcasts-model.png -------------------------------------------------------------------------------- /img/podcasts-tags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/podcasts-tags.png -------------------------------------------------------------------------------- /img/ranys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/ranys.png -------------------------------------------------------------------------------- /img/recommendations-guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/recommendations-guide.png -------------------------------------------------------------------------------- /img/sandbox-backup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/sandbox-backup.png -------------------------------------------------------------------------------- /img/shirley-hamilton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/shirley-hamilton.png -------------------------------------------------------------------------------- /img/spreadsheet-publish.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/spreadsheet-publish.png -------------------------------------------------------------------------------- /img/stackoverflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/stackoverflow.png -------------------------------------------------------------------------------- /img/upload-dump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/upload-dump.png -------------------------------------------------------------------------------- /img/wordle-bloom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-bloom.png -------------------------------------------------------------------------------- /img/wordle-crash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-crash.png -------------------------------------------------------------------------------- /img/wordle-diver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-diver.png -------------------------------------------------------------------------------- /img/wordle-example-progress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-example-progress.png -------------------------------------------------------------------------------- /img/wordle-example-solved.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-example-solved.png -------------------------------------------------------------------------------- /img/wordle-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-model.png -------------------------------------------------------------------------------- /img/wordle-rel-model-exclusions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-rel-model-exclusions.png -------------------------------------------------------------------------------- /img/wordle-rel-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-rel-model.png -------------------------------------------------------------------------------- /img/wordle-shared-letters.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-shared-letters.png -------------------------------------------------------------------------------- /img/wordle-shared-letters2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-shared-letters2.png -------------------------------------------------------------------------------- /img/wordle-solver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle-solver.png -------------------------------------------------------------------------------- /img/wordle_neo4j.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/wordle_neo4j.gif -------------------------------------------------------------------------------- /img/zq99chessrepo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/img/zq99chessrepo.png -------------------------------------------------------------------------------- /rdbms2neo4j: -------------------------------------------------------------------------------- 1 | ///usr/bin/env jbang "$0" "$@" ; exit $? 2 | //DEPS org.neo4j.driver:neo4j-java-driver:4.4.1 3 | //DEPS org.postgresql:postgresql:42.2.24 4 | 5 | // export JDBC_URL="jdbc:postgresql://db-examples.cmlvojdj5cci.us-east-1.rds.amazonaws.com/northwind?user=n4examples&password=36gdOVABr3Ex" 6 | // export NEO4J_URL="neo4j+s://xxxx.databases.neo4j.io" 7 | // export NEO4J_PASSWORD="secret" 8 | // jbang rdbms2neo4j Customer 9 | 10 | import static java.lang.System.*; 11 | import java.sql.*; 12 | import java.util.*; 13 | import org.neo4j.driver.*; 14 | import org.neo4j.driver.summary.*; 15 | 16 | public class rdbms2neo4j { 17 | 18 | static final String INSERT_STATEMENT = "UNWIND $data AS row CREATE (n:`%s`) SET n = row"; 19 | static final int BATCH_SIZE = 10000; 20 | 21 | public static void main(String... args) throws Exception { 22 | String table=args[0]; 23 | String statement = String.format(INSERT_STATEMENT, table); 24 | int nodesCreated = 0; 25 | try (org.neo4j.driver.Driver driver = GraphDatabase.driver(getenv("NEO4J_URL"), 26 | AuthTokens.basic("neo4j",getenv("NEO4J_PASSWORD"))); 27 | Session session = driver.session(); 28 | Connection con=DriverManager.getConnection(getenv("JDBC_URL")); 29 | Statement stmt=con.createStatement(); 30 | ResultSet rs=stmt.executeQuery("SELECT * FROM "+table)) { 31 | ResultSetMetaData meta=rs.getMetaData(); 32 | String[] cols=new String[meta.getColumnCount()]; 33 | for (int c=1;c<=cols.length;c++) 34 | cols[c-1]=meta.getColumnName(c); 35 | List> data = new ArrayList<>(); 36 | while (rs.next()) { 37 | Map row=new HashMap<>(cols.length); 38 | for (int c=1;c<=cols.length;c++) { 39 | // todo unsupported datatypes like BigDecimal 40 | row.put(cols[c-1], rs.getObject(c)); 41 | } 42 | data.add(row); 43 | if (data.size() == BATCH_SIZE) { 44 | ResultSummary sum = session.writeTransaction( 45 | tx -> tx.run(statement, Collections.singletonMap("data", data)).consume()); 46 | nodesCreated += sum.counters().nodesCreated(); 47 | data.clear(); 48 | } 49 | } 50 | if (!data.isEmpty()) { 51 | ResultSummary sum = session.writeTransaction(tx -> 52 | tx.run(statement, Collections.singletonMap("data", data)).consume()); 53 | nodesCreated += sum.counters().nodesCreated(); 54 | out.println("Nodes created: " + nodesCreated); 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /week-1.adoc: -------------------------------------------------------------------------------- 1 | == Week 1 - The NBA data set 2 | 3 | In this week's episode, Lju and Alexander explore a National Basketball Association (NBA) dataset, from https://fivethirtyeight.com/[FiveThirtyEight^]. Catch-up on the episode now! 4 | 5 | .catch-up video 6 | [caption="Week 1 ",link=https://www.youtube.com/watch?v=_tuea3bsrPA^] 7 | image::https://i.ytimg.com/vi/_tuea3bsrPA/maxresdefault.jpg[] 8 | 9 | === Key links 10 | 11 | * https://dev.neo4j.com/discover-aura[Neo4j Aura landing page^] 12 | * https://github.com/fivethirtyeight/data/blob/master/nba-elo/nbaallelo.csv[Github repo for the NBA data^] 13 | * https://raw.githubusercontent.com/fivethirtyeight/data/master/nba-elo/nbaallelo.csv[Raw CSV^] 14 | * https://arrows.app[Arrows app^] 15 | * https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xNzEsInkiOi02Ny42MDAwMDIyODg4MTgzNn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiVGVhbSJdLCJwcm9wZXJ0aWVzIjp7ImNvZGUiOiIiLCJuYW1lIjoiIn0sInN0eWxlIjp7fX0seyJpZCI6Im4xIiwicG9zaXRpb24iOnsieCI6MzI0LjUsInkiOi02Ny42MDAwMDIyODg4MTgzNn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiTWF0Y2giXSwicHJvcGVydGllcyI6eyJpZCI6IiIsImRhdGUiOiIiLCJ2ZW51ZSI6IiJ9LCJzdHlsZSI6e319XSwicmVsYXRpb25zaGlwcyI6W3siaWQiOiJuMCIsImZyb21JZCI6Im4wIiwidG9JZCI6Im4xIiwidHlwZSI6IlBMQVlFRF9JTiIsInByb3BlcnRpZXMiOnsicG9pbnRzIjoiIiwic3RhcnRFbG8iOiIiLCJlbmRFbG8iOiIifSwic3R5bGUiOnt9fV0sInN0eWxlIjp7Im5vZGUtY29sb3IiOiIjZmZmZmZmIiwiYm9yZGVyLXdpZHRoIjo0LCJib3JkZXItY29sb3IiOiIjMDAwMDAwIiwicmFkaXVzIjo1MCwibm9kZS1wYWRkaW5nIjo1LCJub2RlLW1hcmdpbiI6Miwib3V0c2lkZS1wb3NpdGlvbiI6ImF1dG8iLCJjYXB0aW9uLXBvc2l0aW9uIjoiaW5zaWRlIiwiY2FwdGlvbi1tYXgtd2lkdGgiOjIwMCwiY2FwdGlvbi1jb2xvciI6IiMwMDAwMDAiLCJjYXB0aW9uLWZvbnQtc2l6ZSI6NTAsImNhcHRpb24tZm9udC13ZWlnaHQiOiJub3JtYWwiLCJsYWJlbC1wb3NpdGlvbiI6Imluc2lkZSIsImxhYmVsLWNvbG9yIjoiIzAwMDAwMCIsImxhYmVsLWJhY2tncm91bmQtY29sb3IiOiIjZmZmZmZmIiwibGFiZWwtYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsImxhYmVsLWJvcmRlci13aWR0aCI6NCwibGFiZWwtZm9udC1zaXplIjo0MCwibGFiZWwtcGFkZGluZyI6NSwibGFiZWwtbWFyZ2luIjo0LCJkaXJlY3Rpb25hbGl0eSI6ImRpcmVjdGVkIiwiZGV0YWlsLXBvc2l0aW9uIjoiaW5saW5lIiwiZGV0YWlsLW9yaWVudGF0aW9uIjoicGFyYWxsZWwiLCJhcnJvdy13aWR0aCI6NSwiYXJyb3ctY29sb3IiOiIjMDAwMDAwIiwibWFyZ2luLXN0YXJ0Ijo1LCJtYXJnaW4tZW5kIjo1LCJtYXJnaW4tcGVlciI6MjAsImF0dGFjaG1lbnQtc3RhcnQiOiJub3JtYWwiLCJhdHRhY2htZW50LWVuZCI6Im5vcm1hbCIsInR5cGUtY29sb3IiOiIjMDAwMDAwIiwidHlwZS1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsInR5cGUtYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYm9yZGVyLXdpZHRoIjowLCJ0eXBlLWZvbnQtc2l6ZSI6MTYsInR5cGUtcGFkZGluZyI6NSwicHJvcGVydHktcG9zaXRpb24iOiJvdXRzaWRlIiwicHJvcGVydHktY29sb3IiOiIjMDAwMDAwIiwicHJvcGVydHktZm9udC1zaXplIjoxNiwicHJvcGVydHktZm9udC13ZWlnaHQiOiJub3JtYWwifX0sImRpYWdyYW1OYW1lIjoiTkJBIEdyYXBoIn0=[Data model from the session^] 16 | 17 | ==== The data set 18 | 19 | This week we explored a https://en.wikipedia.org/wiki/National_Basketball_Association[NBA^] data set. The data consisted of teams and all of their matches, along with points scored, match dates and location, as well as pre and post match https://en.wikipedia.org/wiki/Elo_rating_system[Elo ratings^]. 20 | 21 | image::img\img_repo.png[] 22 | 23 | ==== The questions 24 | 25 | The following questions for the data set came up during the stream: 26 | 27 | * Historical results between two teams 28 | * The teams with the biggest Elo rating difference 29 | * Find out home/away matches 30 | * Can we predict results based on past experiencees? 31 | 32 | ==== The data model 33 | 34 | You can view and play with the data model in Arrows App https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xNzEsInkiOi02Ny42MDAwMDIyODg4MTgzNn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiVGVhbSJdLCJwcm9wZXJ0aWVzIjp7ImNvZGUiOiIiLCJuYW1lIjoiIn0sInN0eWxlIjp7fX0seyJpZCI6Im4xIiwicG9zaXRpb24iOnsieCI6MzI0LjUsInkiOi02Ny42MDAwMDIyODg4MTgzNn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiTWF0Y2giXSwicHJvcGVydGllcyI6eyJpZCI6IiIsImRhdGUiOiIiLCJ2ZW51ZSI6IiJ9LCJzdHlsZSI6e319XSwicmVsYXRpb25zaGlwcyI6W3siaWQiOiJuMCIsImZyb21JZCI6Im4wIiwidG9JZCI6Im4xIiwidHlwZSI6IlBMQVlFRF9JTiIsInByb3BlcnRpZXMiOnsicG9pbnRzIjoiIiwic3RhcnRFbG8iOiIiLCJlbmRFbG8iOiIifSwic3R5bGUiOnt9fV0sInN0eWxlIjp7Im5vZGUtY29sb3IiOiIjZmZmZmZmIiwiYm9yZGVyLXdpZHRoIjo0LCJib3JkZXItY29sb3IiOiIjMDAwMDAwIiwicmFkaXVzIjo1MCwibm9kZS1wYWRkaW5nIjo1LCJub2RlLW1hcmdpbiI6Miwib3V0c2lkZS1wb3NpdGlvbiI6ImF1dG8iLCJjYXB0aW9uLXBvc2l0aW9uIjoiaW5zaWRlIiwiY2FwdGlvbi1tYXgtd2lkdGgiOjIwMCwiY2FwdGlvbi1jb2xvciI6IiMwMDAwMDAiLCJjYXB0aW9uLWZvbnQtc2l6ZSI6NTAsImNhcHRpb24tZm9udC13ZWlnaHQiOiJub3JtYWwiLCJsYWJlbC1wb3NpdGlvbiI6Imluc2lkZSIsImxhYmVsLWNvbG9yIjoiIzAwMDAwMCIsImxhYmVsLWJhY2tncm91bmQtY29sb3IiOiIjZmZmZmZmIiwibGFiZWwtYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsImxhYmVsLWJvcmRlci13aWR0aCI6NCwibGFiZWwtZm9udC1zaXplIjo0MCwibGFiZWwtcGFkZGluZyI6NSwibGFiZWwtbWFyZ2luIjo0LCJkaXJlY3Rpb25hbGl0eSI6ImRpcmVjdGVkIiwiZGV0YWlsLXBvc2l0aW9uIjoiaW5saW5lIiwiZGV0YWlsLW9yaWVudGF0aW9uIjoicGFyYWxsZWwiLCJhcnJvdy13aWR0aCI6NSwiYXJyb3ctY29sb3IiOiIjMDAwMDAwIiwibWFyZ2luLXN0YXJ0Ijo1LCJtYXJnaW4tZW5kIjo1LCJtYXJnaW4tcGVlciI6MjAsImF0dGFjaG1lbnQtc3RhcnQiOiJub3JtYWwiLCJhdHRhY2htZW50LWVuZCI6Im5vcm1hbCIsInR5cGUtY29sb3IiOiIjMDAwMDAwIiwidHlwZS1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsInR5cGUtYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYm9yZGVyLXdpZHRoIjowLCJ0eXBlLWZvbnQtc2l6ZSI6MTYsInR5cGUtcGFkZGluZyI6NSwicHJvcGVydHktcG9zaXRpb24iOiJvdXRzaWRlIiwicHJvcGVydHktY29sb3IiOiIjMDAwMDAwIiwicHJvcGVydHktZm9udC1zaXplIjoxNiwicHJvcGVydHktZm9udC13ZWlnaHQiOiJub3JtYWwifX0sImRpYWdyYW1OYW1lIjoiTkJBIEdyYXBoIn0=[here^]. 35 | 36 | .The NBA data model we used in the stream 37 | image::img\NBAGraph.png[] 38 | 39 | One of the questions that came up was rather than using the above model, why didn't we choose using `PLAYED_IN_AWAY` and `PLAYED_IN_HOME` relationship types instead. This is an option too - and if primarily the questions you are asking are around home/away matches, then this would give a slightly faster performance. 40 | 41 | To keep the data model as simple as possible, we decided to keep the relationship between `Team` and `Match` generic for now. We'll give an example query of how to bring back Home/Away teams shortly. 42 | 43 | ==== Loading the data 44 | 45 | One thing to bear about the data is the use of `_iscopy` property - you will spot that the rows 'repeat', but they are reflecting the view point of each of the teams, i.e. the home team as the primary team in the row, and the away team as the primary team. As a result, we can safely skip `_iscopy=1` when loading the data. 46 | 47 | image::img\img_data.png[] 48 | 49 | To load the data into the database, we use the following query: 50 | 51 | [source,cypher] 52 | ---- 53 | LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/fivethirtyeight/data/master/nba-elo/nbaallelo.csv" AS row 54 | //skipping doubles, also Aura Free limit of 50k nodes, ~ 100 teams 55 | WITH row LIMIT 99900 WHERE row._iscopy="0" 56 | MERGE (ht:Team {code:row.team_id}) 57 | ON CREATE SET ht.name = row.fran_id 58 | MERGE (at:Team {code:row.opp_id}) 59 | ON CREATE SET at.name = row.opp_fran 60 | CREATE (m:Match {id:row.game_id, venue:right(row.game_id, 3), date:row.date_game}) 61 | WITH ht, at, m, row.pts AS hpoints, row.opp_pts AS apoints, 62 | row.elo_i AS hse, row.elo_n AS hee, row.opp_elo_i AS ase, 63 | row.opp_elo_n AS aee 64 | CREATE (ht)-[:PLAYED_IN {points:hpoints, startElo:hse, endElo:hee}]->(m) 65 | CREATE (at)-[:PLAYED_IN {points:apoints, startElo:ase, endElo:aee}]->(m) 66 | ---- 67 | 68 | NOTE: When using `LOAD CSV`, integers and floats may be treated as strings. As a result, don't forget to check, especially if you get unexpected results, e.g. `row._iscopy="0"` versus `row._iscopy=0` 69 | 70 | ==== Querying the data 71 | 72 | Some of you may have spotted that all of our numerical data is being stored as strings. Whilst we could have sorted that at the load stage, we can also quickly handle it now. We're going to change points to integers, and Elo ratings to floats, found as properties in the `PLAYED_IN` relationships: 73 | 74 | [source,cypher] 75 | ---- 76 | MATCH ()-[r:PLAYED_IN]->() 77 | SET r.points = tointeger(r.points) 78 | SET r.startElo = tofloat(r.startElo) 79 | SET r.endElo = tofloat(r.endElo) 80 | ---- 81 | 82 | *Question 1 - Historical results between two teams* 83 | 84 | [source,cypher] 85 | ---- 86 | //Look at the Huskies/Knicks rivalries 87 | //Using the Match ID for the ISO 'format' date 88 | MATCH (t1:Team {code:"TRH"}) 89 | MATCH (t2:Team {code:"NYK"}) 90 | MATCH (t1)-[r1]->(m)<-[r2]-(t2) 91 | //Using the Match ID for the ISO 'format' date 92 | RETURN left(m.id, size(m.id)-4) AS Date, t1.name, t2.name, 93 | r1.points > r2.points AS `Huskies won`, m.venue ORDER BY Date 94 | ---- 95 | 96 | *Question 2 - The teams with the biggest Elo rating difference* 97 | 98 | [source,cypher] 99 | ---- 100 | MATCH (t:Team)-[r]->(m) 101 | WITH t.name AS name, min(r.endElo) AS lowestElo, max(r.endElo) AS highestElo 102 | WITH name, lowestElo, highestElo, highestElo - lowestElo AS diffElo 103 | RETURN name, lowestElo, highestElo, diffElo ORDER BY diffElo DESC 104 | ---- 105 | 106 | *Question 3 - Find out home/away matches* 107 | 108 | [source,cypher] 109 | ---- 110 | MATCH (t:Team {name:"Sixers"})-[r:PLAYED_IN]->(m:Match)<-[r2:PLAYED_IN]-(opp:Team) 111 | //match venue to team code for home matches, or <> for away matches 112 | WHERE m.venue = t.code 113 | RETURN left(m.id, size(m.id)-4) AS Date, opp.name AS `Played Home Against`, 114 | r.points + " - " + r2.points AS `Score` 115 | ---- 116 | 117 | *Question 4 - Can we predict results based on past experiences?* 118 | 119 | [source,cypher] 120 | ---- 121 | We'll come back to you on this one! Watch this space :) 122 | ---- 123 | -------------------------------------------------------------------------------- /week-10.adoc: -------------------------------------------------------------------------------- 1 | == Week 10 - Getting Dumps and Example Projects into Aura Free 2 | 3 | This week we spoke quickly about the https://neo4j.com/developer-blog/exploring-the-pandora-papers-with-neo4j/[ICIJ Pandora Papers^], which we'll look at in more detail when the data is released in one of the next weeks. 4 | 5 | The main topic was to explore the different ways of getting existing graph data into Aura from other Neo4j instances: 6 | 7 | . New: Built In Movies Database and Guide 8 | . Load a Dump from Neo4j Sandbox Backup 9 | . Load a Dump from a Neo4j Graph Example Repository 10 | . Load a Dump from Neo4j Desktop 11 | 12 | === New: Built In Movies Database and Guide 13 | 14 | Aura Free has a new option for the newly created database. 15 | Besides the default empty database you can also select one with the small Movies dataset. 16 | 17 | image::img/movies-db.png[] 18 | 19 | On opening Neo4j Browser it shows a introductory, interactive Neo4j Browser Guide that guides you through the basics of the graph model and the Cypher query language. 20 | 21 | Just make sure to connect to your database with your credentials after Neo4j-Browser opens. 22 | Click on `:server connect` if the connection dialogue doesn't open automatically. 23 | 24 | image::img/movies-guide.png[] 25 | 26 | === Load a Dump from Neo4j Sandbox Backup 27 | 28 | Sometimes you have already loaded or computed data into a https://neo4j.com/sandbox[Neo4j Sandbox^] e.g. via libraries or functions that are not available in Aura Free like https://neo4j.com/labs/apoc/[APOC-full^], https://neo4j.com/labs/neosemantics/[neosemantics (RDF)^], or https://neo4j.com/product/graph-data-science-library/[Graph Data Science^]. 29 | 30 | Then you can take a Backup in the Sandbox UI and after downloading it, load it into your newly created or existing Aura Database. 31 | 32 | In our example we loaded the https://blog.bruggen.com/2021/10/rebeergraph-importing-belgian-beergraph.html["Beer Graph" by Rik van Bruggen^] with `apoc.load.html` from a Wikipedia. 33 | 34 | The basic data model is: 35 | 36 | [source,cypher] 37 | ---- 38 | (BeerBrand)-[:IS_A]->(BeerType) 39 | (BeerBrand)<-[:BREWS]-(Brewery) 40 | (BeerBrand)-[:HAS_ALCOHOLPERCENTAGE]->(AlcoholPercentage) 41 | ---- 42 | 43 | Here is the code to load it. 44 | 45 | [source,cypher] 46 | ---- 47 | WITH "https://nl.wikipedia.org/wiki/Lijst_van_Belgische_bieren" as url 48 | CALL apoc.load.html(url, { 49 | brand: "table.wikitable tbody tr td:eq(0)", 50 | beertype: "table.wikitable tbody tr td:eq(1)", 51 | alcoholpercentage: "table.wikitable tbody tr td:eq(2)", 52 | brewery: "table.wikitable tbody tr td:eq(3)", 53 | timeframe: "table.wikitable tbody tr td:eq(4)" 54 | }) yield value 55 | WITH value, size(value.brand) as rangeup 56 | UNWIND range(0,rangeup) as i 57 | WITH value.brand[i].text as BeerBrand, value.brewery[i].text as Brewery, 58 | value.alcoholpercentage[i].text as AlcoholPercentage, 59 | value.beertype[i].text as BeerType, value.timeframe[i].text as Timeframe 60 | MERGE (bt:BeerType {name: coalesce(BeerType,"Unknown")}) 61 | MERGE (bb:BeerBrand {name: coalesce(BeerBrand,"Unknown")}) 62 | SET bb.Timeframe = coalesce(Timeframe,"Unknown") 63 | MERGE (br:Brewery {name: coalesce(Brewery,"Unknown")}) 64 | MERGE (ap:AlcoholPercentage {value: coalesce(AlcoholPercentage,"Unknown")}) 65 | MERGE (bb)-[:HAS_ALCOHOLPERCENTAGE]->(ap) 66 | MERGE (bb)-[:IS_A]->(bt) 67 | MERGE (bb)<-[:BREWS]-(br); 68 | ---- 69 | 70 | Afterwards we took the backup in the Sandbox UI, downloaded the dump file and then used the Aura Import UI to upload the dump. 71 | 72 | image::img/sandbox-backup.png[] 73 | 74 | It takes a few (10) minutes for the load to finish regardless of dump size as it's queued in the backend system. 75 | 76 | image::img/upload-dump.png[] 77 | 78 | === Load a Dump from a Neo4j Graph Example Repository 79 | 80 | All the sandbox datasets, with 81 | 82 | * browser guides, 83 | * example queries, 84 | * data models, 85 | * code examples (for Java, JavaScript, Python, .Net, Go and GraphQL) and also 86 | * data-dump files 87 | 88 | are available on the https://github.com/neo4j-graph-examples[GitHub organization neo4j-graph-examples^] 89 | 90 | In our case we used the https://github.com/neo4j-graph-examples/recommendations["Recommendations"^] that contains the https://grouplens.org/datasets/movielens/[MovieLens user-ratings dataset^] together with movie and actor/director data from https://themoviedb.org. 91 | 92 | The dataset consists of: 93 | 94 | * 28,863 nodes 95 | * 166,261 relationships 96 | 97 | which fit nicely into the limits of an Aura Free Instance (50k nodes, 175k relationshiops). 98 | 99 | So we download the Neo4j 4.3 dump file from the https://github.com/neo4j-graph-examples/recommendations/tree/main/data[GitHub repository folder^] and then upload it via the Aura UI as before. 100 | 101 | In your Aura Database you can then also use the Browser guide with: 102 | 103 | ---- 104 | :play https://guides.neo4j.com/sandbox/recommendations/index.html 105 | ---- 106 | 107 | image::img/recommendations-guide.png[] 108 | 109 | And run the https://github.com/neo4j-graph-examples/recommendations/tree/main/code[code examples^] from Sandbox (e.g. from a GitHub Codespace on a Fork of the Repository) against your Aura Free instance. 110 | 111 | image::img/codespace.png[] 112 | 113 | === Load a Dump from Neo4j Desktop 114 | 115 | You can also create a dump in Neo4j Desktop, just by selecting the "dump" Action from your database menu. 116 | 117 | image::img/desktop-dump.png[] 118 | 119 | Then the upload mechanism is the same as before. 120 | -------------------------------------------------------------------------------- /week-12.adoc: -------------------------------------------------------------------------------- 1 | == Week 12 - Importing Data from Relational Databases 2 | :img: img 3 | 4 | Many people that start out using Neo4j have existing data in relational databases that they want to import into the graph. 5 | Either because they want to explore data that they already know and look for new insights and capabilities. 6 | Or because that's the existing data that is to be migrated to a graph. 7 | 8 | In this instalment of "Discover AuraDB Free", we look at a few different way of getting data from relational databases into Neo4j. 9 | 10 | If you rather watch the video of our session 11 | 12 | To avoid teaching a new dataset we use the well known [Northwind dataset^] that has been around for many years as a common example for relational databases. 13 | It is a retail dataset with products, categories, orders, customers, shippers, suppliers and employees and their territories and regions. 14 | 15 | In a graph context we can use the existing data to compute recommendations based either on purchase behavior (of peer groups) aka collaborative filtering, we can do content based filtering with categories or look at sales efficiencies directly or across the employee hierarchy. 16 | 17 | Here are the relational and graph data model for this dataset. 18 | You see that the graph model can put away with the join table and models hierarchies directly. 19 | 20 | * TODO Relational Model 21 | * TODO Graph Model 22 | 23 | We want to explore 3 ways of importing the data: 24 | 25 | 1. Exporting CSV files from Postgres and importing them into Neo4j with `LOAD CSV` 26 | 2. Using the ETL Tool within Neo4j Desktop 27 | 3. Programmatically connecting to the relational database, here with Java and JDCB and writing the results with the Neo4j Driver to the graph. 28 | 29 | === Let's Get Started 30 | 31 | :db-name: Northwind 32 | 33 | include::connect-aura.adoc[leveloffset=+1] 34 | 35 | ==== Connect to Postgres 36 | 37 | Throughout the session we use a read-only postgres instance on AWS that has the following connection information 38 | 39 | * Host: db-examples.cmlvojdj5cci.us-east-1.rds.amazonaws.com 40 | * Schema: northwind 41 | * Username: n4examples 42 | * Password: 36gdOVABr3Ex 43 | 44 | We can install the psql utility or use the docker image to run it. 45 | 46 | Explore the data: 47 | 48 | [source,sql] 49 | ---- 50 | psql -u 51 | \dt 52 | select * from customers limit 5; 53 | ---- 54 | 55 | 56 | 57 | === Exporting and Importing CSV 58 | 59 | First we need to export the data as CSV, we cannot use the `COPY` command from postgres as we don't have admin permissions and cannot write to the filesystem of the server. 60 | 61 | But `psql` offer a `\copy` command that does the same and writes to our local filesystem. 62 | 63 | [source,shell] 64 | ---- 65 | \copy customers 66 | ---- 67 | 68 | Now we can take that CSV file and make it available for our Neo4j instance, we can either put it into a public/secret GitHub Gist, upload it to s3 or import it into a google sheet (and then use "Publish to the Web"). 69 | 70 | NOTE: If you don't have made a copy, you can use our public dataset URL: https://data.neo4j.com/northwind/customers.csv 71 | 72 | [opts="headers"] 73 | ,=== 74 | 75 | ,=== 76 | 77 | So with our public CSV URL we can now use LOAD CSV in Neo4j. 78 | 79 | [source,cypher] 80 | ---- 81 | LOAD CSV WITH HEADERS FROM "https://data.neo4j.com/customers.csv" AS row 82 | MERGE (c:Customer {CustomerID:row.CustomerID}) 83 | ON CREATE SET c += row 84 | ---- 85 | 86 | 1. the `LOAD CSV WITH HEADERS` clause turns all our CVS rows into a stream of maps. 87 | 2. we use the `CustomerID` field to `MERGE` our customer - nodes into the graph 88 | 3. then we `SET` the other properties 89 | 90 | We could have renamed each property and also converted the values to integer, float or boolean values. 91 | 92 | [source,cypher] 93 | ---- 94 | 95 | ---- 96 | 97 | 98 | === Using the ETL Tool with Neo4j Desktop 99 | 100 | Currently the Neo4j ETL Tool still requires the installation of Neo4j Desktop, so if you haven't please go ahead and install it from https://neo4j.com/download 101 | 102 | The process of getting started with Neo4j-ETL in Desktop is also describe in [this developer guide^] 103 | 104 | Within Desktop you need two things 105 | 106 | ==== Setup Remote Database 107 | 108 | First set up our Neo4j AuraDB as "Remote Database" in neo4j desktop 109 | 110 | 1. Open or create a new Project 111 | 2. Add a new "Remote Database" 112 | 3. Provide the connection URL 113 | 4. Choose Username/Password 114 | 5. Provide the username and password for the instance 115 | 6. Connect to the Instance 116 | 117 | You can then open Neo4j Browser in Desktop and should see your instance running. 118 | 119 | ==== Install Neo4j-ETL 120 | 121 | Then we need to install the "Graph-App" Neo4j-ETL-Tool from the sidebar 122 | 123 | 1. Click on Graph-App Gallery 124 | 2. Pick the Neo4j-ETL Install, you should be prompted for the installation 125 | 3. After succesful installation, open the Neo4j-ETL app 126 | 127 | ==== Setup Database connections/selection 128 | 129 | Then within the Neo4j-ETL app you do 130 | 131 | 1. Choose your project 132 | 2. Choose your Neo4j Database 133 | 3. Add a JDBC driver (connection information) for Postgres - Test should be successful 134 | 4. Click on "Start Mapping" 135 | 136 | It takes a while but should be successful after a minute at most. 137 | 138 | image::{img}/neo4j-etl-setup.png[] 139 | 140 | ==== Edit the Mapping 141 | 142 | After the mapping is loaded, it is shown in a meta-data graph view. 143 | There you can edit names of node labels, relationship types, or property keys. 144 | Or you can also choose to skip any of them. 145 | 146 | image::{img}/neo4j-etl-mapping.png[] 147 | 148 | When you're satisfied with your mapping, you can click the "Save Mapping" Button, that gets you to the import screen. 149 | 150 | ==== Import from RDBMS to Neo4j 151 | 152 | For a remote database you can only choose "Online Import". 153 | 154 | You can leave all other settings unchanged they are just for optimizations. 155 | 156 | After clicking "Import" it should 157 | 158 | 1. connect to Neo4j to create the constraints 159 | 2. connect to the RDBMS load the data 160 | 3. write the data to Neo4j 161 | 4. show summary statistics about the import 162 | 163 | You can see the logs with the "Open Logs" button. 164 | 165 | image::{img}/neo4j-etl-import.png[] 166 | 167 | === Using a Program to import data from the RDBMS (here Java) 168 | 169 | For simplicity we just demonstrate how to fetch the contents of a single table and write it to Neo4j. 170 | 171 | We use Java with JDBC to connect to Postgres but you can use any language/rdbms-driver/neo4j-driver. 172 | The principle stays the same. 173 | 174 | Here is the generic approach. 175 | After selecting the data from a table, we send it (in batches) to Neo4j to be inserted with a Cypher statement, where a parameter with a list of rows is turned back into actual rows and then `SET` on newly created nodes. 176 | 177 | To not have to set up a full blown project but just a script, we use https://jbang.dev[jbang^] to declare our dependencies (jdbc and neo4j driver) and execute the single file. 178 | 179 | TODO image 180 | 181 | Here is the annotated code: 182 | 183 | export JDBC_URL="jdbc:postgresql://db-examples.cmlvojdj5cci.us-east-1.rds.amazonaws.com/northwind?user=n4examples&password=36gdOVABr3Ex" 184 | 185 | [source,java] 186 | ---- 187 | ///usr/bin/env jbang "$0" "$@" ; exit $? 188 | //DEPS org.neo4j.driver:neo4j-java-driver:4.3. 189 | //DEPS org.postgresql:postgresql:42.2.24 190 | 191 | // export JDBC_URL="jdbc:postgresql://db-examples.cmlvojdj5cci.us-east-1.rds.amazonaws.com/northwind?user=n4examples&password=36gdOVABr3Ex" 192 | // export NEO4J_URL="neo4j+s://xxxx.databases.neo4j.io" 193 | // export NEO4J_PASSWORD="secret" 194 | // jbang rdbms2neo4j Customer 195 | 196 | import static java.lang.System.*; 197 | import java.sql.*; 198 | import java.util.*; 199 | import org.neo4j.driver.*; 200 | 201 | public class rdbms2neo4j { 202 | 203 | static final String INSERT_STATEMENT = "UNWIND $data AS row CREATE (n:`%s`) SET n = row"; 204 | static final int BATCH_SIZE = 10000; 205 | 206 | public static void main(String... args) throws Exception { 207 | String table=args[0]; 208 | String statement = String.format(INSERT_STATEMENT, table); 209 | try (Driver driver = GraphDatabase.driver(getenv("NEO4J_URL"), 210 | AuthTokens.basic("neo4j",getenv("NEO4J_PASSWORD"))); 211 | Session session = driver.session(); 212 | Connection con=DriverManager.getConnection(getenv("JDBC_URL")); 213 | Statement stmt=con.createStatement(); 214 | ResultSet rs=stmt.executeQuery("SELECT * FROM "+table)) { 215 | ResultSetMetaData meta=rs.getMetaData(); 216 | String[] cols=new String[meta.getColumnCount()]; 217 | for (int c=1;c<=cols.length;c++) 218 | cols[c-1]=meta.getColumnName(c); 219 | List> data = new ArrayList<>(); 220 | while (rs.next()) { 221 | Map row=new HashMap<>(cols.length); 222 | for (int c=1;c<=cols.length;c++) { 223 | // todo unsupported datatypes like BigDecimal 224 | row.put(cols[c-1], rs.getObject(c)); 225 | } 226 | data.add(row); 227 | if (data.size() == BATCH_SIZE) { 228 | session.writeTransaction( 229 | tx -> tx.run(statement, Collections.singletonMap("data", data)).consume()); 230 | data.clear(); 231 | } 232 | } 233 | if (!data.isEmpty()) { 234 | session.writeTransaction(tx -> 235 | tx.run(statement, Collections.singletonMap("data", data)).consume()); 236 | } 237 | } 238 | } 239 | } 240 | ---- 241 | 242 | 243 | === Other approaches 244 | 245 | There are many other approaches of loading data from relational databases into Neo4j. 246 | 247 | Here is an (incomplete) list: 248 | 249 | TODO links 250 | 251 | * Use Apache Spark to load, transform the relational data and the Neo4j Connector for Apache Spark to write to Neo4j 252 | * Use a CDC plugin like Debezium to gather changes in your RDMBS, send it to Kafka and use the Neo4j Connector for Apache Kafka to send the data to Neo4j 253 | * Apache Hop has full support for Neo4j, so you can gather data from any source and write it to Neo4j 254 | * GraphAware Hume offers complete data orchestration workflows 255 | * There is an Neo4j integration for Talend 256 | * Knime has a Neo4j plugin too 257 | 258 | -------------------------------------------------------------------------------- /week-2.adoc: -------------------------------------------------------------------------------- 1 | == Week 2 - The Board Game Geek data set 2 | 3 | In this week's episode, Lju and Alexander explore a scraped data set from Board Game Geek, from https://github.com/ThaWeatherman/scrapers/blob/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv[Sean Beck's Github repository^]. Catch-up on the episode now! 4 | 5 | 6 | .catch-up video 7 | [caption="Week 1 ",link=https://www.youtube.com/watch?v=0X1dmTO0RZQ^] 8 | image::https://i.ytimg.com/vi/0X1dmTO0RZQ/maxresdefault.jpg[] 9 | 10 | === Key links 11 | 12 | * https://dev.neo4j.com/discover-aura[Neo4j Aura landing page^] 13 | * https://github.com/ThaWeatherman/scrapers/blob/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv[Github repo for the Board Game Geek data^] 14 | * https://raw.githubusercontent.com/ThaWeatherman/scrapers/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv[Raw CSV^] 15 | * https://arrows.app[Arrows app^] 16 | * https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xNzcsInkiOi0xNTZ9LCJjYXB0aW9uIjoiIiwibGFiZWxzIjpbIkdhbWUiXSwicHJvcGVydGllcyI6eyJpZCI6IiIsIm5hbWUiOiIiLCJyYXRpbmciOiIiLCJwbGF5aW5nVGltZSI6IiIsIndlaWdodCI6IiJ9LCJzdHlsZSI6e319LHsiaWQiOiJuMSIsInBvc2l0aW9uIjp7IngiOjE2NiwieSI6LTE1Nn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiUGxheWVyQ291bnQiXSwicHJvcGVydGllcyI6eyJ2YWx1ZSI6IiJ9LCJzdHlsZSI6e319XSwicmVsYXRpb25zaGlwcyI6W3siaWQiOiJuMCIsImZyb21JZCI6Im4wIiwidG9JZCI6Im4xIiwidHlwZSI6Ik1BWF9QTEFZRVIiLCJwcm9wZXJ0aWVzIjp7fSwic3R5bGUiOnt9fSx7ImlkIjoibjEiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMSIsInR5cGUiOiJNSU5fUExBWUVSIiwicHJvcGVydGllcyI6e30sInN0eWxlIjp7fX1dLCJzdHlsZSI6eyJub2RlLWNvbG9yIjoiI2ZmZmZmZiIsImJvcmRlci13aWR0aCI6NCwiYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInJhZGl1cyI6NTAsIm5vZGUtcGFkZGluZyI6NSwibm9kZS1tYXJnaW4iOjIsIm91dHNpZGUtcG9zaXRpb24iOiJhdXRvIiwiY2FwdGlvbi1wb3NpdGlvbiI6Imluc2lkZSIsImNhcHRpb24tbWF4LXdpZHRoIjoyMDAsImNhcHRpb24tY29sb3IiOiIjMDAwMDAwIiwiY2FwdGlvbi1mb250LXNpemUiOjUwLCJjYXB0aW9uLWZvbnQtd2VpZ2h0Ijoibm9ybWFsIiwibGFiZWwtcG9zaXRpb24iOiJpbnNpZGUiLCJsYWJlbC1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsImxhYmVsLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1ib3JkZXItd2lkdGgiOjQsImxhYmVsLWZvbnQtc2l6ZSI6NDAsImxhYmVsLXBhZGRpbmciOjUsImxhYmVsLW1hcmdpbiI6NCwiZGlyZWN0aW9uYWxpdHkiOiJkaXJlY3RlZCIsImRldGFpbC1wb3NpdGlvbiI6ImlubGluZSIsImRldGFpbC1vcmllbnRhdGlvbiI6InBhcmFsbGVsIiwiYXJyb3ctd2lkdGgiOjUsImFycm93LWNvbG9yIjoiIzAwMDAwMCIsIm1hcmdpbi1zdGFydCI6NSwibWFyZ2luLWVuZCI6NSwibWFyZ2luLXBlZXIiOjIwLCJhdHRhY2htZW50LXN0YXJ0Ijoibm9ybWFsIiwiYXR0YWNobWVudC1lbmQiOiJub3JtYWwiLCJ0eXBlLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJ0eXBlLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJvcmRlci13aWR0aCI6MCwidHlwZS1mb250LXNpemUiOjE2LCJ0eXBlLXBhZGRpbmciOjUsInByb3BlcnR5LXBvc2l0aW9uIjoib3V0c2lkZSIsInByb3BlcnR5LWNvbG9yIjoiIzAwMDAwMCIsInByb3BlcnR5LWZvbnQtc2l6ZSI6MTYsInByb3BlcnR5LWZvbnQtd2VpZ2h0Ijoibm9ybWFsIn19LCJkaWFncmFtTmFtZSI6IkJvYXJkIEdhbWUgR2VlayJ9[Data model from the session^] 17 | 18 | ==== The data set 19 | 20 | This week we explored a scraped dataset from https://boardgamegeek.com/browse/boardgame[Board Game Geek^]. The data consisted of games, ratings, complexity ratings, number of players, playing time, and so forth. 21 | 22 | As we're keen to continue with the theme of 'no download', Alexander managed to locate a cut of data on https://github.com/ThaWeatherman/scrapers/blob/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv[Sean Beck's public Github repository^], which we use in this session. 23 | 24 | image::img\bb_csv.png[] 25 | 26 | ==== The questions 27 | 28 | The following questions for the data set came up during the stream: 29 | 30 | * What are the top rated games and what they are called? 31 | * What games that are most popular? 32 | * What games are available for x players with complexity of y? 33 | * What games can I play with x friends which require at least y minutes? 34 | 35 | === The data model 36 | 37 | You can view and play with the data model in Arrows App https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xNzcsInkiOi0xNTZ9LCJjYXB0aW9uIjoiIiwibGFiZWxzIjpbIkdhbWUiXSwicHJvcGVydGllcyI6eyJpZCI6IiIsIm5hbWUiOiIiLCJyYXRpbmciOiIiLCJwbGF5aW5nVGltZSI6IiIsIndlaWdodCI6IiJ9LCJzdHlsZSI6e319LHsiaWQiOiJuMSIsInBvc2l0aW9uIjp7IngiOjE2NiwieSI6LTE1Nn0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiUGxheWVyQ291bnQiXSwicHJvcGVydGllcyI6eyJ2YWx1ZSI6IiJ9LCJzdHlsZSI6e319XSwicmVsYXRpb25zaGlwcyI6W3siaWQiOiJuMCIsImZyb21JZCI6Im4wIiwidG9JZCI6Im4xIiwidHlwZSI6Ik1BWF9QTEFZRVIiLCJwcm9wZXJ0aWVzIjp7fSwic3R5bGUiOnt9fSx7ImlkIjoibjEiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMSIsInR5cGUiOiJNSU5fUExBWUVSIiwicHJvcGVydGllcyI6e30sInN0eWxlIjp7fX1dLCJzdHlsZSI6eyJub2RlLWNvbG9yIjoiI2ZmZmZmZiIsImJvcmRlci13aWR0aCI6NCwiYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInJhZGl1cyI6NTAsIm5vZGUtcGFkZGluZyI6NSwibm9kZS1tYXJnaW4iOjIsIm91dHNpZGUtcG9zaXRpb24iOiJhdXRvIiwiY2FwdGlvbi1wb3NpdGlvbiI6Imluc2lkZSIsImNhcHRpb24tbWF4LXdpZHRoIjoyMDAsImNhcHRpb24tY29sb3IiOiIjMDAwMDAwIiwiY2FwdGlvbi1mb250LXNpemUiOjUwLCJjYXB0aW9uLWZvbnQtd2VpZ2h0Ijoibm9ybWFsIiwibGFiZWwtcG9zaXRpb24iOiJpbnNpZGUiLCJsYWJlbC1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsImxhYmVsLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1ib3JkZXItd2lkdGgiOjQsImxhYmVsLWZvbnQtc2l6ZSI6NDAsImxhYmVsLXBhZGRpbmciOjUsImxhYmVsLW1hcmdpbiI6NCwiZGlyZWN0aW9uYWxpdHkiOiJkaXJlY3RlZCIsImRldGFpbC1wb3NpdGlvbiI6ImlubGluZSIsImRldGFpbC1vcmllbnRhdGlvbiI6InBhcmFsbGVsIiwiYXJyb3ctd2lkdGgiOjUsImFycm93LWNvbG9yIjoiIzAwMDAwMCIsIm1hcmdpbi1zdGFydCI6NSwibWFyZ2luLWVuZCI6NSwibWFyZ2luLXBlZXIiOjIwLCJhdHRhY2htZW50LXN0YXJ0Ijoibm9ybWFsIiwiYXR0YWNobWVudC1lbmQiOiJub3JtYWwiLCJ0eXBlLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJ0eXBlLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJvcmRlci13aWR0aCI6MCwidHlwZS1mb250LXNpemUiOjE2LCJ0eXBlLXBhZGRpbmciOjUsInByb3BlcnR5LXBvc2l0aW9uIjoib3V0c2lkZSIsInByb3BlcnR5LWNvbG9yIjoiIzAwMDAwMCIsInByb3BlcnR5LWZvbnQtc2l6ZSI6MTYsInByb3BlcnR5LWZvbnQtd2VpZ2h0Ijoibm9ybWFsIn19LCJkaWFncmFtTmFtZSI6IkJvYXJkIEdhbWUgR2VlayJ9[here^]. 38 | 39 | .The Board Game Geek model we used in the stream 40 | 41 | image:img\bbgmodel.png[] 42 | 43 | Based on the questions we're looking to answer, we're interested in the following fields in the CSV: 44 | 45 | * Game name and id 46 | * Rating 47 | * Min and max playeers 48 | * Game playing time 49 | * Game complexity/weight 50 | * Number of users who rated the game (we forgot to add this in the stream! We will revisit this data set and add it accordingly) 51 | 52 | This was a bumper session for modelling decisions! Based on the questions, we could have easily just had a single `Game` node, with all the mentioned fields as properties. There are a couple of issues with this: 53 | 54 | * Firstly, it wouldn't be a very graphy graph! We'd have a lot of lonely nodes :) 55 | * Secondly, we need to think about what questions we are asking - we've got questions that ask about games based on number of players - and as a general rule of thumb when thinking if something is a node/relationship/property - if we use something a lot, it's probably going to be a node 56 | 57 | In the end, as we are interested in games around player count, as well as identifying that player count are discrete values, this is what lead to the chosen model. This is by no means a complete job! We still need to think about playing time, weight and rating, and we may well decide that those shouldn't live on `Game`. But for brevity, we ran with this model during the session. 58 | 59 | ==== Loading the data 60 | 61 | To load the data into the database, we use the following query: 62 | 63 | [source,cypher] 64 | ---- 65 | LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/ThaWeatherman/scrapers/b8757711296703356891f8f4e7757de6698a6b5b/boardgamegeek/games.csv" AS ROW 66 | WITH ROW WHERE tointeger(row.playingtime) > 9 67 | AND tointeger(row.playingtime) <61 68 | CREATE (g:Game {name:row.name, weight:tofloat(row.average_weight), 69 | rating:tofloat(row.average_rating), 70 | playingTime:tointeger(row.playingtime), id:row.id}) 71 | MERGE (pmin:PlayerCount {value:tointeger(row.minplayers)}) 72 | MERGE (pmax:PlayerCount {value:tointeger(row.maxplayers)}) 73 | WITH g, pmin, pmax 74 | CREATE (g)-[:HAS_MIN_PLAYERS]->(pmin) 75 | CREATE (g)-[:HAS_MAX_PLAYERS]->(pmax) 76 | ---- 77 | 78 | Bearing in mind the 50k node limit in Aura Free, we decided to limit the games loaded based on playing time of between 10 and 60 minutes. 79 | 80 | ==== Querying the data 81 | 82 | Whereas last week we cast strings to integers and floats after we loaded the data, this week, we did it whilst loading the data. You can see what we did in the load query. 83 | 84 | *Question 1 - What are the top rated games and what they are called?* 85 | 86 | [source,cypher] 87 | ---- 88 | MATCH (g:Game) 89 | RETURN g.name, g.rating 90 | ORDER BY g.rating DESC LIMIT 10 91 | ---- 92 | 93 | *Question 2 - What games that are most popular?* 94 | 95 | We forgot to load the data for this, so we'll come back to this in a future episode! You are, of course, welcome to import the data (field name: `users_rated`) and have a go yourself! 96 | 97 | *Question 3 - What games are available for x players with complexity of y?* 98 | 99 | [source,cypher] 100 | ---- 101 | WITH 4 AS complexity, 3 AS min, 5 AS max 102 | MATCH (g:Game)-[:HAS_MIN_PLAYERS]->(pcmin:PlayerCount), 103 | (g)-[:HAS_MAX_PLAYERS]->(pcmax:PlayerCount) 104 | WHERE g.weight >= complexity AND pcmin.value <= max 105 | AND pcmax.value >= min 106 | RETURN g.name AS name, g.weight AS complexity, 107 | [pcmin.value, pcmax.value] AS `player range` 108 | ORDER BY complexity 109 | ---- 110 | 111 | NOTE: We've corrected the query as it was flagged that the query put together on the stream would miss certain games! 112 | 113 | *Question 4 - What games can I play with x friends which require at least y minutes?* 114 | 115 | [source,cypher] 116 | ---- 117 | WITH 30 AS playingTime, 2 AS min, 2 AS max 118 | MATCH (g:Game)-[:HAS_MIN_PLAYERS]->(pcmin:PlayerCount), 119 | (g)-[:HAS_MAX_PLAYERS]->(pcmax:PlayerCount) 120 | WHERE g.playingTime >= playingTime AND pcmin.value <= max 121 | AND pcmax.value >= min 122 | RETURN g.name AS name, g.playingTime AS `playing time`, 123 | [pcmin.value, pcmax.value] AS `player range` 124 | ORDER BY `playing time` 125 | ---- 126 | -------------------------------------------------------------------------------- /week-20.adoc: -------------------------------------------------------------------------------- 1 | == Week 20 - Discover AuraDB Free - World Borders 2 | 3 | -------------------------------------------------------------------------------- /week-21.adoc: -------------------------------------------------------------------------------- 1 | == Week 21 - Gas Pipelines in Europe 2 | 3 | Our partners from Graphileon shared a tweet last week, demonstrating the European Gas Pipeline network in a graph. 4 | 5 | image::https://pbs.twimg.com/media/FNJPh5kXwAggOs8.jpg[] 6 | 7 | As this topic is very current with the massive dependency of Europe of (Russian) fossil fuels, we thought it would be good to reproduce parts of their example on AuraDB Free while using Neodash the amazing Neo4j Dashboarding tool to query and visualize some of the data. 8 | 9 | If you missed our live session, here is the recording: 10 | 11 | https://www.youtube.com/watch?t=923&v=nKApOdFmGLc&feature=youtu.be 12 | 13 | 14 | === Dataset 15 | 16 | The data comes from the German Space Agency (DLR) which has a project for extracting actual data for pipelines and consumers, producer and junctions from published PDF documents. 17 | 18 | * Paper 19 | * Datasets 20 | 21 | The datasets contain much more and more detailed data than we're looking at today, there is information on power plants, well, LNG terminals, refineries and much more. 22 | 23 | Our subset of 2000 pipeline segments across Europe is a good fit to demonstrate the data model, use the geospatial support in Neo4j and demonstrate map visualizations. 24 | 25 | Our colleague Niels de Jong who is also the Author of Neodash provided a subset of the 26 | 27 | 28 | === Data Import 29 | 30 | [source,cypher] 31 | ---- 32 | LOAD CSV WITH HEADERS from 'https://gist.githubusercontent.com/nielsdejong/dd8bdfb34d970c7392212aa4bb785478/raw/09412079f0a3982dd89cbe06a36edc428b05e01e/gistfile1.txt' as row 33 | FIELDTERMINATOR ';' 34 | WITH row.id as id, 35 | row.name as name, 36 | apoc.convert.fromJsonList(row.node_id) as nodes, 37 | apoc.convert.fromJsonList(row.lat) as lats, 38 | apoc.convert.fromJsonList(row.long) as longs, 39 | apoc.convert.fromJsonList(row.country_code) as countries, 40 | apoc.convert.fromJsonMap(replace(row.param,'None','null')) as params 41 | 42 | MERGE (s:Junction {id:nodes[0]}) ON CREATE SET s.loc=point({latitude:lats[0], longitude: longs[0]}), s.country = countries[0] 43 | MERGE (e:Junction {id:nodes[1]}) ON CREATE SET e.loc=point({latitude:lats[1], longitude: longs[1]}), e.country = countries[1] 44 | MERGE (s)-[p:PIPE {id:id}]->(e) 45 | ON CREATE SET p.name = name 46 | SET p += params 47 | ---- 48 | 49 | === Querying 50 | 51 | 52 | === Dashboarding 53 | 54 | This is where the fun starts, we can take some of our existing queries and put them easily into a dashboard. 55 | 56 | . Go to https://neodash.graphapp.io and create a new dashboard 57 | . Add your connection URL, username (neo4j) and password 58 | . Then you can hit the (+) sign to add new reports on the dashboard 59 | 60 | We're starting with a simple table that just shows our query results: 61 | 62 | [source,cypher] 63 | ---- 64 | MATCH (start:Junction)-[pipe:PIPE]->(end:Junction) 65 | RETURN start.id, start.country, end.id, end.country, pipe.id, pipe.start_year, pipe.length_km, pipe.capacity ...; 66 | ORDER BY pipe.length_km DESC; 67 | ---- 68 | 69 | 70 | Our next dashboard is a bar chart, that aggregate some pipe information that end up in a country, we use this query: 71 | 72 | [source,cypher] 73 | ---- 74 | MATCH (start:Junction)-[pipe:PIPE]->(end:Junction) 75 | RETURN end.country, count(*) as pipes, sum(pipe.length_km) as length, sum(pipe.capacot) as cap; 76 | ORDER BY pipes DESC; 77 | ---- 78 | 79 | image::[] 80 | 81 | 82 | The final dashboard is a map, that puts our data on a map of the European countries. 83 | 84 | As the total volume of 2000 datapoints is a bit too much for the map visualization it would be cut off at 1000. 85 | 86 | So we could either add a limit which would then give us a subset of the whole data, or alternatively we could limit the data to a single country, by using the parameters field `{"country":"DE"}`. 87 | 88 | As our nodes have the location data, they are automatically correctly rendered on the map and the pipes in between them. 89 | 90 | [source,cypher] 91 | ---- 92 | MATCH (start:Junction)-[pipe:PIPE]->(end:Junction) 93 | WHERE start.country = $country OR end.country = $country 94 | RETURN start, pipe, end 95 | ---- 96 | 97 | What's nice is that we can select a label for the markers on the map dynamically from the properties of the nodes returned. 98 | 99 | image::[] 100 | 101 | A really neat feature is the parameter selector, if you pick that report type, you can select a node-label and property to be shown in a drop-down and then provided to all reports on the page, in our case we want to pick the country, so we choose `Junction` and `country`. 102 | 103 | image::[] 104 | 105 | Now we can use `$neodash_junction_country` as parameter in all our dashboards with a where clause like: `WHERE n.country = $neodash_junction_country`. 106 | 107 | And now whenever we pick a different country from the drop down, all our reports and even the map visualization are re-drawn for that country. 108 | 109 | === Conclusion 110 | 111 | 112 | === References 113 | 114 | * https://neo4j.com/aura[Neo4j AuraDB Free^] 115 | * https://neo4j.com/video/discover-aura-free-with-fun-datasets/[Discover AuraDB Free with Fun Datasets Videos^] 116 | * https://github.com/neo4j-examples/discoveraurafree[GitHub Repository^] 117 | * -------------------------------------------------------------------------------- /week-22.adoc: -------------------------------------------------------------------------------- 1 | == Week 22 - Opencorporates 2 | 3 | OpenCorporates is a World registry of corporations (200M) and their officiers 4 | 5 | 6 | It also offers an API, some of which is accessible without API-Keys, for other parts you need an API key. 7 | 8 | === Data Model 9 | 10 | 11 | === Data Import 12 | 13 | [source,cypher] 14 | ---- 15 | call apoc.load.json("https://api.opencorporates.com/companies/us_az/23128533") yield value 16 | with value.results.company as c 17 | return c { .company_number, .jurisdiction_code, .name, .current_status, .incorporation_date, .opencorporates_url, .company_type, .alternative_names, .registered_address, .registered_address_in_full, .number_of_employees, officers: [o2 IN [o IN c.officers | o.officer] | o2 { .name, .position, .id}], industries: [ic in c.industry_codes | ic.description] } 18 | ---- 19 | 20 | 21 | 22 | 23 | call apoc.load.json("https://api.opencorporates.com/v0.4/companies/search?q=exxon+mobil¤t_status=Active&api_token=crzQoOUbuYdltKxV4nxJ") yield value 24 | unwind value.results.companies as result 25 | with result.company as c 26 | return c { .company_number, .jurisdiction_code, .name, .current_status, .incorporation_date, .opencorporates_url, .company_type, .alternative_names, .registered_address, .registered_address_in_full, .number_of_employees, officers: [o2 IN [o IN c.officers | o.officer] | o2 { .name, .position, .id}], industries: [ic in c.industry_codes | ic.description] } 27 | 28 | 29 | 30 | match (comp:Company) where comp.id = 202031010244 31 | 32 | call apoc.load.json("https://api.opencorporates.com/companies/"+comp.jurisdiction_code+"/"+comp.company_number) yield value 33 | with value.results.company as c 34 | 35 | with c { .company_number, .jurisdiction_code, .name, .current_status, .incorporation_date, .opencorporates_url, .company_type, .alternative_names, .registered_address, .registered_address_in_full, .number_of_employees, officers: [o2 IN [o IN c.officers | o.officer] | o2 { .name, .position, .id}], industries: [ic in c.industry_codes | ic.description] } as data 36 | 37 | MERGE (c:Company { company_number: data.company_number, jurisdiction_code: data.jurisdiction_code }) 38 | ON CREATE SET c += data { .name, .current_status, .incorporation_date, .opencorporates_url, .company_type, .alternative_names, .number_of_employees } 39 | 40 | FOREACH (d in data.officers | 41 | MERGE (o:Officer { id: d.id }) 42 | ON CREATE SET o.name = d.name 43 | MERGE (c)-[:OFFICER {position:d.position}]->(o) 44 | ) 45 | 46 | FOREACH (name in data.industries | 47 | MERGE (i:Industry { name: name}) 48 | MERGE (c)-[:INDUSTRY]->(i) 49 | ) 50 | 51 | WITH * WHERE NOT data.registered_address_in_full IS null 52 | MERGE (a:Address {address: data.registered_address_in_full}) 53 | MERGE (c)-[:REGISTERED]->(a) 54 | 55 | // apoc.text.join([data.registered_address.street_address, data.registered_address.locality, data.registered_address..region, data.registered_address.postal_code],', ') 56 | 57 | 58 | https://neo4j.com/labs/apoc/4.1/graph-updates/graph-refactoring/merge-nodes/ 59 | 60 | match (o:Officer) 61 | WITH o.name as name, collect(o) as nodes 62 | WHERE size(nodes) > 1 63 | call apoc.refactor.mergeNodes(nodes, {mergeRels:false, properties: { 64 | name:'discard', 65 | id:'combine', 66 | position:'combine'}, singleElementAsArray:true}) yield node 67 | return node; 68 | 69 | 70 | 71 | match (comp:Company) where comp.id = 202031010244 72 | 73 | call apoc.load.json("https://api.opencorporates.com/companies/"+comp.jurisdiction_code+"/"+comp.company_number) yield value 74 | with value.results.company as c 75 | return c { .company_number, .jurisdiction_code, .name, .current_status, .incorporation_date, .opencorporates_url, .company_type, .alternative_names, .registered_address, .registered_address_in_full, .number_of_employees, officers: [o2 IN [o IN c.officers | o.officer] | o2 { .name, .position, .id}], industries: [ic in c.industry_codes | ic.description] } 76 | 77 | === Exploration 78 | 79 | 80 | call apoc.load.json("https://api.opencorporates.com/v0.4/companies/search?q=Petrobras¤t_status=Active&api_token=crzQoOUbuYdltKxV4nxJ") yield value 81 | unwind value.results.companies as c1 82 | with c1.company as c 83 | 84 | MERGE (comp:Company {company_number: c.company_number, jurisdiction_code: c.jurisdiction_code}) 85 | ON CREATE SET comp += c {.company_type, .name, .current_status, .incorporation_date} 86 | 87 | WITH * WHERE NOT c.registered_address_in_full IS NULL 88 | 89 | MERGE (a:Address {address:c.registered_address_in_full}) 90 | ON CREATE SET a += c.registered_address 91 | MERGE (comp)-[:REGISTERED]->(a) 92 | /* 93 | UNWIND c.officers as o 94 | MERGE (off:Officer {id:o.officer.id}) 95 | ON CREATE SET off.name = o.officer.name 96 | 97 | MERGE (comp)-[:OFFICER {position:o.officer.position}]->(off) 98 | */ 99 | 100 | // also example for enriching existing graph data with new 101 | 102 | MATCH (comp:Company) 103 | WHERE not exists { (comp)-[:OFFICER]->() } 104 | WITH comp LIMIT 5 105 | 106 | call apoc.load.json("https://api.opencorporates.com/companies/"+comp.jurisdiction_code+"/"+comp.company_number) yield value 107 | with comp, value.results.company as c 108 | 109 | UNWIND c.officers as o 110 | MERGE (off:Officer {id:o.officer.id}) 111 | ON CREATE SET off.name = o.officer.name 112 | 113 | MERGE (comp)-[:OFFICER {position:coalesce(o.officer.position,"unknown")}]->(off) 114 | 115 | // spacex https://api.opencorporates.com/companies/us_az/23128533 116 | https://opencorporates.com/companies/us_az/23128533 117 | 118 | API docs https://api.opencorporates.com/documentation/API-Reference 119 | 120 | 121 | 122 | // exxon https://api.opencorporates.com/companies/us_or/1175827 123 | blowout: http://www.rachelmaddow.com/blowout-by-rachel-maddow/ 124 | 125 | // company search 126 | https://api.opencorporates.com/v0.4/companies/search?q=exxon+mobil 127 | 128 | 129 | oil companies: https://en.wikipedia.org/wiki/List_of_largest_oil_and_gas_companies_by_revenue 130 | 131 | sanctions https://en.wikipedia.org/wiki/List_of_people_and_organizations_sanctioned_during_the_Russo-Ukrainian_War 132 | 133 | == Graph Refactoring 134 | 135 | merge nodes: 136 | https://neo4j.com/labs/apoc/4.1/graph-updates/graph-refactoring/merge-nodes/ -------------------------------------------------------------------------------- /week-23.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/week-23.adoc -------------------------------------------------------------------------------- /week-25-european-song-contest.adoc: -------------------------------------------------------------------------------- 1 | == Week 25 European Song Contest 2022 2 | :imagesdir: img 3 | 4 | Inspiration: https://twitter.com/sundellviz/status/1525621965234524161 5 | 6 | 7 | Winner of the hearts of Europeans - Stefania - Ukraine 8 | 9 | https://www.youtube.com/watch?v=UiEGVYOruLk 10 | 11 | 12 | source: https://www.kaggle.com/datasets/datagraver/eurovision-song-contest-scores-19752019 13 | 14 | source 2021, 2022: 15 | https://eurovisionworld.com/eurovision/2021 16 | https://eurovisionworld.com/eurovision/2022 17 | 18 | -> https://pix.eurovisionworld.com/scripts/js/voting/130.js 19 | -> https://static.eurovisionworld.com/js/voting/140.js 20 | 21 | 22 | image::esc-2022-gt15.png[] 23 | -------------------------------------------------------------------------------- /week-28-graphconnect-audience.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/week-28-graphconnect-audience.adoc -------------------------------------------------------------------------------- /week-29-cybersecurity.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/week-29-cybersecurity.adoc -------------------------------------------------------------------------------- /week-30-airbnb-listings.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/week-30-airbnb-listings.adoc -------------------------------------------------------------------------------- /week-31-london-underground.adoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j-examples/discoveraurafree/fc19b3ddfba1026ecab83d541216ba994bde6cde/week-31-london-underground.adoc -------------------------------------------------------------------------------- /week-33-podcasts.adoc: -------------------------------------------------------------------------------- 1 | == Week 33 - Discover Aura Free - Podcasts from Player.FM 2 | 3 | youtube part 1: https://www.youtube.com/watch?v=mElVtSx1960 4 | youtube part 2: https://www.youtube.com/watch?v=Ck1zHMqu6M4 5 | 6 | https://player.fm/# 7 | 8 | https://99percentinvisible.org/episode/bleep/ 9 | 10 | 11 | https://player.fm/series/the-naked-scientists-podcast-96514 12 | 13 | https://player.fm/campaigns/active.json 14 | 15 | 16 | https://player.fm/series/99-invisible 17 | 18 | https://player.fm/series/99-invisible.json 19 | 20 | html to parse out: 21 | https://player.fm/en/featured/architecture/episodes?active=true&limit=50&offset=0&order=newest&query=undefined&style=list&container=false 22 | 23 | data for architecture and in general csvs 24 | https://gist.github.com/jexp/5c37d7df05ae76a27207e7402520fe1f 25 | 26 | architecture.tsv raw: https://gist.githubusercontent.com/jexp/5c37d7df05ae76a27207e7402520fe1f/raw/architecture.tsv 27 | 28 | podcast-urls raw: https://gist.githubusercontent.com/jexp/5c37d7df05ae76a27207e7402520fe1f/raw/podcast-urls.txt 29 | 30 | 31 | https://player.fm/series/99-invisible.json?detail=full&episode_detail=full&episode_offset=0&episode_order=newest&episode_limit=1000&at=1618384123&experiment_detail=full 32 | 33 | -------------------------------------------------------------------------------- /week-34-citations.adoc: -------------------------------------------------------------------------------- 1 | == Week 34 - Discover Aura Free - Citations 2 | :imagesdir: img 3 | 4 | Tweet OpenCitations 5 | https://twitter.com/cthoyt/status/1565972892642320386 6 | 7 | Download - Unfortunately Too Large 8 | http://opencitations.net/download#ccc 9 | 10 | Citation data (CSV) ZIP 221.8 GB (34.81 GB zipped) 11 | 12 | Search https://opencitations.net/search?text=database&rule=any_text 13 | 14 | image::opencitations-search.png[] 15 | 16 | image::opencitations-single.png[] 17 | 18 | Health Ecco Paper: 19 | https://healthecco.org/ 20 | 21 | 22 | Remembered Citations Network from Graph Algorithms Book 23 | 24 | https://www.oreilly.com/library/view/graph-algorithms/9781492047674/ 25 | 26 | TODO book image: 27 | 28 | see also Link Prediction Data Science Guides 29 | 30 | https://neo4j.com/developer/graph-data-science/link-prediction/scikit-learn/ 31 | 32 | image::https://neo4j.com/developer/graph-data-science/_images/citation-graph.png[] 33 | 34 | 35 | Import there is form DBLP JSON 36 | 37 | > In this guide, we’re going to use data from the DBLP Citation Network, which includes citation data from various academic sources. The full dataset is very large, but we’re going to use a subset that contains data from a few Software Development Conferences. 38 | 39 | https://neo4j.com/developer/graph-data-science/link-prediction/scikit-learn/#citation-graph 40 | 41 | https://github.com/neo4j-examples/link-prediction/blob/master/notebooks/01_DataLoading.ipynb 42 | 43 | Source: https://www.aminer.org/citation 44 | 45 | .Citation Network 46 | image::https://neo4j.com/developer/graph-data-science/_images/citation-graph-imported.svg[] 47 | 48 | .Co-Authors 49 | image::https://neo4j.com/developer/graph-data-science/_images/co-author-graph.svg[] 50 | 51 | == Nature Co-Cited Graphs 52 | 53 | Video: https://www.youtube.com/watch?v=GW4s58u8PZo 54 | 55 | Visualization: https://www.nature.com/immersive/d41586-019-03165-4/index.html 56 | 57 | image::citations-nature-visualization.png[] 58 | 59 | Data Download: https://www.nature.com/immersive/d41586-019-03165-4/dat/data.zip 60 | 61 | Gist For Loading via APOC: https://gist.github.com/jexp/54500b691a5f9a13e024b9a7aeaa3f5f 62 | 63 | Data Importer 64 | 65 | 66 | image::citations-nature-data-importer.png[] 67 | 68 | Explore 69 | 70 | image::citations-nature-explore.png[] 71 | 72 | Query: 73 | 74 | image::citations-nature-query.png[] 75 | 76 | 3d-force graph: https://github.com/jexp/neo4j-3d-force-graph 77 | -------------------------------------------------------------------------------- /week-35-nodes-sessions.adoc: -------------------------------------------------------------------------------- 1 | == Week 35 - Discover AuraDB Free - NODES Sessions 2 | :imagesdir: img 3 | :db-name: Nodes Sessions 4 | 5 | We're really excited and looking forward to our annual online developer conference NODES 2022 on Nov 16/17. 6 | 7 | The event will run around the Globe with talks in all timezones. 8 | 9 | You can https://neo4j.com/nodes-2022[save your spot now^], by registering to be early for some of the cool goodies that are coming your way. 10 | 11 | image::nodes-promo.png[link=https://neo4j.com/nodes-2022] 12 | 13 | We ran our Call for Papers in August and got 150 really great submissions by 130 speakers. 14 | 15 | We selected 90 for the event, which was really not easy. 16 | Some of the sessions that didn't make it for the conference will be run in later live streams. 17 | 18 | Today, let's look at the NODES data model and import the data for sessions and speakers into Neo4j from CSV. 19 | 20 | If you rather want to watch the video of the live stream, here you go: 21 | 22 | https://www.youtube.com/watch?v=NYYRmLmlO2M 23 | 24 | Next time we'll import the data from a REST API, look at the schedule and session recommendations. 25 | 26 | Let's start by creating and connecting to our AuraDB Free instance. 27 | 28 | If you want to try out the *Workspace Beta* too and provide feedback, please go to https://neo4j.com/product/workspace and sign up. 29 | 30 | include::connect-aura.adoc[] 31 | 32 | === Source Data from Sessionize 33 | 34 | Sessionize offers both an JSON REST API to fetch the data as well as export as CSV/XLS. 35 | 36 | We saved the CSV for sessions and speakers locally and can use it with Data Importer in Workspace. 37 | 38 | image::nodes-sessionize-export-csv.png[] 39 | 40 | The fields in our Session CSV are 41 | 42 | * Session Id 43 | * Title 44 | * Description 45 | * Speakers 46 | * Session format 47 | * Level 48 | * Pre-requisites for attendees? 49 | * Topic of your presentation 50 | * Neo4j Use-Case 51 | * Your Timezone 52 | * Status 53 | * Date Submitted 54 | * Speaker Ids 55 | 56 | The fields for our Speakers: 57 | 58 | * Speaker Id 59 | * FirstName 60 | * LastName 61 | * TagLine 62 | * Bio 63 | * timezone 64 | * City 65 | * Country 66 | * Ninja 67 | * LinkedIn 68 | * Blog 69 | * Twitter 70 | * Company Website 71 | * Profile Picture 72 | 73 | // https://docs.google.com/spreadsheets/d/11lXuDfrgBPY9_nmmZjZ1zv0bDK0ZiKr941_mJc37yV0/edit#gid=660067223 74 | 75 | === Data Modeling and Import 76 | 77 | TL;DR if you want to shortcut the modeling you can grab the `nodes-sessions-data-importer-2022-09-26.zip` File from the https://github.com/neo4j-examples/discoveraurafree/tree/main/data[GitHub repository^] and load it via the "Open model (with data)" menu entry in the three dots `...`. 78 | 79 | If we open Workspace on our blank database (or Data Importer directly) we can add our CSV files on the left side. 80 | 81 | image::nodes-data-importer.png[] 82 | 83 | Then we start mapping our data by 84 | 85 | 1. adding the session node 86 | 2. setting it's label to Session 87 | 3. selecting the sessions csv in the mapping view 88 | 4. and adding all relevant fields to the mapping from the file 89 | 5. the `Session Id` is automatically selected as id field 90 | 91 | Then we do the same for the `Speaker` node just with the speaker's CSV. 92 | 93 | To connect both, we drag out a relationship from speaker to session from the speaker node's halo. 94 | 95 | Give it the name `PRESENTS` and use the fields `Session Id` and `Speaker Ids` for the mapping. 96 | 97 | Unfortunately the comma separated Speaker Ids are not handled by data importer yet, so this will only connect sessions which have a single speaker. 98 | 99 | But fear not, we will connect the rest with a bit of post-processing. 100 | 101 | In _Preview_ we see how our data will look like in the graph both the properties as well as relationships. 102 | 103 | image::nodes-data-importer-preview.png[] 104 | 105 | If we're satisfied, we can click "Run Import" and it will take roughly a second to import the data. 106 | 107 | If you click on the `Show query` links in the import report you'll see the constraints and import query that data importer is running. 108 | 109 | There you also see that for the relationships it tries to match the existing nodes for session and speaker based on `Sessiond Id` and `Speaker Ids` to connect them, which only works if there's a single speaker for a session. 110 | 111 | After running the importer we can open the "Query" tab by htting "Run Queries". 112 | 113 | Or just click on it on top. 114 | 115 | == Querying 116 | 117 | A single pre-populated query shows us our graph, which should look very similar to the preview. 118 | 119 | [source,cypher] 120 | ---- 121 | MATCH p=()-[:PRESENTS]->() RETURN p LIMIT 25; 122 | ---- 123 | 124 | We can also look for Speakers that have more than one session, like Anton, but not yet for sessions with more than one speaker. 125 | 126 | Let's first find sessions that have no speakers yet. 127 | 128 | [source,cypher] 129 | ---- 130 | match (s:Session) where not exists { (s)<-[:PRESENTS]-() } 131 | return s.`Session Id` as session, s.`Speaker Ids` as speakers 132 | ---- 133 | 134 | These are the ones we want to fix in our post-processing. 135 | 136 | == Post Processing 137 | 138 | The approach we take for all these operations is the same. 139 | 140 | Find the sessions to update, split a field by comma+space `, ` into a list of values. 141 | 142 | Then turn (`UNWIND`) this list of values into rows of values, `MATCH` or `MERGE` (get-or-create) nodes for the values and connect the session to them via a relationship. 143 | 144 | 145 | .List of speaker ids 146 | [source,cypher] 147 | ---- 148 | MATCH (s:Session) WHERE NOT EXISTS { (s)<-[:PRESENTS]-() } 149 | RETURN s.`Session Id` as session, split(s.`Speaker Ids`,', ') as speakers 150 | ---- 151 | 152 | .List to rows 153 | [source,cypher] 154 | ---- 155 | MATCH (s:Session) WHERE NOT EXISTS { (s)<-[:PRESENTS]-() } 156 | WITH s, split(s.`Speaker Ids`,', ') as speakers 157 | UNWIND speakers as speakerId 158 | RETURN s.`Session Id` as session, speakerId 159 | ---- 160 | 161 | .MATCH speakers and connect them 162 | [source,cypher] 163 | ---- 164 | MATCH (s:Session) WHERE NOT EXISTS { (s)<-[:PRESENTS]-() } 165 | WITH s, split(s.`Speaker Ids`,', ') as speakers 166 | UNWIND speakers as speakerId 167 | MATCH (sp:Speaker {`Speaker Id`:speakerId}) 168 | MERGE (sp)-[r:PRESENTS]->(s) 169 | RETURN * 170 | ---- 171 | 172 | As sessionize exported all speakers not just the ones with the accepted sessions, we now how to remove our orphans. 173 | 174 | .Delete orphan speakers 175 | [source,cypher] 176 | ---- 177 | MATCH (sp:Speaker) 178 | WHERE NOT EXISTS { (sp)-[:PRESENTS]->() } 179 | DELETE sp 180 | ---- 181 | 182 | === Categorize other fields 183 | 184 | We can now do the same for the other comma separated fields. 185 | 186 | * Level 187 | * Topic 188 | * Neo4j Usecase 189 | 190 | Here we generally call the list `names`, an value `name` and the node `n` so keep the editing needed to a minimum. 191 | 192 | .Level 193 | [source,cypher] 194 | ---- 195 | MATCH (s:Session) 196 | WITH s, split(s.Level,', ') as names 197 | UNWIND names as name 198 | MERGE (n:Level {name:name}) 199 | MERGE (s)-[r:OF_LEVEL]->(n) 200 | RETURN * 201 | ---- 202 | 203 | .Use Cases 204 | [source,cypher] 205 | ---- 206 | MATCH (s:Session) 207 | WITH s, split(s.`Neo4j Use-Case`,', ') as names 208 | UNWIND names as name 209 | MERGE (n:UseCase {name:name}) 210 | MERGE (s)-[r:USECASE]->(n) 211 | RETURN * 212 | ---- 213 | 214 | .Topics 215 | [source,cypher] 216 | ---- 217 | match (s:Session) 218 | WITH s, split(s.`Topic of your presentation`,', ') as names 219 | UNWIND names as name 220 | MERGE (n:Topic {name:name}) 221 | MERGE (s)-[r:HAS_TOPIC]->(n) 222 | RETURN * 223 | ---- 224 | 225 | Now we have a beautiful graph with different nodes for 226 | 227 | * Session 228 | * Speaker 229 | * Level 230 | * Topic 231 | * UseCase 232 | 233 | and their relationships. 234 | 235 | === Exploring the Results 236 | 237 | We can open "Explore" to visualize our data a bit. 238 | 239 | First we set the correct captions for `Session` (`Title`) and `Speaker` (`FirstName` and `LastName`) as well as some icons. 240 | 241 | Then we can pic `Show me A Graph` from the drop down to quickly show a graph and explore a bit. 242 | 243 | image::nodes-explore-show-graph.png[] 244 | 245 | Then we can use our extracted topics and see which Sessions share topics by entering: `SessionTopicSession` into the search bar and hitting return. 246 | 247 | image::nodes-explore-session.png[] 248 | 249 | === Dashboard 250 | 251 | We're using https://neo4j.com/labs/neodash/[NeoDash, a Neo4j Labs project^] for creating quick dashboards. 252 | 253 | You can open it via https://tools.neo4jlabs.com and add your connection URL (from the aura console or your credentials download) to the form and click on the Open button for NeoDash. 254 | 255 | You still need to provide the password, for security reasons it shouldn't be passed through the URL. 256 | 257 | In the video we go through the charts and queries for the dashboar, we'll list them quickly here only. 258 | 259 | [opts=header,cols="a,a,5m"] 260 | |=== 261 | | Item | Chart Type | Query 262 | | Sessions | Number | MATCH (:Session) RETURN count(*) 263 | | Description | Markdown | This is a dashboard for Neo4j NODES 2022 264 | | Titles | Table | MATCH (s:Session)<-[:PRESENTS]-(sp:Speaker) RETURN s.title as session, collect(sp.FirstName+" "+sp.LastName) as speakers 265 | | Topics | Bar Chart | MATCH (t:Topic)<-[:HAS_TOPIC]-(s:Session) 266 | RETURN t.name as name, count(*) as c 267 | ORDER BY c DESC 268 | | Levels | Pie Chart | MATCH (s:Session)-[:OF_LEVEL]->(l:Level) 269 | RETURN l.name, count(*) 270 | | Graph | Graph | MATCH p=()-->() RETURN p LIMIT 100 271 | | Speaker Locations | Map | MATCH (sp:Speaker) 272 | WHERE sp.location is not null 273 | RETURN sp 274 | |=== 275 | 276 | image::nodes-dashboard.png[] 277 | 278 | For the speaker locations we first have to compute the geolocation from their city and country. 279 | 280 | === Add geolocation for Speaker Cities 281 | 282 | Let's check it for a single speaker, we need to see if the city is actually empty or has some characters. 283 | 284 | Then we can call https://neo4j.com/labs/apoc/4.3/overview/apoc.spatial/apoc.spatial.geocodeOnce/[`apoc.spatial.geocodeOnce`^] to geocode the city and country and look at the results. 285 | 286 | [source,cypher] 287 | ---- 288 | match (sp:Speaker) 289 | where size(sp.City) > 1 290 | with sp limit 1 291 | call apoc.spatial.geocodeOnce(sp.City+" "+sp.Country) yield location, data, latitude, longitude 292 | return * 293 | ---- 294 | 295 | We can use the `latitude` and `longitude` from the result directly to create spatial point `location` properties in our speakers. 296 | 297 | [source,cypher] 298 | ---- 299 | match (sp:Speaker) 300 | where size(sp.City) > 1 301 | call apoc.spatial.geocodeOnce(sp.City+" "+sp.Country) yield location, data, latitude, longitude 302 | set sp.location = point({latitude:latitude, longitude:longitude}) 303 | ---- 304 | 305 | Which we then can put on a Map-Chart in the Dashboar by just selecting the speakers that have a location property. 306 | 307 | 308 | == Conclusion 309 | 310 | We hope this was a fun and useful sessions and you got excited for https://neo4j.com/nodes-2022[NODES 2022^]. 311 | 312 | Stay tuned for the next time when we look at importing REST APIs, Schedule Modeling and computing recommendations. -------------------------------------------------------------------------------- /week-36-nodes-schedule-api-recommendations.adoc: -------------------------------------------------------------------------------- 1 | === REST API Import & Recommendations 2 | 3 | URI 4 | 5 | https://sessionize.com/api/v2/9jmqg4no/view/Sessions 6 | 7 | https://sessionize.com/api/v2/9jmqg4no/view/Speakers 8 | 9 | scripts for loading 10 | 11 | https://gist.github.com/jexp/f20ff11f4da9278ddf741a1258e04154 -------------------------------------------------------------------------------- /week-36-nodes-schedule-recommendations.adoc: -------------------------------------------------------------------------------- 1 | match (:Slot {`Scheduled At`:datetime("2022-11-17T08:30:00Z")})-[:NEXT*0..5]->(slot2)<-[:IN_SLOT]-(s:Session)-[:HAS_TOPIC]->(t:Topic) WHERE t.name IN ['Graph Data Science','Cypher'] return slot2.`Scheduled At`, s.Title 2 | 3 | match (a:Attendee {id:1}) 4 | call { with a match (a)-[:STARRED]->()-[:IN_SLOT]->(slot) return collect(distinct slot) as slots } 5 | match (a)-[:STARRED]->(s)<-[:STARRED]-(peers)-[:STARRED]->(reco) 6 | where not exists { (a)-[:STARRED]->(reco) } and none(slot in slots where (reco)-[:IN_SLOT]->(slot)) 7 | return reco.Title, count(*) as freq 8 | order by freq desc limit 5 9 | 10 | unwind range(1,1000) as id 11 | merge (a:Attendee {id:id}) 12 | with * 13 | unwind range(1,8) as dummy 14 | call { with a 15 | match (s:Session) 16 | with a, collect(s) as sessions 17 | with a, sessions[toInteger(rand()*size(sessions))] as s 18 | merge (a)-[:STARRED]->(s) 19 | } 20 | 21 | match (s:Session {Title:"CloudScreen: A Graph-Based Drug Repurposing Platform Empowered by Machine Learning"}) 22 | match (reco:Session)--(x)--(s) 23 | where not x:Room and not x:Slot 24 | with reco, count(*) as count, labels(x)[0] as type, x.name as name 25 | RETURN reco.Title, collect([type, name, count]) as overlap, sum(count) as freq 26 | order by freq desc limit 5 27 | 28 | bloom scene action 29 | 30 | match (s:Session) where id(s) in $nodes 31 | call { with s 32 | match p=(reco:Session)--(x)--(s) 33 | where not x:Room and not x:Slot 34 | return reco, collect(p) as slots, count(*) as freq 35 | order by freq desc limit 5 36 | } 37 | return * 38 | 39 | 40 | match (s:Session) where id(s) in $nodes 41 | match p=(reco:Session)--(x)--(s) 42 | where not x:Room and not x:Slot 43 | return reco, collect(p) as slots, count(*) as freq 44 | -------------------------------------------------------------------------------- /week-37-maston-api-graph.adoc: -------------------------------------------------------------------------------- 1 | == Week 37 - Discover Aura Free - Maston as a Graph 2 | :imagesdir: img 3 | 4 | Twitter has been one of our favorite social networks to model, import and query, because it is a rich, multi-layered social graph with followship, posts, replies, mentions, hashtags, URLs and more. 5 | 6 | The Twitter API is although limited, very rich in data and you can easily turn it into an insightful graph as we did, e.g. for [Twitter Trolls^], or the [Community Graph^] 7 | 8 | With the exodus from Twitter, Mastodon and the Fediverse became much more interesting for a lot of people. 9 | Also the underlying ActivityPub API and infrastructure that powers much more than just Mastodon got more attention. 10 | 11 | 12 | 13 | You can see and join our upcoming livestreams on Twitch, YouTube and https://neo4j.com/events/list/?tribe_eventcategory%5B0%5D=26929[elsewhere here^] and watch all the https://neo4j.com/video/discover-aura-free-with-fun-datasets/[Discover AuraDB Free Videos^]. -------------------------------------------------------------------------------- /week-39-nobel-prizes.adoc: -------------------------------------------------------------------------------- 1 | == Week 39 - Discover Aura Free - Nobel Prize 2 | :imagesdir: img 3 | 4 | As the Nobel Prizes in Physics, Chemistry, Medicine, Literature and the Nobel Peace Prize were awarded in the last weeks, we thought that this is a nice dataset to import and query as a graph as there are a few dimensions to it. 5 | And you can use it to create a knowledge graph if you also connect it to papers, authors, publications and research data. 6 | 7 | If you missed our livestream, here is the recording: 8 | 9 | https://www.youtube.com/watch?v=gMYu6OaGUOc&list=PL9Hl4pk2FsvVZaoIpfsfpdzEXxyUJlAYw&index=1 10 | 11 | // https://youtu.be/gMYu6OaGUOc 12 | 13 | 14 | First I found a https://www.kaggle.com/datasets/imdevskp/nobel-prize?resource=download[Kaggle Dataset^] with some CSV and JSON data, but that ended in 2019, fortunately I spotted a link to the original data source with API links to https://nobelprize.org. 15 | 16 | image::https://www.nobelprize.org/images/58219-hero-tablet-2x.jpg[link=https://www.nobelprize.org/all-nobel-prizes-2022/] 17 | 18 | So I went there, looked at https://www.nobelprize.org/all-nobel-prizes-2022/[this year's Prizes^] and some https://www.nobelprize.org/prizes/facts/nobel-prize-facts/[Lesser Known Facts^], which we can also use for our queries: 19 | 20 | * people that got more than one prize awareded 21 | * age of laureates 22 | * most common affiliations with institutions and their impact 23 | * breakdown by country 24 | * years without awards 25 | * sadly the low percentage (10%) of non-white-male recipients of Nobel Prizes 26 | 27 | === Data Source 28 | In the footer of the page there actually a link to a https://www.nobelprize.org/about/developer-zone-2/[developer page^], which is great. 29 | 30 | They have a new v2.1 REST API with an https://app.swaggerhub.com/apis/NobelMedia/NobelMasterData/2.1[OpenAPI specification^], so you can grab prizes (664) and laureates (981) with a lot of detail and pagination. 31 | The developer page also links to a Linked Data (RDF) API with a SPARQL endpoint. 32 | 33 | There is also an https://nobelprize.readme.io/reference/getting-started[older v1 API^] which provides both JSON and CSV outputs based on the same data (I checked the id's), that's also what the code-example on the developer page talks about. 34 | 35 | To make it easy to start I just used the option of getting the v1 API responses as CSV for prizes and laureates. 36 | 37 | We can later add to the data in the graph by querying select parts of the data as JSON from the new v2 API and merge them into our graph. 38 | 39 | === Data Model 40 | 41 | We developed the data model incrementally based on the data in the CSV, our understanding and the questions we wanted to ask. 42 | 43 | image::nobel-prize-model.png[] 44 | 45 | So we got as nodes: 46 | 47 | * Prize (Nobel Prize) 48 | * Person who received the Prize 49 | * Year for the Prize 50 | * Category for the Prize 51 | * Institution the person is affiliated with 52 | * Country for birth, death of the Person and the Institution 53 | 54 | 55 | :db-name: Nobel Prize 56 | 57 | include::connect-aura.adoc[] 58 | 59 | === Data Import 60 | 61 | Unfortunately the prize itself has no real unique id, in places where they refer to it they use a combination of category and year. 62 | 63 | So I used `xsv select 1-8,category,year prize.csv > prize2.csv` to duplicate the two columns at the end. 64 | And then ran a regular expression replacement in VS Code to replace the comma between last two elements with a dash, so this is now our id column, called `categoryYear` with entries like `chemistry-2022`. 65 | 66 | The other bit that we had to fix was to replace dates like `0000-00-00` with nothing in the laureates CSV (i.e. a `null` value) and also replace the `-00-00` suffix from some dates with nothing as well, so that just the year remained (but the column can still be imported as datetime) as Cypher's date functions don't like the zero value months and days. 67 | 68 | Then we mapped out the different fields to nodes and relationships - thankfully data importer often pre-filled the mapping for us for the relationships and ids. 69 | 70 | One particular aspect where we changed the mapping in the model was to extract 3 `Country` meta-nodes to represent the countries coming from the 3 different sources (born, died, institution) and create the right entries and relationships, each of those 3 country mappings has the same property name that the different source column names are mapped to. 71 | 72 | image::nobel-prize-data-importer.png[] 73 | 74 | After finishing the mapping we could run the preview, see that we mapped our data correctly and then click "Import". 75 | 76 | image::nobel-prize-data-importer-preview.png[] 77 | 78 | === Explore 79 | 80 | After import we're sent directly to the Explore tab which gives us an initial view of our data _"Show me a graph"_, we can now style our data picking right captions and icons in the right side legend. 81 | 82 | image::nobel-prize-explore-show-graph.png[] 83 | 84 | We can also explore our data starting from a node, here `Harvard Medical School` and thene expanding the pattern to people, their prizes and years. 85 | After getting the results we can select all (`Cmd+A/Ctrl-A`) and chose "Expand All" from the context menu, so we get a more complete picture of the context of that institution. 86 | 87 | image::nobel-prize-explore-harvard-medical.png[] 88 | 89 | === Query 90 | 91 | To answer some of the initial questions from the facts section, we moved to the "Query" tab. 92 | 93 | First looking at Laureates with more than one prize, we can express that as a pattern, of people having received two prizes. 94 | 95 | Most that show up here are organizations, it gets interesting when looking at people who got prizes in different categories with a `WHERE p1.category <> p2.category`, which are actually just two "Marie Curie" and "Linus Pauling". 96 | 97 | [source,cypher] 98 | ---- 99 | match (p1:Prize)<-[:RECEIVED]-(p)-[:RECEIVED]->(p2:Prize) 100 | where id(p1)(pr:Prize) 112 | with p, collect(pr) as prizes 113 | where size(prizes) > 1 114 | return p.surname, p.firstname, size(prizes) as count, 115 | [pr in prizes | pr {.category, .year}] as prizes 116 | ---- 117 | 118 | Affiliations with instituations have a big impact on the nobel prize, as you can see in the following query, with institutions from the US being overindexed. 119 | 120 | [source,cypher] 121 | ---- 122 | match (i:Institution)<-[:AFFILIATED_WITH]-()-[:RECEIVED]->(pr:Prize) 123 | return i.name, i.country, i.city, count(*) as count order by count desc limit 20 124 | ---- 125 | 126 | image::nobel-prize-query-institutions.png[] 127 | 128 | To compute the age, we turn the year of the prize into a date (`date({year:prize.year})`) and the born and died datetimes from the data importer into dates (`date(p.born)`), then we can compute the age difference by using `duration.beetween(date1, date2).years` and sort accordingly. 129 | 130 | [source,cypher] 131 | ---- 132 | match (p:Person)-[:RECEIVED]->(pr:Prize) 133 | return p.firstname, p.surname, p.born, pr.year, duration.between(p.born, pr.year).years as years 134 | order by years asc 135 | limit 10 136 | ---- 137 | 138 | image::nobel-prize-query-youngest.png[] 139 | 140 | === Nominations 141 | 142 | There is also https://www.nobelprize.org/nomination/archive/[data on nominations^] available, actually quite a lot with 20424 nomiations. 143 | 144 | Unfortunately you cannot access it through the API just through a crude PHP search interface with HTML output. 145 | 146 | So to get that data you'd have to scrape it from the web. 147 | 148 | There is also a https://www.nobelprize.org/nomination/map1/nominees.php[visualization page^] available, perhaps that's an easier way to get to the data. (It seems it is via https://www.nobelprize.org/nomination/api/getNomineesInfo.php[this URL^] which returns JSON). 149 | 150 | We also learned that nomination data is kept secret for 50 years, so the latest data available is by 1971. 151 | Probably to keep feuds, bribery and similar research vengeance until after the laureates and nominators are dead. 152 | 153 | === Conclusion 154 | 155 | As mentioned in the introduction this dataset can be nicely combined with citation datasets and perhaps research grants and projects in general. 156 | So you could see how influence of nobel laureates spreads over the research networks and which institutions are perhaps more privileged than others. 157 | 158 | Definitely a good starting point for a research knowledge graph, let us know in the comments if you have more ideas or found this useful. -------------------------------------------------------------------------------- /week-40-weather-api-data.adoc: -------------------------------------------------------------------------------- 1 | with date() - duration("P1D") as date 2 | match (start:City {name:"Berlin"}) 3 | match (c:City) 4 | where point.distance(c.location, start.location) < 1000000 5 | WITH date, c skip 5 limit 1 6 | call apoc.load.json("https://api.brightsky.dev/weather?date="+toString(date)+"&lat="+c.latitude+"&lon="+c.longitude,null, {failOnError:false}) yield value 7 | with c, value.weather[0] as w, value.sources as stations 8 | foreach (s in stations | MERGE (stat:Station {id:s.id}) ON CREATE SET stat.name = s.station_name) 9 | MERGE (c)-[:WEATHER]->(d:Day {date:date(datetime(w.timestamp))}) 10 | ON CREATE SET d += w {.pressure_msl, .visibility, .icon, .wind_direction, .precipitation, .condition, .temperature, .wind_speed, .wind_direction, .cloud_cover} 11 | WITH * 12 | MATCH (s:Station {id:w.source_id}) 13 | MERGE (s)-[:MEASURED]->(d); 14 | 15 | 16 | match (d:Day) 17 | where not d.condition is null 18 | merge (c:Condition {name:d.condition}) 19 | merge (d)-[:HAS]->(c); 20 | 21 | match (c:City) set c.location = point(properties(c)) 22 | 23 | create point index city_location for (c:City) on (c.location) 24 | 25 | 26 | match (c:City {name:"Berlin"}) 27 | match (c2:City) 28 | where point.distance(c.location, c2.location) < 1000000 29 | return c2 30 | 31 | -------------------------------------------------------------------------------- /week-43-hotel-reviews-bloom-spatial.adoc: -------------------------------------------------------------------------------- 1 | == Week 43 - Hotel Reviews and Spatial Layout in Bloom 2 | 3 | 4 | https://www.kaggle.com/datasets/jiashenliu/515k-hotel-reviews-data-in-europe 5 | 6 | ---- 7 | echo "id" > ids.csv 8 | for id in `seq 1 10000`;do echo $id >> ids.csv; done 9 | 1020 xsv cat columns ids.csv Hotel_Reviews.csv > hotels.csv 10 | 1021 xsv head hotels.csv 11 | 1022 xsv sample 10 hotels.csv 12 | 1023 xsv sample 10000 hotels.csv > hotels_10k.csv 13 | 1024 xsv sample 100000 hotels.csv > hotels_100k.csv 14 | 1025 ls 15 | 1026 xsv sample Hotel_Reviews.csv 16 | 1027 xsv sample 10 Hotel_Reviews.csv 17 | 1028 xsv sample 5 hotels.csv 18 | 1029 xsv sample 5 hotels.csv 19 | 1030 mv hotels_10k.csv hotels_10k.csv.save 20 | 1031 mv hotels_100k.csv hotels_10k.csv 21 | ---- 22 | https://neo4j.com/docs/apoc/current/overview/apoc.convert/apoc.convert.fromJsonList/ 23 | 24 | 25 | TODO Bloom screenshots 26 | 27 | Data Importer Screenshots 28 | -------------------------------------------------------------------------------- /week-5.adoc: -------------------------------------------------------------------------------- 1 | == Week 5 - Rest areas across New York state data set 2 | 3 | In this week's episode, Lju and Alexander explore data on rest areas across New York State, from https://catalog.data.gov/dataset/rest-areas-across-ny[the U.S. Government open data site^]. Catch-up on the episode now! 4 | 5 | .catch-up video 6 | [caption="Week 5 ",link=https://www.youtube.com/watch?v=Nb2kUlf-aj4^] 7 | image::https://i.ytimg.com/vi/Nb2kUlf-aj4/maxresdefault.jpg[] 8 | 9 | === Key links 10 | 11 | * https://dev.neo4j.com/discover-aura[Neo4j Aura landing page^] 12 | * https://catalog.data.gov/dataset/rest-areas-across-ny[U.S. Government open data site^] 13 | * https://data.ny.gov/api/views/qebf-4fd8/rows.csv?accessType=DOWNLOAD[Raw CSV^] 14 | * https://arrows.app[Arrows app^] 15 | * https://arrows.app/#/import/json=eyJncmFwaCI6eyJzdHlsZSI6eyJub2RlLWNvbG9yIjoiI2ZmZmZmZiIsImJvcmRlci13aWR0aCI6NCwiYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInJhZGl1cyI6NTAsIm5vZGUtcGFkZGluZyI6NSwibm9kZS1tYXJnaW4iOjIsIm91dHNpZGUtcG9zaXRpb24iOiJhdXRvIiwiY2FwdGlvbi1wb3NpdGlvbiI6Imluc2lkZSIsImNhcHRpb24tbWF4LXdpZHRoIjoyMDAsImNhcHRpb24tY29sb3IiOiIjMDAwMDAwIiwiY2FwdGlvbi1mb250LXNpemUiOjUwLCJjYXB0aW9uLWZvbnQtd2VpZ2h0Ijoibm9ybWFsIiwibGFiZWwtcG9zaXRpb24iOiJpbnNpZGUiLCJsYWJlbC1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsImxhYmVsLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1ib3JkZXItd2lkdGgiOjQsImxhYmVsLWZvbnQtc2l6ZSI6NDAsImxhYmVsLXBhZGRpbmciOjUsImxhYmVsLW1hcmdpbiI6NCwiZGlyZWN0aW9uYWxpdHkiOiJkaXJlY3RlZCIsImRldGFpbC1wb3NpdGlvbiI6ImlubGluZSIsImRldGFpbC1vcmllbnRhdGlvbiI6InBhcmFsbGVsIiwiYXJyb3ctd2lkdGgiOjUsImFycm93LWNvbG9yIjoiIzAwMDAwMCIsIm1hcmdpbi1zdGFydCI6NSwibWFyZ2luLWVuZCI6NSwibWFyZ2luLXBlZXIiOjIwLCJhdHRhY2htZW50LXN0YXJ0Ijoibm9ybWFsIiwiYXR0YWNobWVudC1lbmQiOiJub3JtYWwiLCJ0eXBlLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJ0eXBlLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJvcmRlci13aWR0aCI6MCwidHlwZS1mb250LXNpemUiOjE2LCJ0eXBlLXBhZGRpbmciOjUsInByb3BlcnR5LXBvc2l0aW9uIjoib3V0c2lkZSIsInByb3BlcnR5LWNvbG9yIjoiIzAwMDAwMCIsInByb3BlcnR5LWZvbnQtc2l6ZSI6MTYsInByb3BlcnR5LWZvbnQtd2VpZ2h0Ijoibm9ybWFsIn0sIm5vZGVzIjpbeyJpZCI6Im4wIiwicG9zaXRpb24iOnsieCI6LTI2MSwieSI6LTI4NTd9LCJjYXB0aW9uIjoiIiwic3R5bGUiOnt9LCJsYWJlbHMiOlsiUm91dGUiXSwicHJvcGVydGllcyI6eyJuYW1lIjoiIn19LHsiaWQiOiJuMSIsInBvc2l0aW9uIjp7IngiOjE1Ny41LCJ5IjotMjg1N30sImNhcHRpb24iOiIiLCJzdHlsZSI6e30sImxhYmVscyI6WyJSZXN0U3RvcCIsIk9wZW4iXSwicHJvcGVydGllcyI6eyJsb2NhdGlvbiI6IiIsIm5hbWUiOiIiLCJoYW5kaWNhcFNwYWNlcyI6IiIsInRydWNrU3BhY2VzIjoiIiwiY2FyU3BhY2VzIjoiIiwicHVibGljUGhvbmUiOiIifX0seyJpZCI6Im4yIiwicG9zaXRpb24iOnsieCI6LTE3MC4xMDM3MzkzMjQ1NDksInkiOi0yNTk2LjU4MTAyOTkxNDE1MzV9LCJjYXB0aW9uIjoiIiwic3R5bGUiOnt9LCJsYWJlbHMiOlsiQ291bnR5Il0sInByb3BlcnRpZXMiOnsibmFtZSI6IiJ9fV0sInJlbGF0aW9uc2hpcHMiOlt7ImlkIjoibjEiLCJ0eXBlIjoiT05fUk9VVEUiLCJzdHlsZSI6e30sInByb3BlcnRpZXMiOnsiZGlyZWN0aW9uIjoiIn0sImZyb21JZCI6Im4xIiwidG9JZCI6Im4wIn0seyJpZCI6Im4yIiwidHlwZSI6IkJBU0VEX0lOIiwic3R5bGUiOnt9LCJwcm9wZXJ0aWVzIjp7fSwiZnJvbUlkIjoibjEiLCJ0b0lkIjoibjIifV19LCJkaWFncmFtTmFtZSI6IlJlc3QgYXJlYXMgaW4gTmV3IFlvcmsgU3RhdGUifQ==[Data model from the session^] 16 | 17 | === The data set 18 | 19 | This week we explored https://catalog.data.gov/dataset/rest-areas-across-ny[rest areas available in New York State^] data, including location, name and facilities available. 20 | 21 | Whilst it's a relatively small data set (some 32 rows!), it is a rather fun data set for us to explore. It also gives us a great opportunity to have a play with https://neo4j.com/docs/cypher-manual/current/functions/spatial/[Neo4j spatial^]. 22 | 23 | === The questions 24 | 25 | The following questions for the data set came up during the stream: 26 | 27 | * If I'm traveling on a certain route in a certain direction, what rest stops are available? 28 | * What rest areas closest to me has a public phone? 29 | * What route has the most handicap spaces available? 30 | 31 | === The data model 32 | 33 | You can view and play with the data model in Arrows App https://arrows.app/#/import/json=eyJncmFwaCI6eyJzdHlsZSI6eyJub2RlLWNvbG9yIjoiI2ZmZmZmZiIsImJvcmRlci13aWR0aCI6NCwiYm9yZGVyLWNvbG9yIjoiIzAwMDAwMCIsInJhZGl1cyI6NTAsIm5vZGUtcGFkZGluZyI6NSwibm9kZS1tYXJnaW4iOjIsIm91dHNpZGUtcG9zaXRpb24iOiJhdXRvIiwiY2FwdGlvbi1wb3NpdGlvbiI6Imluc2lkZSIsImNhcHRpb24tbWF4LXdpZHRoIjoyMDAsImNhcHRpb24tY29sb3IiOiIjMDAwMDAwIiwiY2FwdGlvbi1mb250LXNpemUiOjUwLCJjYXB0aW9uLWZvbnQtd2VpZ2h0Ijoibm9ybWFsIiwibGFiZWwtcG9zaXRpb24iOiJpbnNpZGUiLCJsYWJlbC1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1iYWNrZ3JvdW5kLWNvbG9yIjoiI2ZmZmZmZiIsImxhYmVsLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJsYWJlbC1ib3JkZXItd2lkdGgiOjQsImxhYmVsLWZvbnQtc2l6ZSI6NDAsImxhYmVsLXBhZGRpbmciOjUsImxhYmVsLW1hcmdpbiI6NCwiZGlyZWN0aW9uYWxpdHkiOiJkaXJlY3RlZCIsImRldGFpbC1wb3NpdGlvbiI6ImlubGluZSIsImRldGFpbC1vcmllbnRhdGlvbiI6InBhcmFsbGVsIiwiYXJyb3ctd2lkdGgiOjUsImFycm93LWNvbG9yIjoiIzAwMDAwMCIsIm1hcmdpbi1zdGFydCI6NSwibWFyZ2luLWVuZCI6NSwibWFyZ2luLXBlZXIiOjIwLCJhdHRhY2htZW50LXN0YXJ0Ijoibm9ybWFsIiwiYXR0YWNobWVudC1lbmQiOiJub3JtYWwiLCJ0eXBlLWNvbG9yIjoiIzAwMDAwMCIsInR5cGUtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJ0eXBlLWJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJvcmRlci13aWR0aCI6MCwidHlwZS1mb250LXNpemUiOjE2LCJ0eXBlLXBhZGRpbmciOjUsInByb3BlcnR5LXBvc2l0aW9uIjoib3V0c2lkZSIsInByb3BlcnR5LWNvbG9yIjoiIzAwMDAwMCIsInByb3BlcnR5LWZvbnQtc2l6ZSI6MTYsInByb3BlcnR5LWZvbnQtd2VpZ2h0Ijoibm9ybWFsIn0sIm5vZGVzIjpbeyJpZCI6Im4wIiwicG9zaXRpb24iOnsieCI6LTI2MSwieSI6LTI4NTd9LCJjYXB0aW9uIjoiIiwic3R5bGUiOnt9LCJsYWJlbHMiOlsiUm91dGUiXSwicHJvcGVydGllcyI6eyJuYW1lIjoiIn19LHsiaWQiOiJuMSIsInBvc2l0aW9uIjp7IngiOjE1Ny41LCJ5IjotMjg1N30sImNhcHRpb24iOiIiLCJzdHlsZSI6e30sImxhYmVscyI6WyJSZXN0U3RvcCIsIk9wZW4iXSwicHJvcGVydGllcyI6eyJsb2NhdGlvbiI6IiIsIm5hbWUiOiIiLCJoYW5kaWNhcFNwYWNlcyI6IiIsInRydWNrU3BhY2VzIjoiIiwiY2FyU3BhY2VzIjoiIiwicHVibGljUGhvbmUiOiIifX0seyJpZCI6Im4yIiwicG9zaXRpb24iOnsieCI6LTE3MC4xMDM3MzkzMjQ1NDksInkiOi0yNTk2LjU4MTAyOTkxNDE1MzV9LCJjYXB0aW9uIjoiIiwic3R5bGUiOnt9LCJsYWJlbHMiOlsiQ291bnR5Il0sInByb3BlcnRpZXMiOnsibmFtZSI6IiJ9fV0sInJlbGF0aW9uc2hpcHMiOlt7ImlkIjoibjEiLCJ0eXBlIjoiT05fUk9VVEUiLCJzdHlsZSI6e30sInByb3BlcnRpZXMiOnsiZGlyZWN0aW9uIjoiIn0sImZyb21JZCI6Im4xIiwidG9JZCI6Im4wIn0seyJpZCI6Im4yIiwidHlwZSI6IkJBU0VEX0lOIiwic3R5bGUiOnt9LCJwcm9wZXJ0aWVzIjp7fSwiZnJvbUlkIjoibjEiLCJ0b0lkIjoibjIifV19LCJkaWFncmFtTmFtZSI6IlJlc3QgYXJlYXMgaW4gTmV3IFlvcmsgU3RhdGUifQ==[here^]. 34 | 35 | We have used more than one label on a node! Looking at the data set, we could see that some rest areas were open, and others were closed. A convenient way to filter out open rest stops is to apply a label - this allows the query engine to quickly filter out nodes without looking at properties. 36 | 37 | We've not loaded all of the available properties. By all means, if you wish to do a bit of exploring, please do! 38 | 39 | .The rest areas in NY State data model we used in the stream 40 | image::img\ranys.png[] 41 | 42 | === Loading the data 43 | 44 | To load the data into the database, we use the following query: 45 | 46 | [source,cypher] 47 | ---- 48 | LOAD CSV WITH HEADERS FROM "https://data.ny.gov/api/views/qebf-4fd8/rows.csv?accessType=DOWNLOAD" AS row 49 | MERGE (c:County {name:row.County}) 50 | MERGE (r:Route {name:row.Route}) 51 | CREATE (rs:RestStop {name:row.Name, description:tointeger(row.Description), 52 | publicPhone:tointeger(row.`Public Phone`), handicapSpaces:tointeger(row.`Handicapped Spaces`), 53 | truckSpaces:tointeger(row.`Truck Spaces`), carSpaces:tointeger(row.`Car Spaces`), 54 | location:point({latitude:tofloat(row.Latitude), longitude:tofloat(row.Longitude)})}) 55 | CREATE (rs)-[:ON_ROUTE {direction:row.`Travel Direction`}]->(r) 56 | CREATE (rs)-[:IN_COUNTY]->(c) 57 | WITH rs, row.Status AS status WHERE status = "Open" 58 | SET rs:Open 59 | ---- 60 | 61 | As before, we need to cast lots of the numbers into integers and floats as appropriate! We didn't do this on the live stream, we've made the changes in this write up. 62 | 63 | Another interesting thing about this data set, is that we get to use the Neo4j spatial types! You can https://neo4j.com/docs/cypher-manual/current/syntax/spatial/[read more about them here^]. 64 | 65 | === Querying the data 66 | 67 | *Question 1 - If I'm traveling on a certain route in a certain direction, what rest stops are available with truck parking?* 68 | 69 | [source,cypher] 70 | ---- 71 | WITH 'I-87' as route, 'Southbound' as direction 72 | MATCH (r:Route{name:route})-[:ON_ROUTE {direction:direction}]-(rs:RestStop:Open) 73 | WHERE rs.truckSpaces > 0 74 | RETURN rs.name, rs.truckSpaces, rs.location.y, rs.location.x ORDER BY rs.location.y DESC 75 | ---- 76 | 77 | In this query, we are using the https://neo4j.com/docs/cypher-manual/current/functions/spatial/#functions-distance[distance function from Neo4j spatial^]. 78 | 79 | *Question 2 - What rest areas closest to me has a public phone?* 80 | 81 | We quickly discovered that none of the rest areas had public telephones! so we switched it over from telephones to handicap spaces. 82 | 83 | Here's the https://goo.gl/maps/4w5yok1x82d4Ckv86[random location in New York state^] we picked as the location to work with. 84 | 85 | [source,cypher] 86 | ---- 87 | WITH point({latitude:43.102700,longitude:-75.232339}) as location 88 | MATCH (rs:RestStop:Open) WHERE rs.handicapSpaces>0 89 | RETURN rs.name, rs.location.y+","+rs.location.x, distance(rs.location, location) AS dist 90 | ORDER BY dist 91 | ---- 92 | 93 | *Question 3 - What route has the most handicap spaces available?* 94 | 95 | [source,cypher] 96 | ---- 97 | MATCH (rs:RestStop:Open)-[:ON_ROUTE]->(r:Route) 98 | WHERE rs.handicapSpaces>0 99 | WITH r, collect(rs) AS stops ORDER BY size(stops) DESC LIMIT 1 100 | RETURN r.name AS `Route Name`, size(stops) AS `No. Stops` 101 | ---- 102 | 103 | -------------------------------------------------------------------------------- /week-6.adoc: -------------------------------------------------------------------------------- 1 | == Week 6 - New Zealand credit card spend data set 2 | 3 | In this week's episode, Alexander and Lju explore a data set on credit card spending in New Zealand, from the https://www.stats.govt.nz/[New Zealand government statistics website^]. Catch-up on the episode now! 4 | 5 | .catch-up video 6 | [caption="Week 6 ",link=https://youtu.be/_uSlkT9943w^] 7 | image::https://i.ytimg.com/vi/_uSlkT9943w/maxresdefault.jpg[] 8 | 9 | === Key links 10 | 11 | * https://dev.neo4j.com/discover-aura[Neo4j Aura landing page^] 12 | * https://catalog.data.gov/dataset/rest-areas-across-ny[New Zealand credit card spend data^] 13 | * https://data.ny.gov/api/views/qebf-4fd8/rows.csv?accessType=DOWNLOAD[Raw CSV^] 14 | * https://arrows.app[Arrows app^] 15 | * https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xODIsInkiOi02NH0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiU2VyaWVzUmVmZXJlbmNlIl0sInByb3BlcnRpZXMiOnsiaWQiOiIiLCJ2YWx1ZSI6IiIsImNhcmRUeXBlIjoiIn0sInN0eWxlIjp7fX0seyJpZCI6Im4xIiwicG9zaXRpb24iOnsieCI6MjQ3LjUwMDAwMDAwMDAwMDA2LCJ5IjotNjR9LCJjYXB0aW9uIjoiIiwibGFiZWxzIjpbIkNhdGVnb3J5Il0sInByb3BlcnRpZXMiOnsidHlwZSI6IiJ9LCJzdHlsZSI6e319LHsiaWQiOiJuMiIsInBvc2l0aW9uIjp7IngiOjEyOC41OTgzNjI4NjMwMjUwNSwieSI6LTM2MC42NDYwOTcyMDQ3NDc4fSwiY2FwdGlvbiI6IiIsImxhYmVscyI6WyJEYXRlIl0sInByb3BlcnRpZXMiOnsidmFsdWUiOiIifSwic3R5bGUiOnt9fV0sInJlbGF0aW9uc2hpcHMiOlt7ImlkIjoibjAiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMSIsInR5cGUiOiJIQVNfQ0FURUdPUlkiLCJwcm9wZXJ0aWVzIjp7fSwic3R5bGUiOnt9fSx7ImlkIjoibjEiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMiIsInR5cGUiOiJIQVNfREFURSIsInByb3BlcnRpZXMiOnt9LCJzdHlsZSI6e319XSwic3R5bGUiOnsibm9kZS1jb2xvciI6IiNmZmZmZmYiLCJib3JkZXItd2lkdGgiOjQsImJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJyYWRpdXMiOjUwLCJub2RlLXBhZGRpbmciOjUsIm5vZGUtbWFyZ2luIjoyLCJvdXRzaWRlLXBvc2l0aW9uIjoiYXV0byIsImNhcHRpb24tcG9zaXRpb24iOiJpbnNpZGUiLCJjYXB0aW9uLW1heC13aWR0aCI6MjAwLCJjYXB0aW9uLWNvbG9yIjoiIzAwMDAwMCIsImNhcHRpb24tZm9udC1zaXplIjo1MCwiY2FwdGlvbi1mb250LXdlaWdodCI6Im5vcm1hbCIsImxhYmVsLXBvc2l0aW9uIjoiaW5zaWRlIiwibGFiZWwtY29sb3IiOiIjMDAwMDAwIiwibGFiZWwtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJsYWJlbC1ib3JkZXItY29sb3IiOiIjMDAwMDAwIiwibGFiZWwtYm9yZGVyLXdpZHRoIjo0LCJsYWJlbC1mb250LXNpemUiOjQwLCJsYWJlbC1wYWRkaW5nIjo1LCJsYWJlbC1tYXJnaW4iOjQsImRpcmVjdGlvbmFsaXR5IjoiZGlyZWN0ZWQiLCJkZXRhaWwtcG9zaXRpb24iOiJpbmxpbmUiLCJkZXRhaWwtb3JpZW50YXRpb24iOiJwYXJhbGxlbCIsImFycm93LXdpZHRoIjo1LCJhcnJvdy1jb2xvciI6IiMwMDAwMDAiLCJtYXJnaW4tc3RhcnQiOjUsIm1hcmdpbi1lbmQiOjUsIm1hcmdpbi1wZWVyIjoyMCwiYXR0YWNobWVudC1zdGFydCI6Im5vcm1hbCIsImF0dGFjaG1lbnQtZW5kIjoibm9ybWFsIiwidHlwZS1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJhY2tncm91bmQtY29sb3IiOiIjZmZmZmZmIiwidHlwZS1ib3JkZXItY29sb3IiOiIjMDAwMDAwIiwidHlwZS1ib3JkZXItd2lkdGgiOjAsInR5cGUtZm9udC1zaXplIjoxNiwidHlwZS1wYWRkaW5nIjo1LCJwcm9wZXJ0eS1wb3NpdGlvbiI6Im91dHNpZGUiLCJwcm9wZXJ0eS1jb2xvciI6IiMwMDAwMDAiLCJwcm9wZXJ0eS1mb250LXNpemUiOjE2LCJwcm9wZXJ0eS1mb250LXdlaWdodCI6Im5vcm1hbCJ9fSwiZGlhZ3JhbU5hbWUiOiJOWiBjcmVkaXQgY2FyZCBzcGVuZCJ9[Data model from the session^] 16 | 17 | ==== The data set 18 | 19 | This week we explored https://www.stats.govt.nz/information-releases/electronic-card-transactions-july-2021[New Zealand credit card spend data^], which had information on amounts, dates and categories involved in the spend. 20 | 21 | Unfortunately, we discovered during the stream that the data in the CSV had a couple of issues: 22 | 23 | * We were unable to use `LOAD CSV` directly against the compressed file. Usually, this is https://neo4j.com/docs/cypher-manual/current/clauses/load-csv/[handled by Cypher^] 24 | * It turns out that the data are the stats for populating a chart 🤦 25 | 26 | For solving the first problem, we took the executive decision to just upload a decompressed version of the CSV up to a https://raw.githubusercontent.com/lju-lazarevic/misc/main/electronic-card-transactions-july-2021-csv-tables.csv[repo^], so that for those of you following along, you'll be able to run the queries in this write up. 27 | 28 | For resolving the second problem, we just shrugged our shoulders and carried on. We can still use that data to answer some questions! Just perhaps not the questions we'd liked to have asked! 29 | 30 | ==== The questions 31 | 32 | * Which per month was highest spend category? 33 | * Per category, do people spend more on credit or debit cards? - Unfortunately we can't answer this question, based on the data set! Sorry! 34 | 35 | ==== The data model 36 | 37 | You can view and play with the data model in Arrows App https://arrows.app/#/import/json=eyJncmFwaCI6eyJub2RlcyI6W3siaWQiOiJuMCIsInBvc2l0aW9uIjp7IngiOi0xODIsInkiOi02NH0sImNhcHRpb24iOiIiLCJsYWJlbHMiOlsiU2VyaWVzUmVmZXJlbmNlIl0sInByb3BlcnRpZXMiOnsiaWQiOiIiLCJ2YWx1ZSI6IiIsImNhcmRUeXBlIjoiIn0sInN0eWxlIjp7fX0seyJpZCI6Im4xIiwicG9zaXRpb24iOnsieCI6MjQ3LjUwMDAwMDAwMDAwMDA2LCJ5IjotNjR9LCJjYXB0aW9uIjoiIiwibGFiZWxzIjpbIkNhdGVnb3J5Il0sInByb3BlcnRpZXMiOnsidHlwZSI6IiJ9LCJzdHlsZSI6e319LHsiaWQiOiJuMiIsInBvc2l0aW9uIjp7IngiOjEyOC41OTgzNjI4NjMwMjUwNSwieSI6LTM2MC42NDYwOTcyMDQ3NDc4fSwiY2FwdGlvbiI6IiIsImxhYmVscyI6WyJEYXRlIl0sInByb3BlcnRpZXMiOnsidmFsdWUiOiIifSwic3R5bGUiOnt9fV0sInJlbGF0aW9uc2hpcHMiOlt7ImlkIjoibjAiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMSIsInR5cGUiOiJIQVNfQ0FURUdPUlkiLCJwcm9wZXJ0aWVzIjp7fSwic3R5bGUiOnt9fSx7ImlkIjoibjEiLCJmcm9tSWQiOiJuMCIsInRvSWQiOiJuMiIsInR5cGUiOiJIQVNfREFURSIsInByb3BlcnRpZXMiOnt9LCJzdHlsZSI6e319XSwic3R5bGUiOnsibm9kZS1jb2xvciI6IiNmZmZmZmYiLCJib3JkZXItd2lkdGgiOjQsImJvcmRlci1jb2xvciI6IiMwMDAwMDAiLCJyYWRpdXMiOjUwLCJub2RlLXBhZGRpbmciOjUsIm5vZGUtbWFyZ2luIjoyLCJvdXRzaWRlLXBvc2l0aW9uIjoiYXV0byIsImNhcHRpb24tcG9zaXRpb24iOiJpbnNpZGUiLCJjYXB0aW9uLW1heC13aWR0aCI6MjAwLCJjYXB0aW9uLWNvbG9yIjoiIzAwMDAwMCIsImNhcHRpb24tZm9udC1zaXplIjo1MCwiY2FwdGlvbi1mb250LXdlaWdodCI6Im5vcm1hbCIsImxhYmVsLXBvc2l0aW9uIjoiaW5zaWRlIiwibGFiZWwtY29sb3IiOiIjMDAwMDAwIiwibGFiZWwtYmFja2dyb3VuZC1jb2xvciI6IiNmZmZmZmYiLCJsYWJlbC1ib3JkZXItY29sb3IiOiIjMDAwMDAwIiwibGFiZWwtYm9yZGVyLXdpZHRoIjo0LCJsYWJlbC1mb250LXNpemUiOjQwLCJsYWJlbC1wYWRkaW5nIjo1LCJsYWJlbC1tYXJnaW4iOjQsImRpcmVjdGlvbmFsaXR5IjoiZGlyZWN0ZWQiLCJkZXRhaWwtcG9zaXRpb24iOiJpbmxpbmUiLCJkZXRhaWwtb3JpZW50YXRpb24iOiJwYXJhbGxlbCIsImFycm93LXdpZHRoIjo1LCJhcnJvdy1jb2xvciI6IiMwMDAwMDAiLCJtYXJnaW4tc3RhcnQiOjUsIm1hcmdpbi1lbmQiOjUsIm1hcmdpbi1wZWVyIjoyMCwiYXR0YWNobWVudC1zdGFydCI6Im5vcm1hbCIsImF0dGFjaG1lbnQtZW5kIjoibm9ybWFsIiwidHlwZS1jb2xvciI6IiMwMDAwMDAiLCJ0eXBlLWJhY2tncm91bmQtY29sb3IiOiIjZmZmZmZmIiwidHlwZS1ib3JkZXItY29sb3IiOiIjMDAwMDAwIiwidHlwZS1ib3JkZXItd2lkdGgiOjAsInR5cGUtZm9udC1zaXplIjoxNiwidHlwZS1wYWRkaW5nIjo1LCJwcm9wZXJ0eS1wb3NpdGlvbiI6Im91dHNpZGUiLCJwcm9wZXJ0eS1jb2xvciI6IiMwMDAwMDAiLCJwcm9wZXJ0eS1mb250LXNpemUiOjE2LCJwcm9wZXJ0eS1mb250LXdlaWdodCI6Im5vcm1hbCJ9fSwiZGlhZ3JhbU5hbWUiOiJOWiBjcmVkaXQgY2FyZCBzcGVuZCJ9[here^]. 38 | 39 | Nothing particularly contraversial here, and as always, there are a number of ways to do the model. One stand-out item here, we put `cardType` as a property on `SeriesReference`. We could have potentially done this as a double label as well. 40 | 41 | .The New Zealand credit card data model used in the stream 42 | image::img\nzcc.png[] 43 | 44 | ==== Loading the data 45 | 46 | To load the data into the database, we use the following query: 47 | 48 | [source,cypher] 49 | ---- 50 | LOAD CSV WITH HEADERS FROM "https://raw.githubusercontent.com/lju-lazarevic/misc/main/electronic-card-transactions-july-2021-csv-tables.csv" AS row 51 | WITH row 52 | WHERE row.Series_title_1 = "Actual" 53 | MERGE (c:Category {type:row.Series_title_2}) 54 | MERGE (d:Date {value:row.Period}) 55 | CREATE (s:SeriesReference {id:row.Series_reference, value:tofloat(row.Data_value)}) 56 | CREATE (s)-[:HAS_DATE]->(d) 57 | CREATE (s)-[:HAS_Category]->(c) 58 | ---- 59 | 60 | Note that we're only drawing the 'Actual' values from the data. Also, `row.Series_title_2` (fairly safe to say this gives the game away about the data - whoops) has a mix of things, including those category titles we're interested in. 61 | 62 | As before, we need to cast lots of the numbers into floats as appropriate!. 63 | 64 | ==== Querying the data 65 | 66 | *Question - Which per month was highest spend category?* 67 | 68 | Starting off, let's have a look at what comes back as a category. 69 | 70 | [source,cypher] 71 | ---- 72 | MATCH (d:Date)<--(s)-->(c:Category) 73 | WHERE s.value IS NOT NULL 74 | RETURN d.value AS Date, s.value AS Spend, c.type AS Category ORDER BY Date, Category 75 | ---- 76 | 77 | As well as getting categories of interest, we also get a bunch of other values we're not interested in, such as 'Total spend', etc. We can provide a list of things we're interested in to tweak the above query: 78 | 79 | [source,cypher] 80 | ---- 81 | WITH ["Apparel", "Consumables", "Durables", "Fuel", "Hospitality", "Motor vehicles excl. fuel", "Non-retail excl. services", "Services"] AS cats 82 | MATCH (d:Date)<--(s)-->(c:Category) 83 | WHERE s.value IS NOT NULL AND c.type IN cats 84 | RETURN d.value AS Date, s.value AS Spend, c.type AS Category ORDER BY Date, Category 85 | ---- 86 | 87 | Last but not least, the specific question was to get the top category per month, so let's get that done! We'll do it by using a little trick of ordering and then collecting values into an array, and then pulling the first value to get the 'top' values: 88 | 89 | [source,cypher] 90 | ---- 91 | WITH ["Apparel", "Consumables", "Durables", "Fuel", "Hospitality", "Motor vehicles excl. fuel", "Non-retail excl. services", "Services"] AS cats 92 | MATCH (d:Date)<--(s)-->(c:Category) 93 | WHERE s.value IS NOT NULL AND c.type IN cats 94 | WITH d, s, c ORDER BY d.value, s.value desc 95 | WITH d, collect([c.type, s.value]) as col 96 | RETURN d.value AS Date, col[0][1] AS Spend, col[0][0] AS Category 97 | ---- 98 | 99 | [TIP] 100 | When using multiple values as part of an `ORDER BY`, you will need to specify each time the order, either ascending (leave blank as is by default) or descending with `DESC` 101 | 102 | -------------------------------------------------------------------------------- /week-7.adoc: -------------------------------------------------------------------------------- 1 | == Week 7 - Jungle of German Election Landscape 2 | 3 | === Graph-Analysis Wahl-O-Mat Bundestagswahl 2021 4 | 5 | For every German Election the "Wahl-O-Mat" offers an interactive tool to compare your views on a number of topics/theses with the polical parties up for election. 6 | 7 | You can try the interactive comparison at: https://www.wahl-o-mat.de 8 | 9 | === Source Data 10 | 11 | The data can be https://www.bpb.de/politik/wahlen/wahl-o-mat/bundestagswahl-2021/337541/download[downloaded from the site^], the zip-file contains an excel sheet, that we can export as a CSV. 12 | 13 | Our analysis is only for educational and scientific use. 14 | 15 | ==== 16 | Die Bundeszentrale für politische Bildung ist Urheber des nachfolgend veröffentlichten "Wahl-O-Mat-Datensatzes". Die Veröffentlichung des Datensatzes dient lediglich dem Zugang zu den in ihm enthaltenen Informationen. Jede Nutzung des Datensatzes, egal welcher Art, wird untersagt. Die Schranken des Urheberrechts durch gesetzlich erlaubte Nutzung bleiben hiervon unberührt. 17 | 18 | Eine Ausnahme gilt nur für die Analyse des Datensatzes zu wissenschaftlichen oder journalistischen Zwecken sowie für die Veröffentlichung der Ergebnisse dieser Analyse. Dabei muss jederzeit klar erkennbar sein, dass die Bundeszentrale für politische Bildung nicht Urheber dieser Analyse ist. 19 | ==== 20 | 21 | === Graph Database 22 | 23 | We're loading and exploring our data in https://console.neo4j.io[Neo4j Aura Free^]. 24 | 25 | === Data Model 26 | 27 | The data model is pretty straightforward, we create a node for `Party` and `Topic` each and store the stance of the party as a weight on `POSITION` releationhip, where 28 | 29 | * disagree is 0.0 30 | * neutral is 0.5 31 | * agree is 1.0 32 | 33 | image::img/election-party-topic.png[] 34 | 35 | === Data Import 36 | 37 | The CSV can be loaded directly into the Database using LOAD CSV and this script: 38 | 39 | .Create Indexes 40 | [source,cypher] 41 | ---- 42 | create index on :Party(name); 43 | create index on :Topic(name); 44 | create constraint if not exists on (p:Party) assert p.id is unique; 45 | create constraint if not exists on (t:Topic) assert t.id is unique; 46 | ---- 47 | 48 | .Load Data 49 | [source,cypher] 50 | ---- 51 | LOAD CSV WITH HEADERS FROM 52 | "https://github.com/neo4j-examples/discoveraurafree/raw/main/data/wom-btw-2021.csv" 53 | AS row 54 | 55 | MERGE (p:Party {id:toInteger(row.`Partei: Nr.`)}) 56 | ON CREATE SET p.text = row.`Partei: Name`, p.name = row.`Partei: Kurzbezeichnung` 57 | MERGE (t:Topic {id:toInteger(row.`These: Nr.`)}) 58 | ON CREATE SET t.name = row.`These: Titel`, t.text = row.`These: These` 59 | 60 | MERGE (p)-[pos:POSITION]->(t) 61 | ON CREATE SET pos.text = row.`Position: Begründung`, 62 | pos.weight = 63 | CASE row.`Position: Position` 64 | WHEN "stimme nicht zu" THEN 0.0 65 | WHEN "stimme zu" THEN 1.0 66 | WHEN "neutral" THEN 0.5 67 | END 68 | 69 | RETURN count(*); 70 | ---- 71 | 72 | === Exploration 73 | 74 | We can just visualize the Data by querying with Neo4j Browser or Neo4j Bloom (where we can style the results based on attributes). 75 | 76 | .top 5 parties, same positions 77 | [source,cypher] 78 | ---- 79 | MATCH (p:Party)-[r:POSITION]->(t) 80 | WHERE p.id <= 6 AND t.id <10 AND r.weight = 1 81 | RETURN *; 82 | ---- 83 | 84 | We can also compute the similarity (distance) between parties, similar to ratings of movies by the sum or avg of weight distances. 85 | 86 | .similarity (distance) 87 | [source,cypher] 88 | ---- 89 | MATCH (p1:Party)-[r1:POSITION]->(t:Topic)<-[r2:POSITION]-(p2:Party) 90 | WHERE id(p1)>id(p2) 91 | RETURN p1.name,p2.name, sum(abs(r1.weight-r2.weight)) AS sum, 92 | avg(abs(r1.weight-r2.weight)) AS avg 93 | ORDER BY sum ASC; 94 | ---- 95 | 96 | We can turn that similarity (distance) when it's below a certain threshhold into a relationship: 97 | 98 | .similarity relationship 99 | [source,cypher] 100 | ---- 101 | MATCH (p1:Party)-[r1:POSITION]->(t:Topic)<-[r2:POSITION]-(p2:Party) 102 | WHERE id(p1)>id(p2) 103 | WITH p1, p2, avg(abs(r1.weight-r2.weight)) AS dist 104 | WHERE dist < 0.3 105 | MERGE (p1)-[s:SIMILAR]-(p2) SET s.weight = 1-dist; 106 | ---- 107 | 108 | 109 | === Similar Analyses 110 | 111 | * https://www.dkriesel.com/blog/2021/0903_wahl-o-mat-auswertung_bundestagswahl_2021[Wahl-O-Mat-Exploration Bundestagswahl 2021: Party Landscape by D.Kriesel^] 112 | 113 | -------------------------------------------------------------------------------- /week-8.adoc: -------------------------------------------------------------------------------- 1 | == Week 8 - StackOverflow 2 | 3 | The Stackoverflow data is a really fun dataset. 4 | Every developer who ever asked or answered questions there or just copied code can relate to it. 5 | 6 | We wanted to answer two questions: 7 | 8 | * What other tags are related to this tag? 9 | * Which users could answer this unanswered question best. 10 | 11 | Our model in Arrows had users asking questions, that are tagged and other users answering these questions. 12 | 13 | image::img/stackoverflow.png[] 14 | 15 | Then we looked at the data returned from the StackOverflow REST API which gives us the opportunity to find pages of questions with certain tags. 16 | 17 | E.g. this https://api.stackexchange.com/2.2/questions?pagesize=100&order=desc&sort=creation&tagged=neo4j&site=stackoverflow&filter=!5-i6Zw8Y)4W7vpy91PMYsKM-k9yzEsSC1_Uxlf[link returns the last 100 questions for neo4j^]. 18 | 19 | We're using `apoc.load.json` procedure to load the data from the REST API and then regular Cypher to create the graph data from the response. 20 | 21 | Then we incrementally looked at the data and imported, questions, users and tags, we used the starting statement from the https://neo4j.com/labs/apoc/4.1/import/load-json/#load-json-examples-stackoverflow[APOC docs page for load json^]. 22 | 23 | It takes the data from the REST API call, turns the "items" aka questiosn from a list into rows and then returns for each question the title, owner (map), creation date, and the other top-level keys of the question. 24 | 25 | [source,cypher] 26 | ---- 27 | WITH "https://api.stackexchange.com/2.2/questions?pagesize=100&order=desc&sort=creation&tagged=neo4j&site=stackoverflow&filter=!5-i6Zw8Y)4W7vpy91PMYsKM-k9yzEsSC1_Uxlf" AS url 28 | CALL apoc.load.json(url) YIELD value 29 | UNWIND value.items AS item 30 | RETURN item.title, item.owner, item.creation_date, keys(item) 31 | LIMIT 5; 32 | ---- 33 | 34 | After importing the minimal data we could answer our first question - which tags are related to each other. 35 | 36 | The query was, e.g. for the "cypher" tag. 37 | 38 | [source,cypher] 39 | ---- 40 | match (t:Tag {name:"cypher"})<-[:TAGGED]-(q:Question)-[:TAGGED]->(t2:Tag) 41 | return t2.name,count(*) as c 42 | order by c desc limit 10 43 | ---- 44 | 45 | 46 | Our second question - Who can answer this question best? - required us to import also the answers and people answering into the graph. 47 | 48 | For that we just took the example statement from the [APOC docs^] but reduced the page-size to 50 to deal with an Aura Free memory limit. 49 | 50 | [source,cypher] 51 | ---- 52 | WITH "https://api.stackexchange.com/2.2/questions?pagesize=50&order=desc&sort=creation&tagged=neo4j&site=stackoverflow&filter=!5-i6Zw8Y)4W7vpy91PMYsKM-k9yzEsSC1_Uxlf" AS url 53 | CALL apoc.load.json(url) YIELD value 54 | UNWIND value.items AS q 55 | MERGE (question:Question {id:q.question_id}) 56 | ON CREATE SET question.title = q.title, 57 | question.share_link = q.share_link, 58 | question.favorite_count = q.favorite_count 59 | 60 | FOREACH (tagName IN q.tags | MERGE (tag:Tag {name:tagName}) MERGE (question)-[:TAGGED]->(tag)) 61 | FOREACH (a IN q.answers | 62 | MERGE (question)<-[:ANSWERS]-(answer:Answer {id:a.answer_id}) 63 | MERGE (answerer:User {id:a.owner.user_id}) ON CREATE SET answerer.display_name = a.owner.display_name 64 | MERGE (answer)<-[:PROVIDED]-(answerer) 65 | ) 66 | 67 | WITH * WHERE NOT q.owner.user_id IS NULL 68 | MERGE (owner:User {id:q.owner.user_id}) ON CREATE SET owner.display_name = q.owner.display_name 69 | MERGE (owner)-[:ASKED]->(question) 70 | ---- 71 | 72 | Then we could build up our query step by step to find best folks to answer unanswered questions. 73 | 74 | [source,cypher] 75 | ---- 76 | match (q0:Question)-[:TAGGED]->(tag) where not exists { (q0)<-[:ANSWERS]-() } 77 | with q0, tag limit 5 78 | match (q)-[:TAGGED]->(tag:Tag) 79 | match (q:Question)<-[:ANSWERS]-(a)<-[:PROVIDED]-(u:User) 80 | 81 | return q0.title, collect(distinct tag.name) as tags, u.display_name, count(*) as c 82 | 83 | order by c desc limit 10 84 | ---- 85 | 86 | For our second question we also had to import answers and the people posting them, so that we could 87 | 88 | The recording https://youtu.be/arjywFPvf80?t=722[is here^] 89 | -------------------------------------------------------------------------------- /week-9.adoc: -------------------------------------------------------------------------------- 1 | == Week 9 - GDelt Project 2 | 3 | This week we want to explore the https://www.gdeltproject.org/[GDelt project^], which collects and analyses global news from hundreds of sources and makes them available in many formats. 4 | 5 | You can https://www.youtube.com/watch?v=7iONKK8gleM&list=PL9Hl4pk2FsvVZaoIpfsfpdzEXxyUJlAYw&index=8[watch the recording of the GDelt Exploration here^]. 6 | 7 | For our needs their API is good enough but if you want to go deeper there is much more to be found. 8 | 9 | * API page: https://blog.gdeltproject.org/gdelt-geo-2-0-api-debuts/ 10 | * JSON API: https://api.gdeltproject.org/api/v2/geo/geo?query=elections&MODE=country&format=geojson&TIMESPAN=1d&GEORES=0 11 | * CSV API: https://api.gdeltproject.org/api/v2/geo/geo?query=elections&MODE=country&format=csv&TIMESPAN=7d&GEORES=0 12 | 13 | We'll be using the CSV endpoint to get news for a certain topic with geolocation and country. 14 | 15 | We could also use the JSON result but it misses the geo-information. 16 | 17 | Unfortunately the REST API is a bit too limited for real use, as it does not return 18 | 19 | * language 20 | * timestamp 21 | * entities (people, locations, organizations) 22 | 23 | So for properly using GDelt you have to query the bigquery tables to extract all that detail. 24 | 25 | David Allen has explored that in this repository: https://github.com/moxious/gdelt 26 | 27 | === Data Model 28 | 29 | The data model is pretty straightforward, we have 30 | 31 | * News 32 | * Country 33 | * Topic 34 | 35 | image::img/gdelt-model.png[] 36 | 37 | === Data Import 38 | 39 | .Exploring the data 40 | [source,cypher] 41 | ---- 42 | WITH "elections" AS topic 43 | LOAD CSV WITH HEADERS FROM "https://api.gdeltproject.org/api/v2/geo/geo?query="+topic+"&MODE=country&format=csv&TIMESPAN=7d&GEORES=0" AS row 44 | RETURN row LIMIT 5 45 | ---- 46 | 47 | .Loading the data 48 | [source,cypher] 49 | ---- 50 | WITH "elections" AS topic 51 | LOAD CSV WITH HEADERS FROM "https://api.gdeltproject.org/api/v2/geo/geo?query="+topic+"&MODE=country&format=csv&TIMESPAN=7d&GEORES=0" AS row 52 | 53 | MERGE (t:Topic {name:topic}) 54 | 55 | MERGE (n:News {url:row.URL}) 56 | ON CREATE SET n.title=row.Title, n.location=point({latitude:toFloat(row.Latitude), longitude:toFloat(row.Longitude)}), n.image=row.ImageURL 57 | 58 | MERGE (n))-[:TOPIC]->(t) 59 | 60 | MERGE (c:Country {name:row.Location}) ON CREATE SET c.location = n.location 61 | MERGE (n)-[:COUNTRY]->(c) 62 | MERGE (t)-[r:RESULTS]->(c) SET r.count=toInteger(row.LocationResultCount) 63 | ---- 64 | 65 | Feel free to use other topics to query, we used these additional ones in the session: 66 | 67 | * climate 68 | * china 69 | * usa 70 | * taiwan 71 | * corona 72 | * vaccines 73 | 74 | === Data Exploration 75 | 76 | .Some News with Topic and Country 77 | [source,cypher] 78 | ---- 79 | MATCH (c:Country)<-[:COUNTRY]-(n:News)-[:TOPIC]->(t:Topic) 80 | RETURN * LIMIT 20 81 | ---- 82 | 83 | .News per Country 84 | [source,cypher] 85 | ---- 86 | match (c:Country) 87 | return c, size( (c)<-[:COUNTRY]-()) as newsCount 88 | order by newsCount desc LIMIT 5 89 | ---- 90 | 91 | .Topic Overlap between News 92 | [source,cypher] 93 | ---- 94 | MATCH path=(t1:Topic)<-[:TOPIC]-(n:News)-[:TOPIC]->(t2:Topic) 95 | RETURN path LIMIT 20 96 | ---- 97 | 98 | image::img/gdelt-overlap.png[] 99 | 100 | 101 | We also looked at how to expand our news graph by extracting new topics from titles. 102 | 103 | .Extract Top Words from Titles 104 | [source,cypher] 105 | ---- 106 | match (n:News) 107 | unwind apoc.text.split(toLower(n.title), "\W+") as word 108 | with word where size(word) > 3 109 | return word, count(*) order by count(*) desc limit 100 110 | ---- 111 | --------------------------------------------------------------------------------