query-539333cbf679762a9406e825fa3ed731
BUG没有全部的站点???
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
#defaultView:Map{"hide":["?coord1", "?coord1lat", "?coord1lon", "?coord2", "?coord2lat", "?coord2lon", "?str", "?line"]}
SELECT * WHERE {
?comm1 wdt:P31/wdt:P279* wd:Q928830 ;
# wdt:P17 wd:Q213 ;
wdt:P131/wdt:P279* wd:Q4970;
wdt:P625 ?coord1 ;
wdt:P197 ?comm2 .
# MINUS { ?comm1 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
# MINUS { ?comm2 p:P31 [ ps:P31 wd:Q55488 ; pq:P582 [] ] } .
# MINUS { ?comm1 p:P31 [ ps:P31 wd:Q928830 ] } .
# MINUS { ?comm2 p:P31 [ ps:P31 wd:Q928830 ] } .
?comm2 wdt:P625 ?coord2 .
# ?comm1 p:P625 [# ps:P625 [];
# psv:P625 [ wikibase:geoLongitude ?coord1lon; wikibase:geoLatitude ?coord1lat; ] ] .
# ?comm2 p:P625 [# ps:P625 [];
# psv:P625 [ wikibase:geoLongitude ?coord2lon; wikibase:geoLatitude ?coord2lat; ] ] .
BIND(CONCAT('LINESTRING (', STR(?coord1lon), ' ', STR(?coord1lat), ',', STR(?coord2lon), ' ', STR(?coord2lat), ')') AS ?str) .
BIND(STRDT(?str, geo:wktLiteral) AS ?line) .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?comm1"):::projected
v3("?comm2"):::projected
v2("?coord1"):::projected
v4("?coord2"):::projected
v6("?line"):::projected
v5("?str"):::projected
a1((" "))
a2((" "))
c3(["wd:Q928830"]):::iri
c5(["wd:Q4970"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v1 --"p:direct/P131"--> a2
a2 --"p:direct/P279"--> c5
v1 --"p:direct/P625"--> v2
v1 --"p:direct/P197"--> v3
v3 --"p:direct/P625"--> v4
bind0[/"concat('LINESTRING (',str(?coord1lon),' ',str(?coord1lat),',',str(?coord2lon),' ',str(?coord2lat),')')"/]
null --o bind0
null --o bind0
null --o bind0
null --o bind0
bind0 --as--o v5
bind1[/"STRDT(?str,'geo:wktLiteral')"/]
v5 --o bind1
bind1 --as--o v6