query-f64bce418ed558fa2940da0ecfd2cd27
Concatenate Longitude and LatitudeI'm trying to concatenate longitude and latitude to recreate an URL but for some unknown reason it doesn't work:
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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?commune (CONCAT("[https://www.geoportail.gouv.fr/carte?c=", ?longitude, ",", ?latitude, "&z=15&l0=GEOGRAPHICALGRIDSYSTEMS.MAPS::GEOPORTAIL:OGC:WMTS(1)&l1=ADMINISTRATIVEUNITS.BOUNDARIES::GEOPORTAIL:OGC:WMTS(1)&permalink=yes GĂ©oportail]") AS ?geoportail) (CONCAT("[https://commons.wikimedia.org/wiki/Category:", ?commons, " ", ?commons, "]") AS ?lien) WHERE {
?item wdt:P17 wd:Q142;
(wdt:P31/(wdt:P279*)) wd:Q16970;
wdt:P131 ?commune.
?commune p:P625 [ psv:P625 [ wikibase:geoLatitude ?latitude; wikibase:geoLongitude ?longitude ] ];
wdt:P373 ?commons.
MINUS { ?item wdt:P625 []. }
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?commons"):::projected
v2("?commune"):::projected
v6("?geoportail")
v1("?item"):::projected
v3("?latitude"):::projected
v7("?lien")
v4("?longitude"):::projected
a4((" "))
a1((" "))
a3((" "))
a2((" "))
c5(["wd:Q16970"]):::iri
c2(["wd:Q142"]):::iri
v1 --"p:direct/P17"--> c2
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c5
v1 --"p:direct/P131"--> v2
a2 --"wikibase:geoLatitude"--> v3
a2 --"wikibase:geoLongitude"--> v4
a3 --"p:statement/value/P625"--> a2
v2 --"p:P625"--> a3
v2 --"p:direct/P373"--> v5
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"p:direct/P625"--> a4
end
bind1[/"concat('#91;https://www.geoportail.gouv.fr/carte?c=',?longitude,',',?latitude,'&z=15&l0=GEOGRAPHICALGRIDSYSTEMS.MAPS::GEOPORTAIL:OGC:WMTS(1)&l1=ADMINISTRATIVEUNITS.BOUNDARIES::GEOPORTAIL:OGC:WMTS(1)&permalink=yes GĂ©oportail#93;')"/]
v4 --o bind1
v3 --o bind1
bind1 --as--o v6
bind2[/"concat('#91;https://commons.wikimedia.org/wiki/Category:',?commons,' ',?commons,'#93;')"/]
v5 --o bind2
bind2 --as--o v7