query-0f4260a3024e0d236fb0b65b34c6f850

rq turtle/ttl

Honda Sports AwardsI've done queries before, but the process apparently didn't stick. 22:28, 4 April 2020 (UTC)) talk (SphilbrickI'm interested in something mindlessly simple, a list of people who have won the Honda Sports Award (Q5892712). I thought I could modify one of the examples, but I failed. My guess is that there are not many, but I plan to add some, and I'd like to know how many exist now, and then how many after I add some.--You can sort by year too, with a few extra statements: 00:17, 5 April 2020 (UTC)) talk (SphilbrickI think I figured it out.--

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (year(?time) as ?year) WHERE {
  ?item p:P166 ?x.
  ?x ps:P166 wd:Q5892712.
  OPTIONAL {?x pq:P585 ?time}
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en"}
}
ORDER BY ?time ?item

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?time"):::projected v3("?x") v4("?year") c6(["bd:serviceParam"]):::iri c8(["en"]):::literal c3(["wd:Q5892712"]):::iri v2 --"p:P166"--> v3 v3 --"p:statement/P166"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:qualifier/P585".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end bind0[/"year-from-dateTime(?time)"/] v1 --o bind0 bind0 --as--o v4