query-38b62e9d9e415f2602402538d003313e

rq turtle/ttl

historic county or not in Scotland. Could someone who knows more about Scottish administrative regions ensure that (Q7309443)registration county but some council areas which are not the historic county entries are considered to be a (Q67376938)historic county of the United Kingdom which is a (Q1350181)shire of Scotland is a (Q7309443)registration county When requesting a list of historic counties in the UK I got some Scottish entries twice because

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 ?itemDescription WHERE {
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en-GB,en". } 
  { 
    SELECT DISTINCT ?item WHERE { 
      ?item p:P31 ?statement0. 
      ?statement0 (ps:P31/(wdt:P279*)) wd:Q67770276. 
      ?item p:P17 ?statement1. 
      ?statement1 (ps:P17/(wdt:P279*)) wd:Q145. 
    } 
  } 
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected v2("?statement0") v3("?statement1") a1((" ")) a2((" ")) c8(["wd:Q67770276"]):::iri c2(["bd:serviceParam"]):::iri c4(["en-GB,en"]):::literal 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