query-05f1077c33312abcf727de888cd171bd

rq turtle/ttl

title:Calendar of Awareness days SELECT DISTINCT ?month_int ?monthLabel (?day_int as ?d) ?world_dayLabel (?world_day as ?link) (GROUP_CONCAT(DISTINCT ?countryLabel; separator=", ") as ?countries) 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)

VALUES ?type {wd:Q2558684 wd:Q422695} # World ___ day; Awareness day ?world_day wdt:P31 ?type; wdt:P837 ?day OPTIONAL {?world_day wdt:P17 ?country}

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?month rdfs:label ?monthLabel. ?world_day rdfs:label ?world_dayLabel. ?country rdfs:label ?countryLabel } } GROUP BY ?month_int ?monthLabel ?day_int ?world_dayLabel ?world_day ORDER BY ?month_int ?d

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 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#>
#title:Calendar of Awareness days 
SELECT DISTINCT ?month_int ?monthLabel (?day_int as ?d) ?world_dayLabel (?world_day as ?link) (GROUP_CONCAT(DISTINCT ?countryLabel; separator=", ") as ?countries) 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)

VALUES ?type {wd:Q2558684 wd:Q422695} # World ___ day; Awareness day 
?world_day wdt:P31 ?type; wdt:P837 ?day
OPTIONAL {?world_day wdt:P17 ?country}

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
      ?month rdfs:label ?monthLabel. ?world_day rdfs:label ?world_dayLabel. ?country rdfs:label ?countryLabel }
} GROUP BY ?month_int ?monthLabel ?day_int ?world_dayLabel ?world_day
ORDER BY ?month_int ?d

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v15("?countries") v10("?country") v13("?countryLabel"):::projected v14("?d") v6("?day") v7("?day_int"):::projected v5("?day_ordinal") v14("?link") v3("?month") v11("?monthLabel"):::projected v7("?month_int"):::projected v4("?month_ordinal") v8("?type") v9("?world_day"):::projected v12("?world_dayLabel"):::projected a1((" ")) c10(["bd:serviceParam"]):::iri c2(["wd:Q47018901"]):::iri c12(["#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 bind2[/VALUES ?type/] bind2-->v8 bind20(["wd:Q2558684"]) bind20 --> bind2 bind21(["wd:Q422695"]) bind21 --> bind2 v9 --"p:direct/P31"--> v8 v9 --"p:direct/P837"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v9 -."p:direct/P17".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v3 --"rdfs:label"--> v11 v9 --"rdfs:label"--> v12 v10 --"rdfs:label"--> v13 end bind4[/"?day_int"/] v7 --o bind4 bind4 --as--o v14 bind5[/"?world_day"/] v9 --o bind5 bind5 --as--o v14 bind6[/"?countryLabel"/] v13 --o bind6 bind6 --as--o v15