query-87416ff44e606d0fb51d2f0a4b73ac43
AutoroutesNombre : 190 (au 18/01/2023)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel WHERE {
{ ?item wdt:P31/wdt:P279* wd:Q34442 ; p:P16/ps:P16 wd:Q3456602 } .
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" . }
} ORDER BY ?cledetri
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v14("?cledetri")
v2("?item"):::projected
v8("?longnum")
v11("?longnumsp")
v4("?longp1824")
v12("?longprefixe")
v7("?num")
v6("?numero")
v10("?numsp")
v9("?numz")
v3("?p1824")
v13("?prefixe")
v5("?statut")
a1((" "))
a2((" "))
c3(["wd:Q34442"]):::iri
c9(["bd:serviceParam"]):::iri
c6(["wd:Q3456602"]):::iri
c11(["fr"]):::literal
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v2 --"p:P16"--> a2
a2 --"p:statement/P16"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P1824".-> v3
end
bind0[/"string-length(str(?p1824))"/]
v3 --o bind0
bind0 --as--o v4
bind1[/"substring(str(?p1824),'1^^xsd:integer','1^^xsd:integer')"/]
v3 --o bind1
bind1 --as--o v5
bind2[/"substring(str(?p1824),'2^^xsd:integer',?longp1824 - '1^^xsd:integer')"/]
v3 --o bind2
v4 --o bind2
bind2 --as--o v6
bind3[/"replace(substring(str(?numero),'1^^xsd:integer','4^^xsd:integer'),'#91;A-Za-z #93;','')"/]
v6 --o bind3
bind3 --as--o v7
bind4[/"string-length(str(?num))"/]
v7 --o bind4
bind4 --as--o v8
bind5[/"concat(if(?longnum = '1^^xsd:integer','000',if(?longnum = '2^^xsd:integer','00',if(?longnum = '3^^xsd:integer','0',''))),str(?num))"/]
v8 --o bind5
v7 --o bind5
bind5 --as--o v9
bind6[/"concat(str(?statut),str(?num))"/]
v5 --o bind6
v7 --o bind6
bind6 --as--o v10
bind7[/"string-length(str(?numsp))"/]
v10 --o bind7
bind7 --as--o v11
bind8[/"?longp1824 - ?longnumsp"/]
v4 --o bind8
v11 --o bind8
bind8 --as--o v12
bind9[/"substring(str(?p1824),?longnumsp + '1^^xsd:integer',?longprefixe)"/]
v3 --o bind9
v11 --o bind9
v12 --o bind9
bind9 --as--o v13
bind10[/"concat(str(?statut),str(?numz),str(?prefixe))"/]
v5 --o bind10
v9 --o bind10
v13 --o bind10
bind10 --as--o v14
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end