query: SELECT ?continentLabel
  WHERE
  {
    { # subquery for optimization so the label service doesn’t have to do as much work (228 ms vs 20731 ms)
      SELECT DISTINCT ?continent
      WHERE
      {
        [] wdt:P30 ?continent.
      }
    }
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
  }
  ORDER BY xsd:integer(SUBSTR(STR(?continent),STRLEN("http://www.wikidata.org/entity/Q")+1))