query-86257a09e22f95588ca8ad4ce4410c90
Bouzinac(sample(?number) as ?number)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT ?item ?any_number
WHERE
{
{
SELECT ?item (SAMPLE(?number) AS ?any_number)
WHERE
{
?item wdt:P31/wdt:P279* wd:Q1248784.
?item p:P3872 ?statement.
?statement pq:P585 ?time.
?statement ps:P3872 ?number.
BIND (YEAR(?time) AS ?year)
FILTER (YEAR(?time) = 2017)
}
GROUP BY ?item
} FILTER NOT EXISTS
{
?article schema:about ?item .
?article schema:isPartOf <https://fr.wikipedia.org/> . #Targeting Wikipedia language where subjects has no article.
}
}
ORDER BY DESC(?any_number)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?any_number"):::projected
v2("?article")
v3("?item"):::projected
v6("?number")
v5("?statement")
v4("?time")
v7("?year")
a1((" "))
c7(["wd:Q1248784"]):::iri
c3([https://fr.wikipedia.org/]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:about"--> e0v2
e0v1 --"schema:isPartOf"--> e0c3
e0v1("?article"):::projected
e0v2("?item"):::projected
e0c3([https://fr.wikipedia.org/]):::iri
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
f0 --> c2
f0 --> c3
v2 --"schema:about"--> v3
v2 --"schema:isPartOf"--> c3
f1[["year-from-dateTime(?time) = '2017^^xsd:integer'"]]
f1 --> v4
v3 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c7
v3 --"p:P3872"--> v5
v5 --"p:qualifier/P585"--> v4
v5 --"p:statement/P3872"--> v6
bind2[/"year-from-dateTime(?time)"/]
v4 --o bind2
bind2 --as--o v7
bind4[/"sample(?number)"/]
v6 --o bind4
bind4 --as--o v8