Wikidata:WikiProject Civil Defense/List of firefighting organizations

From Wikidata
Jump to navigation Jump to search

Context

[edit]

Query

[edit]

Wikidata

[edit]

Global query

[edit]

The following query uses these:

  • Properties: subclass of (P279)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, applies to jurisdiction (P1001)  View with Reasonator View with SQID, operating area (P2541)  View with Reasonator View with SQID, official website (P856)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID
    # instance_of=fire department (Q6498663)
    SELECT DISTINCT ?item ?itemLabel ?countryLabel ?jurisdictionLabel ?operating_areaLabel ?official_website WHERE {
      VALUES ?instances_of {
        wd:Q6498663
      }
      ?item (p:P31/ps:P31/(wdt:P279*)) ?instances_of.
      OPTIONAL { ?item wdt:P17 ?country. }
      OPTIONAL { ?item wdt:P1001 ?jurisdiction. }
      OPTIONAL { ?item wdt:P2541 ?operating_area. }
      OPTIONAL { ?item wdt:P856 ?official_website. }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru,es,ja,zh,ar". }
    }
    ORDER BY (?countryLabel) (?jurisdictionLabel) (?operating_areaLabel)
    LIMIT 5000
    


Country-level query example

[edit]

The following query uses these:

  • Properties: subclass of (P279)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, applies to jurisdiction (P1001)  View with Reasonator View with SQID, operating area (P2541)  View with Reasonator View with SQID, official website (P856)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID
    # instance_of=fire department (Q6498663); Brazil (Q155)
    SELECT DISTINCT ?item ?itemLabel ?countryLabel ?jurisdictionLabel ?operating_areaLabel ?official_website WHERE {
      VALUES ?instances_of {
        wd:Q6498663
      }
      ?item (p:P31/ps:P31/(wdt:P279*)) ?instances_of;
        wdt:P17 ?country;
        p:P17 ?statement1.
      ?statement1 ps:P17 wd:Q155.  # Q155 = Brazil; Change here to select another country
      OPTIONAL { ?item wdt:P1001 ?jurisdiction. }
      OPTIONAL { ?item wdt:P2541 ?operating_area. }
      OPTIONAL { ?item wdt:P856 ?official_website. }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru,es,ja,zh,ar". }
    }
    ORDER BY (?countryLabel) (?jurisdictionLabel) (?operating_areaLabel)
    LIMIT 5000
    


Maintenance queries

[edit]

Without country

[edit]

The following query uses these:

  • Properties: subclass of (P279)  View with Reasonator View with SQID, country (P17)  View with Reasonator View with SQID, applies to jurisdiction (P1001)  View with Reasonator View with SQID, operating area (P2541)  View with Reasonator View with SQID, official website (P856)  View with Reasonator View with SQID, instance of (P31)  View with Reasonator View with SQID
    # instance_of=fire department (Q6498663) ; FILTER NOT P17
    SELECT DISTINCT ?item ?itemLabel ?countryLabel ?jurisdictionLabel ?operating_areaLabel ?official_website WHERE {
      VALUES ?instances_of {
        wd:Q6498663
      }
      ?item (p:P31/ps:P31/(wdt:P279*)) ?instances_of.
      FILTER(NOT EXISTS { ?item wdt:P17 ?val. })  # only without country
      OPTIONAL { ?item wdt:P17 ?country. }
      OPTIONAL { ?item wdt:P1001 ?jurisdiction. }
      OPTIONAL { ?item wdt:P2541 ?operating_area. }
      OPTIONAL { ?item wdt:P856 ?official_website. }
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de,fr,ru,es,ja,zh,ar". }
    }
    ORDER BY (?countryLabel) (?jurisdictionLabel) (?operating_areaLabel)
    LIMIT 5000
    

OpenStreetMap

[edit]

List

[edit]

Removed global level Listeria table (not able to render anymore with more detailed items)

Examples of queries by country

[edit]