query-45910a5fb7d2e3f7e3d6f30ad0f44012
yet another timing out queryI used query below a lot last few months:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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 distinct ?jLabel ?dLabel (count(*) as ?num) (SAMPLE(?item) as ?sampleitem){
?item p:P6216 ?statement .
?statement ps:P6216 ?pd . # copyright status = public domain
?statement pq:P1001 ?j .
?statement pq:P459 ?d .
VALUES ?pd { wd:Q19652 wd:Q15687061 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} group by ?jLabel ?dLabel
order by ?num
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?d")
v2("?item"):::projected
v5("?j")
v7("?num")
v7("?pd")
v7("?sampleitem")
v3("?statement")
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
v2 --"p:P6216"--> v3
v3 --"p:statement/P6216"--> v7
v3 --"p:qualifier/P1001"--> v5
v3 --"p:qualifier/P459"--> v6
bind0[/VALUES ?pd/]
bind0-->v7
bind00(["wd:Q19652"])
bind00 --> bind0
bind01(["wd:Q15687061"])
bind01 --> bind0
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind3[/"count(*)"/]
bind3 --as--o v7
bind4[/"sample(?item)"/]
v2 --o bind4
bind4 --as--o v7