query-fc50e8c4c1c932bdc7010e5893cecb10

rq turtle/ttl

Please optimize this query. But this query ends in timeout: (P279)subclass of and no (P31)instance of I want to know how many Wikidata elements are with ESwiki sitelink but no

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
SELECT (COUNT(DISTINCT ?article) AS ?count) WHERE {
  ?sitelink schema:about ?article;
    schema:isPartOf <https://es.wikipedia.org/>.
  FILTER(NOT EXISTS { ?article wdt:P31 ?P31. })
  FILTER(NOT EXISTS { ?article wdt:P279 ?P279. })
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?P279") v3("?P31") v1("?article"):::projected v5("?count") v4("?sitelink") c5([https://es.wikipedia.org/]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P279"--> e0v2 e0v2("?P279"):::projected e0v1("?article"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 v1 --"wdt:P279"--> v2 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P31"--> e1v2 e1v2("?P31"):::projected e1v1("?article"):::projected end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c2 f1 --> v3 v1 --"wdt:P31"--> v3 v4 --"schema:about"--> v1 v4 --"schema:isPartOf"--> c5 bind3[/"count(?article)"/] v1 --o bind3 bind3 --as--o v5