query-8e0864a298c86477aa970f4e53ef6782
Query fixing (string replacement)Hello, why is the bind returning no values?
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 bd: <http://www.bigdata.com/rdf#>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?airport ?airportLabel ?airportLabel2 (SAMPLE(?coord) AS ?coord) ?ICAO ?IATA (SAMPLE(?Local_Code) AS ?Local_Code) ?dissout WHERE {
?airport (wdt:P31/wdt:P279*) wd:Q62447.
?airport wdt:P17 wd:Q145.
MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q1311670. } # exclude railways stations
MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q502074. } # exclude héliports
MINUS { ?airport wdt:P31/wdt:P279* wd:Q2265915.} # exclude vol à voile/gliders
MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q44665966. } # exclude airports being build
MINUS { ?airport (wdt:P31/wdt:P279*) wd:Q782667. } # exclude motorways where plane can land
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,[AUTO_LANGUAGE]". }
OPTIONAL { ?airport wdt:P625 ?coord. }
OPTIONAL { ?airport wdt:P239 ?ICAO. }
OPTIONAL { ?airport wdt:P238 ?IATA. }
OPTIONAL { ?airport wdt:P576 ?dissout. }
BIND(REPLACE(?airportLabel, "RAF ", "", "i") AS ?airportLabel2)
}
GROUP BY ?airport ?airportLabel ?airportLabel2 ?ICAO ?IATA ?dissout
ORDER BY ?coord
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?IATA"):::projected
v3("?ICAO"):::projected
v8("?Local_Code"):::projected
v2("?airport"):::projected
v6("?airportLabel2"):::projected
v8("?coord"):::projected
v5("?dissout"):::projected
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
c8(["wd:Q2265915"]):::iri
c10(["wd:Q782667"]):::iri
c14(["en,#91;AUTO_LANGUAGE#93;"]):::literal
c3(["wd:Q62447"]):::iri
c12(["bd:serviceParam"]):::iri
c6(["wd:Q1311670"]):::iri
c9(["wd:Q44665966"]):::iri
c5(["wd:Q145"]):::iri
c7(["wd:Q502074"]):::iri
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P17"--> c5
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c6
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c7
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a4
a4 --"wdt:P279"--> c8
end
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a5
a5 --"wdt:P279"--> c9
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P31"--> a6
a6 --"wdt:P279"--> c10
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P625".-> v8
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P239".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P238".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P576".-> v5
end
bind5[/"replace(?airportLabel,'RAF ','','i')"/]
null --o bind5
bind5 --as--o v6
bind8[/"sample(?coord)"/]
v8 --o bind8
bind8 --as--o v8
bind9[/"sample(?Local_Code)"/]
v8 --o bind9
bind9 --as--o v8