query-d7710299ac881742f8220d12f5ac1743
TODO
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 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#>
SELECT DISTINCT ?item ?itemLabel ?year ?number ?where
WHERE {
?item wdt:P238 ?IATA .
?item p:P3872 ?statement.
?statement pq:P585 ?time.
bind (YEAR(?time) AS ?year)
?statement ps:P3872 ?number.
optional { ?statement pq:P518 ?applies .}
filter(bound(?applies)=false || ?applies = wd:Q2165236 )
bind(if(bound(?applies)=false,"no applies","everywhere") as ?where )
filter(?year>=2017)
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
}
order by ?item desc (?year)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?IATA")
v3("?applies")
v1("?item"):::projected
v7("?number"):::projected
v5("?statement")
v6("?time")
v8("?where"):::projected
v7("?year"):::projected
c14(["wikibase:DeprecatedRank"]):::iri
c12(["fr"]):::literal
c10(["bd:serviceParam"]):::iri
f0[["?year >= '2017^^xsd:integer'"]]
f0 --> v7
f1[["(bound(?applies) = 'false^^xsd:boolean' || ?applies = 'wd:Q2165236')"]]
f1 --> v3
v1 --"p:direct/P238"--> v4
v1 --"p:P3872"--> v5
v5 --"p:qualifier/P585"--> v6
bind2[/"year-from-dateTime(?time)"/]
v6 --o bind2
bind2 --as--o v7
v5 --"p:statement/P3872"--> v7
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P518".-> v3
end
bind3[/"if(bound(?applies) = 'false^^xsd:boolean','no applies','everywhere')"/]
v3 --o bind3
bind3 --as--o v8
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
subgraph minus4["MINUS"]
style minus4 stroke-width:6px,fill:pink,stroke:red;
v5 --"wikibase:rank"--> c14
end