query-eb0cb64cb9cb1f07cff0463500c76941
.on Mastodon and on TwitterOriginally posted
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Timeline
SELECT ?entry ?entryLabel ?artist ?artistLabel (MIN(?date) AS ?date_) (SAMPLE(?image) AS ?image_) WHERE {
{
?entry wdt:P1344 ?contest.
?contest wdt:P31 wd:Q110288240.
} UNION {
?entry wdt:P31 wd:Q63481999.
}
?entry wdt:P585|wdt:P577 ?date;
wdt:P175 ?artist.
OPTIONAL { ?artist wdt:P18 ?image. }
{
?artist (wdt:P527|^wdt:P361)?/wdt:P361?/(wdt:P31|wdt:P1552)/wdt:P279* wd:Q14756018.
} UNION {
?artist (wdt:P527|^wdt:P361|^wdt:P463)?/p:P3373/pq:P1039/wdt:P279* wd:Q159979.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?entry ?entryLabel ?artist ?artistLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?artist"):::projected
v2("?contest")
v3("?date"):::projected
v6("?date_")
v1("?entry"):::projected
v5("?image"):::projected
v7("?image_")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
a5((" "))
a6((" "))
c3(["wd:Q110288240"]):::iri
c17(["wd:Q159979"]):::iri
c19(["bd:serviceParam"]):::iri
c4(["wd:Q63481999"]):::iri
c13(["wd:Q14756018"]):::iri
c21(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P31"--> c4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P1344"--> v2
v2 --"p:direct/P31"--> c3
end
union0r <== or ==> union0l
end
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P577"--> v3
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P585"--> v3
end
union1r <== or ==> union1l
end
v1 --"p:direct/P175"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P18".-> v5
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;
subgraph union4[" Union "]
subgraph union4l[" "]
style union4l fill:#abf,stroke-dasharray: 3 3;
subgraph union5[" Union "]
subgraph union5l[" "]
style union5l fill:#abf,stroke-dasharray: 3 3;
a4 --"p:direct/P463"--> v4
end
subgraph union5r[" "]
style union5r fill:#abf,stroke-dasharray: 3 3;
a4 --"p:direct/P361"--> v4
end
union5r <== or ==> union5l
end
end
subgraph union4r[" "]
style union4r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:direct/P527"--> a4
end
union4r <== or ==> union4l
end
end
subgraph union3r[" "]
style union3r fill:#abf,stroke-dasharray: 3 3;
end
union3r <== or ==> union3l
end
a4 --"p:P3373"--> a5
a5 --"p:qualifier/P1039"--> a6
a6 --"p:direct/P279"--> c17
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
subgraph union6[" Union "]
subgraph union6l[" "]
style union6l fill:#abf,stroke-dasharray: 3 3;
subgraph union7[" Union "]
subgraph union7l[" "]
style union7l fill:#abf,stroke-dasharray: 3 3;
a1 --"p:direct/P361"--> v4
end
subgraph union7r[" "]
style union7r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:direct/P527"--> a1
end
union7r <== or ==> union7l
end
end
subgraph union6r[" "]
style union6r fill:#abf,stroke-dasharray: 3 3;
end
union6r <== or ==> union6l
end
subgraph union8[" Union "]
subgraph union8l[" "]
style union8l fill:#abf,stroke-dasharray: 3 3;
a1 --"p:direct/P361"--> a2
end
subgraph union8r[" "]
style union8r fill:#abf,stroke-dasharray: 3 3;
end
union8r <== or ==> union8l
end
subgraph union9[" Union "]
subgraph union9l[" "]
style union9l fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P1552"--> a3
end
subgraph union9r[" "]
style union9r fill:#abf,stroke-dasharray: 3 3;
a2 --"p:direct/P31"--> a3
end
union9r <== or ==> union9l
end
a3 --"p:direct/P279"--> c13
end
union2r <== or ==> union2l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c19 --"wikibase:language"--> c21
end
bind2[/"min(?date)"/]
v3 --o bind2
bind2 --as--o v6
bind3[/"sample(?image)"/]
v5 --o bind3
bind3 --as--o v7