query-7937fba64d7eeb2cc9c035e7bde557c6
#151 (2023-02-14), 2021 #41, 2020 #111
info: project Q107168829 participated in 2020 and 2021
SELECT (?project AS ?Project_Wd_item_link) (?projectLabel AS ?Project_name) (GROUP_CONCAT(DISTINCT YEAR(?awardYear); SEPARATOR = ", ") AS ?participated_in_years) WHERE { ?project (p:P1344|p:P166|p:P1411) ?awardStatement. ?awardStatement (ps:P1344|ps:P166|ps:P1411) ?award; pq:P585 ?awardYear. # FILTER((YEAR(?awardYear)) = 2020 ) # filter by year ?award wdt:P361 wd:Q106748908. # part of DigAMus Awards SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". ?project rdfs:label ?projectLabel. } } GROUP BY ?project ?projectLabel ORDER BY (?participated_in_years) (?Project_name)
Use at
- https://query.wikidata.org/sparql
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#>
# #151 (2023-02-14), 2021 #41, 2020 #111
# info: project Q107168829 participated in 2020 and 2021
SELECT
(?project AS ?Project_Wd_item_link)
(?projectLabel AS ?Project_name)
(GROUP_CONCAT(DISTINCT YEAR(?awardYear); SEPARATOR = ", ") AS ?participated_in_years)
WHERE {
?project (p:P1344|p:P166|p:P1411) ?awardStatement.
?awardStatement (ps:P1344|ps:P166|ps:P1411) ?award;
pq:P585 ?awardYear.
# FILTER((YEAR(?awardYear)) = 2020 ) # filter by year
?award wdt:P361 wd:Q106748908. # part of DigAMus Awards
SERVICE wikibase:label {
bd:serviceParam wikibase:language "de,en".
?project rdfs:label ?projectLabel.
}
}
GROUP BY ?project ?projectLabel
ORDER BY (?participated_in_years) (?Project_name)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?Project_Wd_item_link")
v9("?Project_name")
v5("?award")
v4("?awardStatement")
v6("?awardYear"):::projected
v9("?participated_in_years")
v3("?project"):::projected
v7("?projectLabel"):::projected
c9(["wd:Q106748908"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["de,en"]):::literal
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;
v3 --"p:P1411"--> v4
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:P166"--> v4
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:P1344"--> v4
end
union0r <== or ==> union0l
end
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
subgraph union3[" Union "]
subgraph union3l[" "]
style union3l fill:#abf,stroke-dasharray: 3 3;
v4 --"p:statement/P1411"--> v5
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:statement/P166"--> v5
end
union3r <== or ==> union3l
end
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:statement/P1344"--> v5
end
union2r <== or ==> union2l
end
v4 --"p:qualifier/P585"--> v6
v5 --"p:direct/P361"--> c9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
v3 --"rdfs:label"--> v7
end
bind1[/"?project"/]
v3 --o bind1
bind1 --as--o v8
bind2[/"?projectLabel"/]
v7 --o bind2
bind2 --as--o v9
bind3[/"year-from-dateTime(?awardYear)"/]
v6 --o bind3
bind3 --as--o v9