query-cb863c9de1ccd17a95e2d316cffbc7e1
Selection of statements. How should I filter ? (Q2165236)everything =(P518)applies to part, aspect, or form , only (P518)applies to part, aspect, or form or if there is a (P518)applies to part, aspect, or form Hello, I wish only statements without
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 ?item ?itemLabel
?year ?number ?where
WHERE { {?item wdt:P238 ?IATA
VALUES ?IATA { "PPT" }.}.
?item p:P3872 ?statement.
?statement pq:P585 ?time.
bind (YEAR(?time) AS ?year)
?statement ps:P3872 ?number.
filter(?year>=2017)
optional{?statement pq:P518 ?where.}
filter(?where!=wd:Q30971)
filter(?where!=wd:Q3427953)
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;
v5("?IATA")
v1("?item"):::projected
v7("?number"):::projected
v5("?statement")
v6("?time")
v3("?where"):::projected
v7("?year"):::projected
c14(["wikibase:DeprecatedRank"]):::iri
c12(["fr"]):::literal
c10(["bd:serviceParam"]):::iri
f0[["?where != 'wd:Q3427953'"]]
f0 --> v3
f1[["?where != 'wd:Q30971'"]]
f1 --> v3
f2[["?year >= '2017^^xsd:integer'"]]
f2 --> v7
v1 --"p:direct/P238"--> v5
bind3[/VALUES ?IATA/]
bind3-->v5
bind30(["PPT"])
bind30 --> bind3
v1 --"p:P3872"--> v5
v5 --"p:qualifier/P585"--> v6
bind4[/"year-from-dateTime(?time)"/]
v6 --o bind4
bind4 --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
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
subgraph minus5["MINUS"]
style minus5 stroke-width:6px,fill:pink,stroke:red;
v5 --"wikibase:rank"--> c14
end