query-8647f6ad404dcbcf3748d7e99a343318
Can you use this knowledge to write a query for all paintings with their painting surface? Here’s my solution: 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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?painting ?paintingLabel ?material ?materialLabel
WHERE
{
?painting wdt:P31/wdt:P279* wd:Q3305213;
p:P186 [ ps:P186 ?material; pq:P518 wd:Q861259 ].
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
- https://www.wikidata.org/wiki/User:D1gggg/Wikidata_model_and_SPARQL
- https://www.wikidata.org/wiki/User:TweetsFactsAndQueries/A_Guide_To_WDQS/Staging
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?material"):::projected
v1("?painting"):::projected
a1((" "))
a2((" "))
c3(["wd:Q3305213"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
c6(["wd:Q861259"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
a2 --"p:statement/P186"--> v2
a2 --"p:qualifier/P518"--> c6
v1 --"p:P186"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end