query-6fd5db0f4c42e7b74de687a8deeaf8d2

rq turtle/ttl

Finding items that does not have a frwikiHello, I wanted to have any airport, ranked by patronage, that does not have a frwiki. That query times out, any thoughts ?

Use at

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 
(sample(?number) as ?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) .
   FILTER NOT EXISTS {
   ?article schema:about ?item .
   ?article schema:isPartOf <https://fr.wikipedia.org/> . #Targeting Wikipedia language where subjects has no article.
 }
} group by ?item 
order by desc(?number ) limit 2

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?article") v3("?item"):::projected v7("?number"):::projected v5("?statement") v4("?time") v6("?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"--> v7 bind2[/"year-from-dateTime(?time)"/] v4 --o bind2 bind2 --as--o v6 bind4[/"sample(?number)"/] v7 --o bind4 bind4 --as--o v7