query-eed2807a5bd1c665a330724f336f2b47
Coming deadlines
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 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
?date
?deadline ?deadlineLabel
?short_name
?event ?eventLabel (CONCAT("#scientificevent/", SUBSTR(STR(?event), 32)) AS ?eventUrl)
?location ?locationLabel (CONCAT("#location/", SUBSTR(STR(?location), 32)) AS ?locationUrl)
WHERE {
{
SELECT
?datetime ?deadline ?event
(SAMPLE(?location_) AS ?location)
(SAMPLE(?short_name_) AS ?short_name)
WHERE {
?event p:P793 ?key_event_statement .
?key_event_statement ps:P793 ?deadline ;
pq:P585 ?datetime .
?deadline wdt:P279* wd:Q2404808 .
# Subtract a day from now to get events on the now date
FILTER (NOW() - "P1DT0H0M0.000S"^^xsd:duration < ?datetime)
OPTIONAL { ?event wdt:P276 ?location_ }
OPTIONAL { ?event wdt:P1813 ?short_name_ }
}
GROUP BY ?datetime ?deadline ?event
ORDER BY(?datetime)
LIMIT 200
}
BIND(xsd:date(?datetime) AS ?date)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY(?date)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?date"):::projected
v2("?datetime")
v5("?deadline"):::projected
v3("?event"):::projected
v10("?eventUrl")
v4("?key_event_statement")
v8("?location"):::projected
v11("?locationUrl")
v6("?location_")
v9("?short_name"):::projected
v7("?short_name_")
c10(["bd:serviceParam"]):::iri
c6(["wd:Q2404808"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["NOW() - 'P1DT0H0M0.000S^^xsd:duration' < ?datetime"]]
f0 --> v2
v3 --"p:P793"--> v4
v4 --"p:statement/P793"--> v5
v4 --"p:qualifier/P585"--> v2
v5 --"p:direct/P279"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P276".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P1813".-> v7
end
bind3[/"sample(?location_)"/]
v6 --o bind3
bind3 --as--o v8
bind4[/"sample(?short_name_)"/]
v7 --o bind4
bind4 --as--o v9
bind5[/"http://www.w3.org/2001/XMLSchema#date(?datetime)"/]
v2 --o bind5
bind5 --as--o v10
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
bind6[/"concat('#scientificevent/',substring(str(?event),'32^^xsd:integer'))"/]
v3 --o bind6
bind6 --as--o v10
bind7[/"concat('#location/',substring(str(?location),'32^^xsd:integer'))"/]
v8 --o bind7
bind7 --as--o v11