User:Martin schilliger/Hospitals and Institutions for use in paramedic services
Hospitals and Institutions for use in paramedic services
editFor discussion see also OSM Wiki DE:Switzerland/Kerngruppe_Notfallorganisationen
Extract all active swiss hospitals and other medical institutions from Wikidata
editThis is for the Query Builder of Wikidata. The editor has a button named «Code» where you can copy the quere to multiple languages like Java, JavaScript or PHP. You can also select if it should be displayed as a map (my default) or table data. If there are multiple coordinates on the entry, it appears two times on the list. Details about the Query Language you can find in WikiBooks.
The following query uses these:
- Items: hospital (Q16917) , retirement home (Q22908) , nursing home (Q837142) , medical facility (Q4260475) , Switzerland (Q39) , out of service (Q56651571)
- Properties: coordinate location (P625) , instance of (P31) , subclass of (P279) , country (P17) , state of use (P5817) , OpenStreetMap relation ID (P402)
SELECT DISTINCT ?item ?geo ?osmnode ?status ?itemLabel WHERE { ?item wdt:P625 ?geo. #liegt in der Schweiz { ?item (wdt:P31/(wdt:P279*)) wd:Q16917. } #Spital UNION { ?item (wdt:P31/(wdt:P279*)) wd:Q22908. } #Altersheim UNION { ?item (wdt:P31/(wdt:P279*)) wd:Q837142. } #Pflegeheim UNION { ?item (wdt:P31/(wdt:P279*)) wd:Q4260475. } #medizinische Einrichtung ?item wdt:P17 wd:Q39. FILTER NOT EXISTS { ?item wdt:P5817 wd:Q56651571 } OPTIONAL { ?item wdt:P402 ?osmnode. } # OSM-Node SERVICE wikibase:label { bd:serviceParam wikibase:language "de-ch,de,fr,it,rm,en". #Reihenfolge der Sprache (rm = rätromanisch) ?item rdfs:label ?itemLabel. } } ORDER BY (?itemLabel)
Extract alls institutions in switzerland from OSM
edit- an OSM node can have a wikidata-tag, but a wikidata entry cannot refer to osm node (only relation)
Open a Wikidata-ID directly in OSM
editThings to check:
edit- What about a hospital with multiple places? (Kantonsspital St.Gallen with Flawil and Rorschach)
- Are there swiss hospital entries without country set
- Is state of use set correctly everywhere? (I didn't use former hospital because it could be used as nursing home after ending beeing a hospital)