User:Martin schilliger/Hospitals and Institutions for use in paramedic services

Hospitals and Institutions for use in paramedic services

edit

For discussion see also OSM Wiki DE:Switzerland/Kerngruppe_Notfallorganisationen

Extract all active swiss hospitals and other medical institutions from Wikidata

edit

This 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:

  • 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

Overpass Turbo query

  • 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

edit

http://overpass-api.de/api/interpreter?data=%5Bout%3Acustom%5D%3Bnwr%5Bwikidata%3D{Wikidata-ID}%5D%3Bout%3B

Things 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)