query-6fba1797ac52aef716b4cd205322165b
publications published before 1924
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT ?item (YEAR(?dop) as ?year) WHERE {
# look for items of type "work" or "data" (or children)
?item wdt:P31/wdt:P279* ?pq .
VALUES ?pq { wd:Q386724 wd:Q42848 }
# get year of publication
?item p:P577 ?statement .
?statement psv:P577 [
wikibase:timePrecision "9"^^xsd:integer ;
wikibase:timeValue ?dop ;
] .
FILTER (?dop < "1925-00-00T00:00:00"^^xsd:dateTime)
FILTER NOT EXISTS { ?item wdt:P6216 [] } # item does not have P6216 yet
} limit 20000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?dop"):::projected
v1("?item"):::projected
v4("?pq")
v4("?statement")
v5("?year")
a1((" "))
a2((" "))
a3((" "))
c7(["9^^xsd:integer"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P6216"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
v1 --"p:direct/P6216"--> a1
f1[["?dop < '1925-00-00T00:00:00^^xsd:dateTime'"]]
f1 --> v2
v1 --"p:direct/P31"--> a2
a2 --"p:direct/P279"--> v4
bind2[/VALUES ?pq/]
bind2-->v4
bind20(["wd:Q386724"])
bind20 --> bind2
bind21(["wd:Q42848"])
bind21 --> bind2
v1 --"p:P577"--> v4
a3 --"wikibase:timePrecision"--> c7
a3 --"wikibase:timeValue"--> v2
v4 --"p:statement/value/P577"--> a3
bind3[/"year-from-dateTime(?dop)"/]
v2 --o bind3
bind3 --as--o v5