query: SELECT ?item ?itemLabel ?lal (COUNT(?wiki) as ?sitelinks) (COUNT(?wiki0) as ?hasCA) 
  {
  	VALUES ?R { wd:Q17167 wd:Q2277 }
  	?item wdt:P2348 ?R ; wdt:P31 wd:Q5 .
    	OPTIONAL { ?item rdfs:label ?lal . FILTER(lang(?lal)="la") }
  	OPTIONAL { ?wiki schema:about ?item }
    	OPTIONAL { ?wiki0 schema:about ?item ; schema:isPartOf	<https://ca.wikipedia.org/> }
    	SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
  }
  GROUP BY ?item ?itemLabel ?lal
  ORDER BY DESC(xsd:integer(STRAFTER(str(?item), "Q")))
  