query-9ad8d751b1ee4f160f955ed4963d5619

rq turtle/ttl

Propertiesinstance of (P31)shares border with (P47)reference URL (P854)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place1 ?place1Label ?place2 ?place2Label ?refurl WHERE {
?place1 p:P47 ?statement;
  wdt:P31 ?place1type.
?statement ps:P47 ?place2;
FILTER (?place1type IN (wd:Q27971968)).
OPTIONAL {?statement prov:wasDerivedFrom/pr:P854 ?refurl}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?place1"):::projected v1("?place1type") v4("?place2"):::projected v5("?refurl"):::projected v3("?statement") a1((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?place1type = 'wd:Q27971968'"]] f0 --> v1 v2 --"p:P47"--> v3 v2 --"p:direct/P31"--> v1 v3 --"p:statement/P47"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."prov:wasDerivedFrom".-> a1 a1 --"p:reference/P854"--> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end