query-a75ed10a1169a13d63cfdd8db40d928e
Events
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 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#>
PREFIX target: <http://www.wikidata.org/entity/Q56459943>
SELECT
(xsd:date(MIN(?start)) AS ?date)
?event ?eventLabel
(CONCAT("#scientificevent/", SUBSTR(STR(?event), 32)) AS ?eventUrl)
(GROUP_CONCAT(DISTINCT ?role; separator=", ") AS ?roles)
(GROUP_CONCAT(DISTINCT ?location_label; separator=", ") AS ?locations)
WHERE {
BIND(target: AS ?person)
{
# speaker
?speaker_statement ps:P823 ?person .
?event p:P823 ?speaker_statement .
OPTIONAL {
?speaker_statement pq:P3831 / rdfs:label ?speaker_role .
FILTER (LANG(?speaker_role) = "en")
}
BIND(COALESCE(?speaker_role, "speaker") AS ?role)
}
UNION
{
# organizer
?organizer_statement ps:P664 ?person .
?event p:P664 ?organizer_statement .
OPTIONAL {
?organizer_statement pq:P3831 / rdfs:label ?organizer_role .
FILTER (LANG(?organizer_role) = "en")
}
BIND(COALESCE(?organizer_role, "organizer") AS ?role)
}
UNION
{
# participant
?person wdt:P1344| wdt:P585 ?start }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,da,de,es,fr,jp,no,ru,sv,zh". }
}
GROUP BY ?event ?eventLabel
ORDER BY DESC(?date)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?date")
v5("?event"):::projected
v11("?eventUrl")
v10("?location_label"):::projected
v13("?locations")
v7("?organizer_role")
v8("?organizer_statement")
v2("?person")
v9("?role"):::projected
v12("?roles")
v3("?speaker_role")
v4("?speaker_statement")
v9("?start")
a1((" "))
a2((" "))
c13(["#91;AUTO_LANGUAGE#93;,en,da,de,es,fr,jp,no,ru,sv,zh"]):::literal
c11(["bd:serviceParam"]):::iri
bind0[/"http://www.wikidata.org/entity/Q56459943"/]
bind0 --as--o v2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P585"--> v9
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:direct/P1344"--> v9
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v8 --"p:statement/P664"--> v2
v5 --"p:P664"--> v8
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:qualifier/P3831".-> a2
a2 --"rdfs:label"--> v7
end
bind1[/"?organizer_role'organizer'"/]
v7 --o bind1
bind1 --as--o v9
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:statement/P823"--> v2
v5 --"p:P823"--> v4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:qualifier/P3831".-> a1
a1 --"rdfs:label"--> v3
end
bind2[/"?speaker_role'speaker'"/]
v3 --o bind2
bind2 --as--o v9
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind6[/"http://www.w3.org/2001/XMLSchema#date()"/]
null --o bind6
bind6 --as--o v11
bind7[/"concat('#scientificevent/',substring(str(?event),'32^^xsd:integer'))"/]
v5 --o bind7
bind7 --as--o v11
bind8[/"?role"/]
v9 --o bind8
bind8 --as--o v12
bind9[/"?location_label"/]
v10 --o bind9
bind9 --as--o v13