query-62b5bc92732d4d0e660cd8490aa99e23
TODO
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (year(?when) as ?year) ?winnerLabel ?score ?ref_url ?retrieved
WHERE
{
?item wdt:P31 wd:Q57776091. # the item is an instance of a Sweet Adelines International chorus competition
?item wdt:P585 ?when. # it has a when statement
?item p:P1346 ?statement. # it has a p: value for P1346, which points to a statement - the unique URI
?statement ps:P1346 ?winner. # the statement has a ps: value i.e. the winner's identity
?statement pq:P1351 ?score. # the statement has a pq:P1351 value, which is the score
?statement prov:wasDerivedFrom ?another_statement.
?another_statement pr:P854 ?ref_url.
?another_statement pr:P813 ?retrieved.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by desc(?year)
Query found at
- https://www.wikidata.org/wiki/User:Tagishsimon/WDQS
- https://www.wikidata.org/wiki/User_talk:Tagishsimon
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?another_statement")
v2("?item"):::projected
v8("?ref_url"):::projected
v9("?retrieved"):::projected
v6("?score"):::projected
v4("?statement")
v3("?when"):::projected
v5("?winner")
v10("?year")
c2(["wd:Q57776091"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P31"--> c2
v2 --"p:direct/P585"--> v3
v2 --"p:P1346"--> v4
v4 --"p:statement/P1346"--> v5
v4 --"p:qualifier/P1351"--> v6
v4 --"prov:wasDerivedFrom"--> v7
v7 --"p:reference/P854"--> v8
v7 --"p:reference/P813"--> v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end
bind0[/"year-from-dateTime(?when)"/]
v3 --o bind0
bind0 --as--o v10