query-278fa701b538f630d08130a4b2310b97
This returns the list of all the paintings of Wikidata
with an image
SELECT ?item ?itemLabel ?image ?itemDescription (YEAR(?date) as ?year) ?countryLabel WHERE { ?item wdt:P31/wdt:P279* wd:Q3305213. # Select only the paintings ?item wdt:P18 ?image. # Select only the element with an image OPTIONAL { ?item wdt:P17 ?country } . OPTIONAL { ?item wdt:P571 ?date } . #OPTIONAL { ?depicts rdfs:label ?dL FILTER( LANG( ?dL ) = "fr" ) } . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]" } . }
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# This returns the list of all the paintings of Wikidata
# with an image
SELECT ?item ?itemLabel ?image ?itemDescription (YEAR(?date) as ?year) ?countryLabel WHERE {
?item wdt:P31/wdt:P279* wd:Q3305213. # Select only the paintings
?item wdt:P18 ?image. # Select only the element with an image
OPTIONAL { ?item wdt:P17 ?country } .
OPTIONAL { ?item wdt:P571 ?date } .
#OPTIONAL { ?depicts rdfs:label ?dL FILTER( LANG( ?dL ) = "fr" ) } .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]" } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?country")
v4("?date"):::projected
v2("?image"):::projected
v1("?item"):::projected
v5("?year")
a1((" "))
c3(["wd:Q3305213"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;"]):::literal
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P18"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P17".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P571".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind0[/"year-from-dateTime(?date)"/]
v4 --o bind0
bind0 --as--o v5