query-28360f64275b3f7b2b8cf7b27a3cf3db

rq turtle/ttl

How to pass a list of QIDs to a secondary queryI have a query as such

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?art ?artLabel ?artDescription ?wdLabel ?ps_Label  WHERE {
    {
   SELECT DISTINCT ?art WHERE {
       ?art wdt:P31 wd:Q3305213 ; # Get items that are instances of painting
            wdt:P170 wd:Q5598 ; # By creator Rembrandt
            wdt:P195/wdt:P361* ?collection . # That are in some collection
   }
 }   ?art ?p ?statement .
   ?statement ?ps ?ps_ .
   ?wd wikibase:claim ?p.
   ?wd wikibase:statementProperty ?ps.
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
 } limit 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?art"):::projected v2("?collection") v3("?p") v5("?ps") v6("?ps_") v4("?statement") v7("?wd") a1((" ")) c2(["wd:Q3305213"]):::iri c10(["bd:serviceParam"]):::iri c4(["wd:Q5598"]):::iri c12(["en"]):::literal v1 --"wdt:P31"--> c2 v1 --"wdt:P170"--> c4 v1 --"wdt:P195"--> a1 a1 --"wdt:P361"--> v2 v1 -->v3--> v4 v4 -->v5--> v6 v7 --"wikibase:claim"--> v3 v7 --"wikibase:statementProperty"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end