query-cf5df65678be7369f281d0777818940a
TODO
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 geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# topònims al voltant d'un punt marcant si hi ha estat
SELECT ?item ?itemLabel ?location ?dist ?layer
WHERE
{
wd:Q2922137 wdt:P625 ?loc . #lloc central
SERVICE wikibase:around {
?item wdt:P625 ?location .
bd:serviceParam wikibase:center ?loc .
bd:serviceParam wikibase:radius "35" . #radi
}
OPTIONAL {?item wdt:P131 ?adm. }
OPTIONAL {?item wdt:P17 ?layer}
# Aquí comencen els MINUS de la llista
MINUS { ?item wdt:P31/wdt:P279* wd:Q7075.
MINUS {?item wdt:P149 []}
}
MINUS { ?item wdt:P31/wdt:P279* wd:Q5341295.
MINUS {?item wdt:P31/wdt:P279* wd:Q811979}
}
MINUS { ?item wdt:P31 wd:Q1076486.
MINUS {?item wdt:P31 wd:Q182676}
MINUS {?item wdt:P31 wd:Q1193438.}
MINUS {?item wdt:P31 wd:Q483110.}
MINUS {?item wdt:P31/wd:P279* wd:Q44782.}
MINUS {?item wdt:P912 wd:Q721207}
MINUS {?item wdt:P31/wd:P279* wd:Q20719696.}
}
MINUS { ?item wdt:P31 wd:Q27686. }
MINUS { ?item wdt:P31 wd:Q11919491. }
MINUS { ?item wdt:P31/wdt:P279* wd:Q847017. }
MINUS { ?item wdt:P31 wd:Q11919687. }
MINUS { ?item wdt:P31 wd:Q33506. }
MINUS { ?item wdt:P1435 wd:Q61058403.
MINUS {?item wdt:P625 [].}
}
MINUS { ?item wdt:P1435 wd:Q61058419.
MINUS {?item wdt:P625 [].}
}
MINUS { ?item wdt:P31 wd:Q30114662.}
MINUS { ?item wdt:P31 wd:Q20860083.}
MINUS { ?item wdt:P31 wd:Q119739087.}
MINUS { ?item wdt:P31 wd:Q83554028.}
MINUS { ?item wdt:P366 wd:Q569500.}
MINUS { ?item wdt:P366 wd:Q124727760.}
MINUS { ?item wdt:P31 wd:Q3578324.}
MINUS { ?item wdt:P31 wd:Q41253.}
MINUS { ?item wdt:P31 wd:Q179700.
?item wdt:P186 wd:Q287.
MINUS {?item wdt:P625 [].}
}
MINUS { ?item wdt:P31 wd:Q187456.}
MINUS { ?item wdt:P31 wd:Q15275719.}
MINUS { ?item wdt:P31 wd:Q14645593.}
MINUS { ?item wdt:P31 wd:Q43229.}
MINUS { ?item wdt:P31 wd:Q18127.}
MINUS { ?item wdt:P31 wd:Q131734.}
MINUS { ?item wdt:P31 wd:Q1774898.}
MINUS { ?item wdt:P31 wd:Q321839.}
MINUS { ?item wdt:P31 wd:Q4618.}
MINUS { ?item wdt:P31 wd:Q200538.}
MINUS { ?item wdt:P31 wd:Q27968055.}
MINUS { ?item wdt:P31 wd:Q169950.}
MINUS { ?item wdt:P31 wd:Q1078765.}
MINUS { ?item wdt:P31 wd:Q51785152.}
MINUS { ?item wdt:P31 wd:Q483242.}
MINUS { ?item wdt:P31 wd:Q30014735.}
MINUS { ?item wdt:P31/wdt:P279* wd:Q171558.}
# fins aquí els MINUS de la llista
SERVICE wikibase:label { bd:serviceParam wikibase:language "ca, oc, en, fr, ceb" }
BIND(geof:distance(?loc, ?location) as ?dist)
} ORDER BY ?dist
#defaultView:Map
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?adm")
v7("?dist"):::projected
v3("?item"):::projected
v6("?layer"):::projected
v2("?loc")
v4("?location"):::projected
a2((" "))
a8((" "))
a9((" "))
a10((" "))
a1((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
a7((" "))
a11((" "))
c34(["wd:Q20860083"]):::iri
c40(["wd:Q3578324"]):::iri
c29(["wd:Q33506"]):::iri
c55(["wd:Q27968055"]):::iri
c64(["ca, oc, en, fr, ceb"]):::literal
c16(["wd:Q1076486"]):::iri
c52(["wd:Q321839"]):::iri
c41(["wd:Q41253"]):::iri
c1(["wd:Q2922137"]):::iri
c46(["wd:Q15275719"]):::iri
c26(["wd:Q11919491"]):::iri
c39(["wd:Q124727760"]):::iri
c14(["wd:Q5341295"]):::iri
c61(["wd:Q171558"]):::iri
c31(["wd:Q61058403"]):::iri
c60(["wd:Q30014735"]):::iri
c58(["wd:Q51785152"]):::iri
c36(["wd:Q83554028"]):::iri
c50(["wd:Q131734"]):::iri
c15(["wd:Q811979"]):::iri
c53(["wd:Q4618"]):::iri
c18(["wd:Q1193438"]):::iri
c45(["wd:Q187456"]):::iri
c48(["wd:Q43229"]):::iri
c32(["wd:Q61058419"]):::iri
c35(["wd:Q119739087"]):::iri
c57(["wd:Q1078765"]):::iri
c44(["wd:Q287"]):::iri
c49(["wd:Q18127"]):::iri
c27(["wd:Q847017"]):::iri
c38(["wd:Q569500"]):::iri
c25(["wd:Q27686"]):::iri
c21(["wd:Q44782"]):::iri
c51(["wd:Q1774898"]):::iri
c17(["wd:Q182676"]):::iri
c23(["wd:Q721207"]):::iri
c4(["bd:serviceParam"]):::iri
c19(["wd:Q483110"]):::iri
c7(["35"]):::literal
c28(["wd:Q11919687"]):::iri
c56(["wd:Q169950"]):::iri
c33(["wd:Q30114662"]):::iri
c54(["wd:Q200538"]):::iri
c47(["wd:Q14645593"]):::iri
c12(["wd:Q7075"]):::iri
c24(["wd:Q20719696"]):::iri
c59(["wd:Q483242"]):::iri
c42(["wd:Q179700"]):::iri
c1 --"wdt:P625"--> v2
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v3 --"wdt:P625"--> v4
c4 --"wikibase:center"--> v2
c4 --"wikibase:radius"--> c7
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P131".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P17".-> v6
end
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c12
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P149"--> a2
end
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c14
subgraph minus3["MINUS"]
style minus3 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a4
a4 --"wdt:P279"--> c15
end
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c16
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c17
end
subgraph minus6["MINUS"]
style minus6 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c18
end
subgraph minus7["MINUS"]
style minus7 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c19
end
subgraph minus8["MINUS"]
style minus8 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a5
a5 --"wd:P279"--> c21
end
subgraph minus9["MINUS"]
style minus9 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P912"--> c23
end
subgraph minus10["MINUS"]
style minus10 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a6
a6 --"wd:P279"--> c24
end
end
subgraph minus11["MINUS"]
style minus11 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c25
end
subgraph minus12["MINUS"]
style minus12 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c26
end
subgraph minus13["MINUS"]
style minus13 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a7
a7 --"wdt:P279"--> c27
end
subgraph minus14["MINUS"]
style minus14 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c28
end
subgraph minus15["MINUS"]
style minus15 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c29
end
subgraph minus16["MINUS"]
style minus16 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P1435"--> c31
subgraph minus17["MINUS"]
style minus17 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P625"--> a8
end
end
subgraph minus18["MINUS"]
style minus18 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P1435"--> c32
subgraph minus19["MINUS"]
style minus19 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P625"--> a9
end
end
subgraph minus20["MINUS"]
style minus20 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c33
end
subgraph minus21["MINUS"]
style minus21 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c34
end
subgraph minus22["MINUS"]
style minus22 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c35
end
subgraph minus23["MINUS"]
style minus23 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c36
end
subgraph minus24["MINUS"]
style minus24 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P366"--> c38
end
subgraph minus25["MINUS"]
style minus25 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P366"--> c39
end
subgraph minus26["MINUS"]
style minus26 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c40
end
subgraph minus27["MINUS"]
style minus27 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c41
end
subgraph minus28["MINUS"]
style minus28 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c42
v3 --"wdt:P186"--> c44
subgraph minus29["MINUS"]
style minus29 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P625"--> a10
end
end
subgraph minus30["MINUS"]
style minus30 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c45
end
subgraph minus31["MINUS"]
style minus31 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c46
end
subgraph minus32["MINUS"]
style minus32 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c47
end
subgraph minus33["MINUS"]
style minus33 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c48
end
subgraph minus34["MINUS"]
style minus34 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c49
end
subgraph minus35["MINUS"]
style minus35 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c50
end
subgraph minus36["MINUS"]
style minus36 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c51
end
subgraph minus37["MINUS"]
style minus37 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c52
end
subgraph minus38["MINUS"]
style minus38 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c53
end
subgraph minus39["MINUS"]
style minus39 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c54
end
subgraph minus40["MINUS"]
style minus40 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c55
end
subgraph minus41["MINUS"]
style minus41 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c56
end
subgraph minus42["MINUS"]
style minus42 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c57
end
subgraph minus43["MINUS"]
style minus43 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c58
end
subgraph minus44["MINUS"]
style minus44 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c59
end
subgraph minus45["MINUS"]
style minus45 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> c60
end
subgraph minus46["MINUS"]
style minus46 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a11
a11 --"wdt:P279"--> c61
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c64
end
bind47[/"http://www.opengis.net/def/function/geosparql/distance(?loc,?location)"/]
v2 --o bind47
v4 --o bind47
bind47 --as--o v7