query-1230f3a634deda8a43ea7cfe375900f2
and so I can call the first one with each of the QIDs returned from the second to get the properties and values for them. However I assume WDQS would prefer that fewer requests are made so I would like to combine them. I've tried
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?art ?wdLabel ?ps_Label WHERE {
{
select ?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
} limit 10
}
?art ?p ?statement .
?statement ?ps ?ps_ .
?wd wikibase:claim ?p.
?wd wikibase:statementProperty ?ps.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
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