query-900e1a9d09f1eaa1e1c40372482a0e6d

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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?id 
WHERE 
{
#  ?item wdt:P19 wd:Q5003252.  # provides just 2 hits, one above and one below the filter's target value
  ?item wdt:P106 wd:Q82955.    # restrict to occupation=politician (timeout precaution) 
  ?item wdt:P31 wd:Q5.         # humans ... mostly redundant given the P106 
  bind(substr(str(?item),33) as ?id) # get the numeric element of the QID, but as a string - boo
  filter(?id>"50984600")             # this comparison is probably lexical - also boo
  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; v3("?id"):::projected v2("?item"):::projected c7(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q82955"]):::iri f0[["?id > '50984600'"]] f0 --> v3 v2 --"wdt:P106"--> c3 v2 --"wdt:P31"--> c5 bind1[/"substring(str(?item),'33^^xsd:integer')"/] v2 --o bind1 bind1 --as--o v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end