query-14baba44177a196d38c156c35aed1753

rq turtle/ttl

Castles that are different to disambiguation pages

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?different ?differentLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item ?different WHERE {
      ?item p:P31 ?statement0.
      ?statement0 (ps:P31/(wdt:P279*)) wd:Q23413.
      ?item p:P17 ?statement1.
      ?statement1 (ps:P17/(wdt:P279*)) wd:Q145.
      ?item wdt:P1889 ?different.
      ?different p:P31 ?statement2.
      ?statement2 (ps:P31/(wdt:P279*)) wd:Q4167410
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?different"):::projected v1("?item"):::projected v2("?statement0") v3("?statement1") v5("?statement2") a1((" ")) a2((" ")) a3((" ")) c4(["en-gb,en,mul"]):::literal c13(["wd:Q4167410"]):::iri c8(["wd:Q23413"]):::iri c2(["bd:serviceParam"]):::iri c11(["wd:Q145"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"p:P31"--> v2 v2 --"p:statement/P31"--> a1 a1 --"p:direct/P279"--> c8 v1 --"p:P17"--> v3 v3 --"p:statement/P17"--> a2 a2 --"p:direct/P279"--> c11 v1 --"p:direct/P1889"--> v4 v4 --"p:P31"--> v5 v5 --"p:statement/P31"--> a3 a3 --"p:direct/P279"--> c13