query-e726293fb9fd2ea4a01c47d8e06860fb
Count of saint's feast days per date
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
#defaultView:BarChart
SELECT (CONCAT(STR(?monthLabel), " ", STR(?day_int)) AS ?calendar) (COUNT(?saint) AS ?count) ?month_int ?day_int WHERE {
{ SELECT ?month_int ?month ?day_int ?saint WHERE {
?month wdt:P31 wd:Q47018901; wdt:P1545 ?month_ordinal.
?day p:P361 [ps:P361 ?month; pq:P1545 ?day_ordinal ].
BIND(xsd:integer(?month_ordinal) AS ?month_int)
BIND(xsd:integer(?day_ordinal) AS ?day_int)
?saint wdt:P841 ?day # saint's feast day
} }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?month rdfs:label ?monthLabel }
} GROUP BY ?month_int ?monthLabel ?day_int
ORDER BY ?month_int ?day_int
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?calendar")
v10("?count")
v6("?day")
v7("?day_int"):::projected
v5("?day_ordinal")
v3("?month")
v8("?monthLabel"):::projected
v7("?month_int"):::projected
v4("?month_ordinal")
v7("?saint"):::projected
a1((" "))
c9(["bd:serviceParam"]):::iri
c2(["wd:Q47018901"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v3 --"p:direct/P31"--> c2
v3 --"p:direct/P1545"--> v4
a1 --"p:statement/P361"--> v3
a1 --"p:qualifier/P1545"--> v5
v6 --"p:P361"--> a1
bind0[/"http://www.w3.org/2001/XMLSchema#integer(?month_ordinal)"/]
v4 --o bind0
bind0 --as--o v7
bind1[/"http://www.w3.org/2001/XMLSchema#integer(?day_ordinal)"/]
v5 --o bind1
bind1 --as--o v7
v7 --"p:direct/P841"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
v3 --"rdfs:label"--> v8
end
bind3[/"concat(str(?monthLabel),' ',str(?day_int))"/]
v8 --o bind3
v7 --o bind3
bind3 --as--o v9
bind4[/"count(?saint)"/]
v7 --o bind4
bind4 --as--o v10