query-116dc686efba2e6e7a57f54193b13ae3

rq turtle/ttl

Propertiesinstance of (P31)point in time (P585)start time (P580)end time (P582)

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?competition ?competitionLabel ?year ?begin_date ?end_date WHERE {
  ?competition wdt:P31 wd:Q2990963 .
  ?competition p:P585/psv:P585 ?date_node .
   ?date_node wikibase:timePrecision "9"^^xsd:integer .
    ?date_node wikibase:timeValue ?date .
  ?competition p:P580/psv:P580 ?begin_date_node .
   ?begin_date_node wikibase:timePrecision "11"^^xsd:integer .
    ?begin_date_node wikibase:timeValue ?begin_date .
  ?competition p:P582/psv:P582 ?end_date_node .
   ?end_date_node wikibase:timePrecision "11"^^xsd:integer .
    ?end_date_node wikibase:timeValue ?end_date .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  BIND(year(?date) AS ?year)
  BIND(month(?begin_date) AS ?month1)
  BIND(month(?end_date) AS ?month2)
  FILTER(?month1 = ?month2)
} 
ORDER BY ?date ?competitionLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?begin_date"):::projected v7("?begin_date_node") v5("?competition"):::projected v2("?competitionLabel"):::projected v1("?date") v6("?date_node") v10("?end_date"):::projected v9("?end_date_node") v12("?month1") v12("?month2") v11("?year"):::projected a1((" ")) a2((" ")) a3((" ")) c10(["11^^xsd:integer"]):::literal c2(["wd:Q2990963"]):::iri c14(["bd:serviceParam"]):::iri c6(["9^^xsd:integer"]):::literal c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?month1 = ?month2"]] f0 --> v12 f0 --> v12 v5 --"p:direct/P31"--> c2 v5 --"p:P585"--> a1 a1 --"p:statement/value/P585"--> v6 v6 --"wikibase:timePrecision"--> c6 v6 --"wikibase:timeValue"--> v1 v5 --"p:P580"--> a2 a2 --"p:statement/value/P580"--> v7 v7 --"wikibase:timePrecision"--> c10 v7 --"wikibase:timeValue"--> v8 v5 --"p:P582"--> a3 a3 --"p:statement/value/P582"--> v9 v9 --"wikibase:timePrecision"--> c10 v9 --"wikibase:timeValue"--> v10 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end bind1[/"year-from-dateTime(?date)"/] v1 --o bind1 bind1 --as--o v11 bind2[/"month-from-dateTime(?begin_date)"/] v8 --o bind2 bind2 --as--o v12 bind3[/"month-from-dateTime(?end_date)"/] v10 --o bind3 bind3 --as--o v12