query-83a1122c2f3877b5eb237a9df92163e7
Met images and official depiction info from Met API SELECT ?file ?filename ?thing ?thingLabel # ?url WHERE { ?file wdt:P3634 ?metid . MINUS { # FILTER NOT EXISTS does not work as well ?file p:P180 [ ps:P180 ?thing ; pq:P459 wd:Q106429444 ] . } ?file schema:url ?image . ?file schema:contentUrl ?url . BIND (wikibase:decodeUri(CONCAT("File:", substr(str(?url),53))) AS ?filename)
service https://query.wikidata.org/sparql {
service wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
?thing rdfs:label ?thingLabel.
}
}
} LIMIT 100
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
# Met images and official depiction info from Met API
SELECT ?file ?filename ?thing ?thingLabel # ?url
WHERE {
?file wdt:P3634 ?metid .
MINUS { # FILTER NOT EXISTS does not work as well
?file p:P180 [
ps:P180 ?thing ;
pq:P459 wd:Q106429444
] .
}
?file schema:url ?image .
?file schema:contentUrl ?url .
BIND (wikibase:decodeUri(CONCAT("File:", substr(str(?url),53))) AS ?filename)
# service <https://query.wikidata.org/sparql> {
# service wikibase:label {
# bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
# ?thing rdfs:label ?thingLabel.
# }
# }
} LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?file"):::projected
v6("?filename"):::projected
v4("?image")
v2("?metid")
v3("?thing"):::projected
v5("?url")
a1((" "))
c4(["wd:Q106429444"]):::iri
v1 --"p:direct/P3634"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
a1 --"p:statement/P180"--> v3
a1 --"p:qualifier/P459"--> c4
v1 --"p:P180"--> a1
end
v1 --"schema:url"--> v4
v1 --"schema:contentUrl"--> v5
bind1[/"http://wikiba.se/ontology#decodeUri(concat('File:',substring(str(?url),'53^^xsd:integer')))"/]
v5 --o bind1
bind1 --as--o v6