query-59c122d4c6e9f2f75aafdc12d404bc5f

rq turtle/ttl

TODO

Use at

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/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#coses del barri gòtic però només la part baixa
SELECT DISTINCT ?item ?itemLabel ?lat ?lon ?coord ?layer
WHERE {
  {
  ?item wdt:P17 wd:Q29.
  ?item wdt:P131+ wd:Q17154.
  }
  UNION
  {wd:Q17154 wdt:P206 ?item}
  MINUS { ?item wdt:P31 wd:Q1190554. }
  MINUS { ?item wdt:P31 wd:Q1076486. }
  MINUS { ?item wdt:P31 wd:Q41253. }
  MINUS { ?item wdt:P31 wd:Q11315. }
  MINUS { ?item wdt:P31 wd:Q43325366.}
  MINUS { ?item wdt:P31/wdt:P279* wd:Q7075. }
  MINUS { ?item wdt:P31/wdt:P279* wd:Q5341295.
         MINUS {?item wdt:P31/wdt:P279* wd:Q811979}
        }
  MINUS { ?item wdt:P31/wdt:P279* wd:Q732577. }
  MINUS { ?item wdt:P31 wd:Q1329623. }
  MINUS { ?item wdt:P31 wd:Q200538. }
  MINUS { ?item wdt:P31 wd:Q26703203. }
  MINUS { ?item wdt:P31 wd:Q150139}
  MINUS { ?item wdt:P31 wd:Q61696039}
  MINUS { ?item wdt:P31 wd:Q113636120}
  MINUS { ?item wdt:P31 wd:Q200764}
  MINUS { ?item wdt:P31 wd:Q213441.
           MINUS {?item wdt:P1435 [].}
        }
  MINUS { ?item wdt:P31 wd:Q2755259}
  MINUS { ?item wdt:P31 wd:Q5159627}
  MINUS { ?item wdt:P31 wd:Q992253}
  MINUS { ?item wdt:P31 wd:Q654772. }
  MINUS { ?item wdt:P31 wd:Q187456.
           MINUS {?item wdt:P1435 [].}
        }
  MINUS { ?item wdt:P31 wd:Q27686.
           MINUS {?item wdt:P1435 [].}
        }
  MINUS { ?item wdt:P31 wd:Q281460. }
  MINUS { ?item wdt:P31 wd:Q11707.
           MINUS {?item wdt:P1435 [].}
        }
  MINUS { ?item wdt:P31 wd:Q163740. }
  MINUS { ?item wdt:P31 wd:Q650241. }
  MINUS { ?item wdt:P31 wd:Q842402. }
  MINUS { ?item wdt:P31 wd:Q2085381. }
  MINUS { ?item wdt:P31 wd:Q157031. }
  MINUS { ?item wdt:P31 wd:Q43229. }
  MINUS { ?item wdt:P31 wd:Q7372078. }
  ?item wdt:P31 ?layer.
  ?item wdt:P625 ?coord.
  ?item p:P625 ?coordinate .
?coordinate psv:P625 ?coordinate_node .
?coordinate_node wikibase:geoLatitude ?lat .
?coordinate_node wikibase:geoLongitude ?lon .
  BIND((?lat-41.38395)*(2.17426-2.17873)-(?lon-2.17873)*(41.38039-41.38395) as ?m)
  FILTER(?m > 0)
  SERVICE wikibase:label {bd:serviceParam wikibase:language 'ca' . } }
