From d75f1c74fbf86652b02520de6ed46c981cf27e50 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 6 Nov 2020 10:13:05 +0000 Subject: Adding Tennessee items --- semantic_enrichment/countries.ttl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'semantic_enrichment') diff --git a/semantic_enrichment/countries.ttl b/semantic_enrichment/countries.ttl index 08e9c38..fe50b16 100644 --- a/semantic_enrichment/countries.ttl +++ b/semantic_enrichment/countries.ttl @@ -1328,7 +1328,25 @@ ns1:P17 ; ns1:P625 "Point(31.239444444 30.056111111)" . + rdfs:label "Smithville" ; + ns1:P17 ; + ns1:P625 "Point(-85.820833333 35.957222222)" . + + rdfs:label "Nashville" ; + ns1:P17 ; + ns1:P625 "Point(-86.783888888 36.165)" . + + rdfs:label "Pegram" ; + ns1:P17 ; + ns1:P625 "Point(-87.051666666 36.101666666)" . + + rdfs:label "Madison County" ; + ns1:P17 ; + ns1:P625 "Point(-88.84 35.61)" . + rdfs:label "Alexander City" ; + ns1:P17 ; + ns1:P625 "Point(-85.936008 32.933157)" . rdfs:label "Oceania" . rdfs:label "North America" . -- cgit v1.2.3 From 951ebe949d88cdbfed028e0a2a420ce7921c3919 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 6 Nov 2020 10:31:56 +0000 Subject: Countries --- scripts/db_enrichment/input_location.csv | 21 ++++++--- scripts/uthsc_samples/uthsc_samples.py | 12 ++--- semantic_enrichment/countries.ttl | 75 ++++++++++++++++++++++++-------- 3 files changed, 80 insertions(+), 28 deletions(-) (limited to 'semantic_enrichment') diff --git a/scripts/db_enrichment/input_location.csv b/scripts/db_enrichment/input_location.csv index eb5322a..a4246cd 100644 --- a/scripts/db_enrichment/input_location.csv +++ b/scripts/db_enrichment/input_location.csv @@ -1,5 +1,16 @@ -http://www.wikidata.org/entity/Q3289517 -http://www.wikidata.org/entity/Q79663 -http://www.wikidata.org/entity/Q2145339 -http://www.wikidata.org/entity/Q23197 -http://www.wikidata.org/entity/Q494755 +http://www.wikidata.org/entity/Q7960498 +http://www.wikidata.org/entity/Q692895 +http://www.wikidata.org/entity/Q928 +http://www.wikidata.org/entity/Q2722074 +http://www.wikidata.org/entity/Q25622187 +http://www.wikidata.org/entity/Q27684996 +http://www.wikidata.org/entity/Q2757125 +http://www.wikidata.org/entity/Q1922283 +http://www.wikidata.org/entity/Q490 +http://www.wikidata.org/entity/Q677037 +http://www.wikidata.org/entity/Q3037 +http://www.wikidata.org/entity/Q843 +http://www.wikidata.org/entity/Q183 +http://www.wikidata.org/entity/Q29 +http://www.wikidata.org/entity/Q17 +http://www.wikidata.org/entity/Q810 diff --git a/scripts/uthsc_samples/uthsc_samples.py b/scripts/uthsc_samples/uthsc_samples.py index c18c07a..3ad2561 100644 --- a/scripts/uthsc_samples/uthsc_samples.py +++ b/scripts/uthsc_samples/uthsc_samples.py @@ -32,13 +32,13 @@ for index, row in table.iterrows(): sample_name = sample collection_date = parse(str(row['Collection Date'])).strftime('%Y-%m-%d') locationx = row['City']+", "+row['State']+", USA" - location = "http://www.wikidata.org/enitity/Q16563" # Memphis by default + location = "http://www.wikidata.org/entity/Q16563" # Memphis by default map = { - "Pegram": "http://www.wikidata.org/enitity/Q3289517", - "Alexander": "http://www.wikidata.org/enitity/Q79663", - "Smithville": "http://www.wikidata.org/enitity/Q2145339", - "Nashville": "http://www.wikidata.org/enitity/Q23197", - "Madison": "http://www.wikidata.org/enitity/Q494755" + "Pegram": "http://www.wikidata.org/entity/Q3289517", + "Alexander": "http://www.wikidata.org/entity/Q79663", + "Smithville": "http://www.wikidata.org/entity/Q2145339", + "Nashville": "http://www.wikidata.org/entity/Q23197", + "Madison": "http://www.wikidata.org/entity/Q494755" } for name in map: diff --git a/semantic_enrichment/countries.ttl b/semantic_enrichment/countries.ttl index fe50b16..728877f 100644 --- a/semantic_enrichment/countries.ttl +++ b/semantic_enrichment/countries.ttl @@ -220,7 +220,6 @@ ns1:P17 ; ns1:P625 "Point(-120.0 37.0)" . - rdfs:label "Brazil" ; ns1:P17 ; ns1:P30 ; @@ -1157,7 +1156,9 @@ ns1:P625 "Point(28.0 -14.0)" . rdfs:label "Mexico" ; - ns1:P30 . + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(-102.0 23.0)" . rdfs:label "Morocco" ; ns1:P17 ; @@ -1170,32 +1171,17 @@ ; ns1:P625 "Point(94.25 66.416666666)" . - rdfs:label "Germany" ; - ns1:P30 . - - rdfs:label "Spain" ; - ns1:P30 . - - rdfs:label "Italy" ; - ns1:P30 . - rdfs:label "Netherlands" ; ns1:P17 ; ns1:P30 , ; ns1:P625 "Point(5.55 52.316666666)" . - rdfs:label "Jordan" ; - ns1:P30 . - rdfs:label "Sierra Leone" ; ns1:P17 ; ns1:P30 ; ns1:P625 "Point(-11.916667 8.5)" . - rdfs:label "Japan" ; - ns1:P30 . - rdfs:label "Tunisia" ; ns1:P17 ; ns1:P30 ; @@ -1348,6 +1334,61 @@ ns1:P17 ; ns1:P625 "Point(-85.936008 32.933157)" . + rdfs:label "Mehsana" ; + ns1:P17 ; + ns1:P625 "Point(72.4 23.6)" . + + rdfs:label "Kathmandu" ; + ns1:P17 ; + ns1:P625 "Point(85.366666666 27.716666666)" . + + rdfs:label "Milan" ; + ns1:P17 ; + ns1:P625 "Point(9.19 45.466944444)" . + + rdfs:label "Telangana" ; + ns1:P17 ; + ns1:P625 "Point(79.59 17.99)" . + + rdfs:label "Philippines" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(123.0 12.0)" . + + rdfs:label "Mehsana" ; + ns1:P17 ; + ns1:P625 "Point(72.4 23.6)" . + + rdfs:label "Japan" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(136.0 35.0)" . + + rdfs:label "Germany" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(10.0 51.0)" . + + rdfs:label "Spain" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(-3.5 40.2)" . + + rdfs:label "Jordan" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(36.5 31.2)" . + + rdfs:label "Pakistan" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(71.0 30.0)" . + + rdfs:label "Philippines" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(123.0 12.0)" . + rdfs:label "Oceania" . rdfs:label "North America" . rdfs:label "South America" . -- cgit v1.2.3 From 6c654dd60f98d473ba94fda6143d8b8b00f99586 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 6 Nov 2020 12:58:38 +0000 Subject: Add country entries that miss coordinates --- scripts/db_enrichment/country_enrichment.py | 2 +- semantic_enrichment/countries.ttl | 30 ++++++++++++++++++++++++----- 2 files changed, 26 insertions(+), 6 deletions(-) (limited to 'semantic_enrichment') diff --git a/scripts/db_enrichment/country_enrichment.py b/scripts/db_enrichment/country_enrichment.py index f62a64e..37329fb 100644 --- a/scripts/db_enrichment/country_enrichment.py +++ b/scripts/db_enrichment/country_enrichment.py @@ -72,7 +72,6 @@ construct { } WHERE { BIND (XXX as ?a) . - ?a wdt:P625 ?c. ?a rdfs:label ?label . ?a wdt:P17 ?country. ?country rdfs:label ?country_label . @@ -81,6 +80,7 @@ construct { FILTER (lang(?continent_label)='en') FILTER (lang(?country_label)='en') FILTER (lang(?label)='en') + OPTIONAL { ?a wdt:P625 ?c } } """"" diff --git a/semantic_enrichment/countries.ttl b/semantic_enrichment/countries.ttl index 728877f..b0651cf 100644 --- a/semantic_enrichment/countries.ttl +++ b/semantic_enrichment/countries.ttl @@ -348,11 +348,6 @@ ns1:P30 ; ns1:P625 "Point(137.0 -28.0)" . - rdfs:label "India" ; - ns1:P17 ; - ns1:P30 ; - ns1:P625 "Point(83.0 22.8)" . - rdfs:label "Colombia" ; ns1:P17 ; ns1:P30 ; @@ -1389,6 +1384,31 @@ ns1:P30 ; ns1:P625 "Point(123.0 12.0)" . + rdfs:label "Bayad" ; + ns1:P17 ; + ns1:P625 "Point(73.0 20.8)" . + + rdfs:label "Choryasi Taluka" ; + ns1:P17 ; + ns1:P625 "Point(73.0 20.8)" . + + rdfs:label "Daskroi" ; + ns1:P17 ; + ns1:P625 "Point(72.0 22.0)" . + + rdfs:label "Wairarapa" ; + ns1:P17 ; + ns1:P625 "Point(174.0 -41.2)" . + + rdfs:label "Waitemata City" ; + ns1:P17 ; + ns1:P625 "Point(174.0 -41.2)" . + + rdfs:label "India" ; + ns1:P17 ; + ns1:P30 ; + ns1:P625 "Point(83.0 22.8)" . + rdfs:label "Oceania" . rdfs:label "North America" . rdfs:label "South America" . -- cgit v1.2.3 From 50f77e0c67d2003d9f36e9ee0f3f81d9b63b04af Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Fri, 6 Nov 2020 13:05:18 +0000 Subject: Add location --- semantic_enrichment/countries.ttl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'semantic_enrichment') diff --git a/semantic_enrichment/countries.ttl b/semantic_enrichment/countries.ttl index b0651cf..cb5a503 100644 --- a/semantic_enrichment/countries.ttl +++ b/semantic_enrichment/countries.ttl @@ -1388,6 +1388,10 @@ ns1:P17 ; ns1:P625 "Point(73.0 20.8)" . + rdfs:label "Adajan" ; + ns1:P17 ; + ns1:P625 "Point(72.49 21.1)" . + rdfs:label "Choryasi Taluka" ; ns1:P17 ; ns1:P625 "Point(73.0 20.8)" . -- cgit v1.2.3