query-5e08204b880aa0ab4f21ea1afa59293b
Get Item, collection and inventory ID
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?item ?collection ?id WHERE {
?item wdt:P31 wd:Q3305213 .
?item wdt:P571 ?date .
#minus{ ?item wdt:P18 [] . }
?item wdt:P217 ?id .
?item p:P217 ?statement .
?statement pq:P195 ?collection .
FILTER (YEAR(?date) < 1945)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?collection"):::projected
v1("?date")
v3("?id"):::projected
v2("?item"):::projected
v4("?statement")
c3(["wd:Q3305213"]):::iri
f0[["year-from-dateTime(?date) < '1945^^xsd:integer'"]]
f0 --> v1
v2 --"p:direct/P31"--> c3
v2 --"p:direct/P571"--> v1
v2 --"p:direct/P217"--> v3
v2 --"p:P217"--> v4
v4 --"p:qualifier/P195"--> v5