#defaultView:Map

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coord"):::projected v5("?coordinate") v6("?coordinate_node") v2("?item"):::projected v7("?lat"):::projected v3("?layer"):::projected v8("?lon"):::projected v9("?m") a5((" ")) a6((" ")) a7((" ")) a8((" ")) a1((" ")) a2((" ")) a3((" ")) a4((" ")) c9(["wd:Q1076486"]):::iri c25(["wd:Q213441"]):::iri c10(["wd:Q41253"]):::iri c8(["wd:Q1190554"]):::iri c15(["wd:Q5341295"]):::iri c3(["wd:Q29"]):::iri c12(["wd:Q43325366"]):::iri c33(["wd:Q281460"]):::iri c16(["wd:Q811979"]):::iri c5(["wd:Q17154"]):::iri c31(["wd:Q187456"]):::iri c40(["wd:Q43229"]):::iri c35(["wd:Q163740"]):::iri c24(["wd:Q200764"]):::iri c28(["wd:Q5159627"]):::iri c39(["wd:Q157031"]):::iri c41(["wd:Q7372078"]):::iri c37(["wd:Q842402"]):::iri c23(["wd:Q113636120"]):::iri c32(["wd:Q27686"]):::iri c36(["wd:Q650241"]):::iri c48(["bd:serviceParam"]):::iri c50(["ca"]):::literal c34(["wd:Q11707"]):::iri c38(["wd:Q2085381"]):::iri c21(["wd:Q150139"]):::iri c18(["wd:Q1329623"]):::iri c20(["wd:Q26703203"]):::iri c19(["wd:Q200538"]):::iri c27(["wd:Q2755259"]):::iri c14(["wd:Q7075"]):::iri c30(["wd:Q654772"]):::iri c29(["wd:Q992253"]):::iri c17(["wd:Q732577"]):::iri c22(["wd:Q61696039"]):::iri c11(["wd:Q11315"]):::iri f0[["?m > '0^^xsd:integer'"]] f0 --> v9 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; c5 --"p:direct/P206"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P17"--> c3 v2 --"p:direct/P131"--> c5 end union0r <== or ==> union0l end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c8 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c9 end subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c10 end subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c11 end subgraph minus5["MINUS"] style minus5 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c12 end subgraph minus6["MINUS"] style minus6 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c14 end subgraph minus7["MINUS"] style minus7 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> a2 a2 --"p:direct/P279"--> c15 subgraph minus8["MINUS"] style minus8 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> a3 a3 --"p:direct/P279"--> c16 end end subgraph minus9["MINUS"] style minus9 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> a4 a4 --"p:direct/P279"--> c17 end subgraph minus10["MINUS"] style minus10 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c18 end subgraph minus11["MINUS"] style minus11 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c19 end subgraph minus12["MINUS"] style minus12 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c20 end subgraph minus13["MINUS"] style minus13 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c21 end subgraph minus14["MINUS"] style minus14 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c22 end subgraph minus15["MINUS"] style minus15 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c23 end subgraph minus16["MINUS"] style minus16 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c24 end subgraph minus17["MINUS"] style minus17 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c25 subgraph minus18["MINUS"] style minus18 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P1435"--> a5 end end subgraph minus19["MINUS"] style minus19 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c27 end subgraph minus20["MINUS"] style minus20 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c28 end subgraph minus21["MINUS"] style minus21 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c29 end subgraph minus22["MINUS"] style minus22 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c30 end subgraph minus23["MINUS"] style minus23 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c31 subgraph minus24["MINUS"] style minus24 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P1435"--> a6 end end subgraph minus25["MINUS"] style minus25 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c32 subgraph minus26["MINUS"] style minus26 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P1435"--> a7 end end subgraph minus27["MINUS"] style minus27 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c33 end subgraph minus28["MINUS"] style minus28 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c34 subgraph minus29["MINUS"] style minus29 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P1435"--> a8 end end subgraph minus30["MINUS"] style minus30 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c35 end subgraph minus31["MINUS"] style minus31 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c36 end subgraph minus32["MINUS"] style minus32 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c37 end subgraph minus33["MINUS"] style minus33 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c38 end subgraph minus34["MINUS"] style minus34 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c39 end subgraph minus35["MINUS"] style minus35 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c40 end subgraph minus36["MINUS"] style minus36 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> c41 end v2 --"p:direct/P31"--> v3 v2 --"p:direct/P625"--> v4 v2 --"p:P625"--> v5 v5 --"p:statement/value/P625"--> v6 v6 --"wikibase:geoLatitude"--> v7 v6 --"wikibase:geoLongitude"--> v8 bind37[/"?lat + '-41.38395^^xsd:decimal' * '2.17426^^xsd:decimal' + '-2.17873^^xsd:decimal' - ?lon + '-2.17873^^xsd:decimal' * '41.38039^^xsd:decimal' + '-41.38395^^xsd:decimal'"/] v7 --o bind37 v8 --o bind37 bind37 --as--o v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c48 --"wikibase:language"--> c50 end