query-7bf47141f5f95f223346bed384543e3e
all paintings that have a movement property OR of which the creator has a movement propertyHi everyone! I'm creating a dataset of artworks with their genres/styles attached to them. I only get 7.4K hits of artworks that have an image and a style/genre associated with them, so I'm trying to expand the query. I want to include artworks with images that have a creator, which in turn has a movement property. That way this gives an indication of which style/genre the artwork has. I only don't know how to create an OR operator in SPARQL that will let me say 'give me all artworks with an image, and a movement property OR a creator with a movement property. Store that movement property in ?style. Here's what I have so far:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?creator ?style ?image WHERE {
?item wdt:P31/wdt:P279* wd:Q838948 .
?item wdt:P170 ?creator .
?item wdt:P135 ?style .
?item wdt:P18 ?image .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?creator"):::projected
v4("?image"):::projected
v1("?item"):::projected
v3("?style"):::projected
a1((" "))
c3(["wd:Q838948"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P170"--> v2
v1 --"wdt:P135"--> v3
v1 --"wdt:P18"--> v4