query-ed12f7669c9cbadcd78ea70479d64e46

rq turtle/ttl

2017-07-13: tidying Head of Government itemsAn item for a national Head of Government position should have at least three properties set on it: : (P1001)applies to jurisdiction (or a subclass of it)(Q4164871)position : (P31)instance of (or a country specific subclass of it)(Q2285706)head of government : (P279)subclass of for it, so needed disentangled). (Q13406463)Wikimedia list article we rely on the first and third, but none of them actually use or check the second, and quite a few were missing it (or, worse, were still a hybrid of the position itself and the Wikidata:WikiProject Heads of state and governmentFor most of the reports in A useful query for uncovering the problems was: An item for a national Head of Government position should have at least three properties set on it: : (P1001)applies to jurisdiction (or a subclass of it)(Q4164871)position : (P31)instance of (or a country specific subclass of it)(Q2285706)head of government : (P279)subclass of for it, so needed disentangled). (Q13406463)Wikimedia list article we rely on the first and third, but none of them actually use or check the second, and quite a few were missing it (or, worse, were still a hybrid of the position itself and the Wikidata:WikiProject Heads of state and governmentFor most of the reports in A useful query for uncovering the problems was:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?office ?officeLabel ?class ?classLabel
WHERE {      
  ?item wdt:P31 wd:Q6256 . 
  ?office wdt:P279* wd:Q2285706 ;  
          wdt:P1001 ?item
  FILTER NOT EXISTS { ?office wdt:P576 ?abolished } .
  OPTIONAL { ?office wdt:P31 ?class }
  FILTER NOT EXISTS { ?office wdt:P31/wdt:P279* wd:Q4164871 } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
ORDER BY ?itemLabel ?officeLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?abolished") v6("?class"):::projected v5("?item"):::projected v1("?itemLabel"):::projected v3("?office"):::projected v2("?officeLabel"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c3(["wd:Q4164871"]):::iri c6(["wd:Q2285706"]):::iri c11(["en"]):::literal c5(["wd:Q6256"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0a1 e0a1 --"wdt:P279"--> e0c3 e0v1("?office"):::projected e0a1((" ")):::projected e0c3(["wd:Q4164871"]):::iri end f0--EXISTS--> f0e0 f0 --> v3 f0 --> c1 f0 --> a1 f0 --> c2 f0 --> c3 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P576"--> e1v2 e1v2("?abolished"):::projected e1v1("?office"):::projected end f1--EXISTS--> f1e1 f1 --> v3 f1 --> c4 f1 --> v4 v3 --"wdt:P576"--> v4 v5 --"wdt:P31"--> c5 v3 --"wdt:P279"--> c6 v3 --"wdt:P1001"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P31".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end