query-9d56d4a49ec71fc860d8a0914f28dc59
Number of International Masters awarded per year), e. g. 1995? This query gives me a list of respective items, but I just need the number of those items, not the list: (P580)start time that have been awared in a specific year ((Q752119)International Master : (P2962)title of chess person How to build a query that queries the number of TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 ?start_time
WHERE
{ ?item p:P2962 ?statement. # item has a P2962 statement
?statement ps:P2962 wd:Q752119; pq:P580 ?start_time. # P2962 statement = International Master, and has a P580 qualifier
FILTER (?start_time >= "1995-01-01T00:00:00Z"^^xsd:dateTime) . # P580 qualifier gt or eq this date
FILTER (?start_time < "1996-01-01T00:00:00Z"^^xsd:dateTime) . # P580 qualifier lt that date
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # get labels
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/05
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/06
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?start_time"):::projected
v3("?statement")
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c5(["wd:Q752119"]):::iri
f0[["?start_time < '1996-01-01T00:00:00Z^^xsd:dateTime'"]]
f0 --> v1
f1[["?start_time >= '1995-01-01T00:00:00Z^^xsd:dateTime'"]]
f1 --> v1
v2 --"p:P2962"--> v3
v3 --"p:statement/P2962"--> c5
v3 --"p:qualifier/P580"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end