query-c7d5dfcb73084b640af49f97b877f63e
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
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 (sample(?number) as ?number) (sample(?reftype) as ?reftype) (sample(?ref) as ?ref)
WHERE
{
values ?item {wd:Q223416} .
?item p:P3872 ?statement.
?statement pq:P585 ?time.
?statement ps:P3872 ?number.
?statement prov:wasDerivedFrom ?statement2 .
?statement2 ?reftype ?ref.
bind (YEAR(?time) AS ?year)
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
MINUS { ?statement wikibase:rank wikibase:DeprecatedRank }
} group by ?year ?item ?itemLabel
order by ?item desc (?year)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v9("?number"):::projected
v9("?ref"):::projected
v9("?reftype"):::projected
v3("?statement")
v6("?statement2")
v4("?time")
v9("?year"):::projected
c6(["bd:serviceParam"]):::iri
c10(["wikibase:DeprecatedRank"]):::iri
c8(["fr"]):::literal
bind0[/VALUES ?item/]
bind0-->v3
bind00(["wd:Q223416"])
bind00 --> bind0
v3 --"p:P3872"--> v3
v3 --"p:qualifier/P585"--> v4
v3 --"p:statement/P3872"--> v9
v3 --"prov:wasDerivedFrom"--> v6
v6 -->v9--> v9
bind1[/"year-from-dateTime(?time)"/]
v4 --o bind1
bind1 --as--o v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v3 --"wikibase:rank"--> c10
end
bind6[/"sample(?number)"/]
v9 --o bind6
bind6 --as--o v9
bind7[/"sample(?reftype)"/]
v9 --o bind7
bind7 --as--o v9
bind8[/"sample(?ref)"/]
v9 --o bind8
bind8 --as--o v9