query: SELECT DISTINCT ?item ?itemLabel ?enarticle ?enLabel (IF(bound(?enarticle),CONCAT("{","{subst:Urltowiki\u007Curl=", str(?enarticle), "\u007Cdisplay=", str(?enLabel), "}","}"),str(?enLabel)) As ?wpenarticle) ?frarticle ?frLabel (IF(bound(?frarticle),CONCAT("{","{subst:Urltowiki\u007Curl=", str(?frarticle), "\u007Cdisplay=", str(?frLabel), "}","}"),str(?frLabel)) As ?wpfrarticle) ?dearticle ?deLabel (IF(bound(?dearticle),CONCAT("{","{subst:Urltowiki\u007Curl=", str(?dearticle), "\u007Cdisplay=", str(?deLabel), "}","}"),str(?deLabel)) As ?wpdearticle) ?p1824 WHERE { { ?item wdt:P31 wd:Q1426271 } UNION { ?item wdt:P16 wd:Q1426271 } . MINUS { VALUES ?outre_mer { wd:Q17012 wd:Q17054 wd:Q3769 wd:Q17070 wd:Q34617 wd:Q17063 wd:Q25362 wd:Q126125 } . ?item wdt:P131 ?outre_mer } . OPTIONAL { ?enarticle schema:about ?item ; schema:inLanguage "en" ; schema:isPartOf <https://en.wikipedia.org/> } . OPTIONAL { ?item rdfs:label ?enLabel . FILTER (langMatches(lang(?enLabel), "en")) } . OPTIONAL { ?frarticle schema:about ?item ; schema:inLanguage "fr" ; schema:isPartOf <https://fr.wikipedia.org/> } . OPTIONAL { ?item rdfs:label ?frLabel . FILTER (langMatches(lang(?frLabel), "fr")) } . OPTIONAL { ?dearticle schema:about ?item  ; schema:inLanguage "de" ; schema:isPartOf <https://de.wikipedia.org/> } . OPTIONAL { ?item rdfs:label ?deLabel . FILTER (langMatches(lang(?deLabel), "de")) } . OPTIONAL { ?item wdt:P1824 ?p1824 } BIND(STRLEN(str(?p1824)) as ?longp1824) BIND(SUBSTR(str(?p1824),1,1) as ?statut) BIND(SUBSTR(str(?p1824),2,(?longp1824 - 1)) as ?numero) BIND(REPLACE(SUBSTR(str(?numero),1,4),"[A-Za-z ]","") as ?num) BIND(STRLEN(str(?num)) as ?longnum) BIND(CONCAT(IF(?longnum=1,"000",IF(?longnum=2,"00",IF(?longnum=3,"0",""))), str(?num)) as ?numz) BIND(CONCAT(str(?statut),str(?num)) as ?numsp) BIND(STRLEN(str(?numsp)) as ?longnumsp) BIND((?longp1824 - ?longnumsp) as ?longprefixe) BIND(SUBSTR(str(?p1824),(?longnumsp + 1),?longprefixe) as ?prefixe) BIND(CONCAT(str(?statut),str(?numz),str(?prefixe)) as ?cledetri) SERVICE wikibase:label { bd:serviceParam wikibase:language "fr, de, en" . } } ORDER BY ?cledetri