query-36fbe9f7c8da45364716e009becae908

rq turtle/ttl

Calendar of birthdays of suffragists

Use at

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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
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 ?monthLabel (?day_int as ?d) ?personLabel ?personDesc
   (URI(CONCAT("https://tools.wmflabs.org/reasonator/?q=", SUBSTR(STR(?rperson),32) )) as ?link) WHERE {
{ SELECT ?month_int ?month ?day_int (SAMPLE(?person) AS ?rperson) WHERE {
?month wdt:P31 wd:Q47018901; wdt:P1545 ?month_ordinal. # These lines generate a calendar from January 1 to December 31
?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)
OPTIONAL {
# Define the people we're interested in
{?person wdt:P106 wd:Q27532437 } UNION {?person wdt:P106 wd:Q322170 } # suffragette or suffragist
?person p:P569/psv:P569 ?date_node. # birth date
?date_node wikibase:timePrecision "11"^^xsd:integer ; # birth date has specific day
   wikibase:timeValue ?birthdate .        
filter(DAY(?birthdate)=?day_int) filter (MONTH(?birthdate)=?month_int )
}
} GROUP BY ?month_int ?month ?day_int }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?rperson rdfs:label ?personLabel. ?rperson schema:description ?personDesc. ?month rdfs:label ?monthLabel }
} ORDER BY ?month_int ?day_int

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?birthdate") v14("?d") v9("?date_node") v7("?day") v8("?day_int"):::projected v6("?day_ordinal") v15("?link") v4("?month") v13("?monthLabel"):::projected v8("?month_int") v5("?month_ordinal") v8("?person") v12("?personDesc"):::projected v11("?personLabel"):::projected v10("?rperson"):::projected a1((" ")) a2((" ")) c13(["11^^xsd:integer"]):::literal c8(["wd:Q27532437"]):::iri c9(["wd:Q322170"]):::iri c16(["bd:serviceParam"]):::iri c2(["wd:Q47018901"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal v4 --"p:direct/P31"--> c2 v4 --"p:direct/P1545"--> v5 a1 --"p:statement/P361"--> v4 a1 --"p:qualifier/P1545"--> v6 v7 --"p:P361"--> a1 bind0[/"http://www.w3.org/2001/XMLSchema#integer(?month_ordinal)"/] v5 --o bind0 bind0 --as--o v8 bind1[/"http://www.w3.org/2001/XMLSchema#integer(?day_ordinal)"/] v6 --o bind1 bind1 --as--o v8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v8 -."p:direct/P106".-> c9 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v8 --"p:direct/P106"--> c8 end union0r <== or ==> union0l end v8 --"p:P569"--> a2 a2 --"p:statement/value/P569"--> v9 v9 --"wikibase:timePrecision"--> c13 v9 --"wikibase:timeValue"--> v3 end bind3[/"sample(?person)"/] v8 --o bind3 bind3 --as--o v10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 v10 --"rdfs:label"--> v11 v10 --"schema:description"--> v12 v4 --"rdfs:label"--> v13 end bind4[/"?day_int"/] v8 --o bind4 bind4 --as--o v14 bind5[/"concat('https://tools.wmflabs.org/reasonator/?q=',substring(str(?rperson),'32^^xsd:integer'))"/] v10 --o bind5 bind5 --as--o v15