query-e90b3f597d4bca5649647db22ace5375
Fortifications changed in the last 2 days
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?change
WHERE {
?item wdt:P31/wdt:P279* wd:Q57821.
MINUS {?item wdt:P31/wdt:P279* wd:Q744099.}
?item schema:dateModified ?change .
FILTER(BOUND(?change) && DATATYPE(?change) = xsd:dateTime).
# not in the future, and not more than 2 days ago
BIND(NOW() - ?change AS ?distance).
FILTER(0 <= ?distance && ?distance < 2).
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
} ORDER BY DESC(?change)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?change"):::projected
v4("?distance")
v3("?item"):::projected
a1((" "))
a2((" "))
c12(["en-gb,en,mul"]):::literal
c10(["bd:serviceParam"]):::iri
c7(["wd:Q744099"]):::iri
c6(["wd:Q57821"]):::iri
f0[["'0^^xsd:integer' <= ?distance?distance < '2^^xsd:integer'"]]
f0 --> v4
f1[["bound(?change)?change = 'xsd:dateTime'"]]
f1 --> v1
v3 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c6
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v3 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c7
end
v3 --"schema:dateModified"--> v1
bind3[/"NOW() - ?change"/]
v1 --o bind3
bind3 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end