Wikidata:WikiProject Protected areas/Queries

From Wikidata
Jump to navigation Jump to search

Home

 

Properties

 

Taxonomy

 

Queries

 

Todo

 

National parks[edit]

List of national parks of Australia[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, located in the administrative territorial entity (P131)  View with Reasonator View with SQID, inception (P571)  View with Reasonator View with SQID, operator (P137)  View with Reasonator View with SQID, main regulatory text (P92)  View with Reasonator View with SQID, Commons category (P373)  View with Reasonator View with SQID, area (P2046)  View with Reasonator View with SQID
    SELECT DISTINCT ?national_park_of_Australia ?national_park_of_AustraliaLabel ?administrative_areaLabel ?area ?establishedYear ?operatorLabel ?main_regulatory_text ?main_regulatory_textLabel ?commons_category_link WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
      ?national_park_of_Australia wdt:P31 wd:Q18618819.
      ?national_park_of_Australia wdt:P31/wdt:P279* wd:Q17000624.
      ?national_park_of_Australia wdt:P131 ?administrative_area.
      ?administrative_area wdt:P31/wdt:P279* wd:Q178712.
      OPTIONAL {
        ?national_park_of_Australia wdt:P571 ?established.
        BIND(STR(YEAR(?established)) AS ?establishedYear).
      }.
      OPTIONAL { ?national_park_of_Australia wdt:P137 ?operator }.
      OPTIONAL { ?national_park_of_Australia wdt:P92 ?main_regulatory_text }.
      OPTIONAL { ?national_park_of_Australia p:P2046/psn:P2046/wikibase:quantityAmount ?area }.
      OPTIONAL {
        ?national_park_of_Australia wdt:P373 ?commons_category.
        BIND(CONCAT("https://commons.wikimedia.org/wiki/Category:", ?commons_category) AS ?commons_category_link).
      }.
    }
    ORDER BY DESC(?area) ASC(?establishedYear) ASC(?national_park_of_AustraliaLabel)
    

Trails[edit]

List of trails within protected areas of Australia[edit]

The following query uses these:

  • Properties: instance of (P31)  View with Reasonator View with SQID, subclass of (P279)  View with Reasonator View with SQID, located in protected area (P3018)  View with Reasonator View with SQID, located in the administrative territorial entity (P131)  View with Reasonator View with SQID, length (P2043)  View with Reasonator View with SQID
    SELECT ?trail ?trailLabel ?length ?located_in_protected_area ?located_in_protected_areaLabel ?administrative_areaLabel WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
      ?trail wdt:P31/wdt:P279* wd:Q628179.
      ?trail wdt:P3018 ?located_in_protected_area.
      ?located_in_protected_area wdt:P31/wdt:P279* wd:Q17000624.
      ?located_in_protected_area wdt:P131 ?administrative_area.
      ?administrative_area wdt:P31/wdt:P279* wd:Q178712.
      OPTIONAL { ?trail p:P2043/psn:P2043/wikibase:quantityAmount ?length }.
    }
    ORDER BY DESC(?length) ASC(?located_in_protected_areaLabel) ASC(?trailLabel)