query-e9b3ef0f20c24c6f7500f46286b17970
Find articles that have country (P17) Hungary with no en-wiki-page. Sort them by most sitelinks. PREFIX schema: http://schema.org/
SELECT ?item ?itemLabel ?linkcount WHERE { ?item wdt:P17 wd:Q28 . ?item wikibase:sitelinks ?linkcount . FILTER (?linkcount >= 1) . # only include items with 1 or more sitelinks FILTER NOT EXISTS { ?article schema:about ?item . ?article schema:inLanguage "en" . ?article schema:isPartOf https://en.wikipedia.org/ } SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,es,ar,fr" } } GROUP BY ?item ?itemLabel ?linkcount ORDER BY DESC(?linkcount)
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 bd: <http://www.bigdata.com/rdf#>
# Find articles that have country (P17) Hungary with no en-wiki-page. Sort them by most sitelinks.
PREFIX schema: <http://schema.org/>
SELECT ?item ?itemLabel ?linkcount WHERE {
?item wdt:P17 wd:Q28 .
?item wikibase:sitelinks ?linkcount .
FILTER (?linkcount >= 1) . # only include items with 1 or more sitelinks
FILTER NOT EXISTS {
?article schema:about ?item .
?article schema:inLanguage "en" .
?article schema:isPartOf <https://en.wikipedia.org/>
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,de,es,ar,fr" }
}
GROUP BY ?item ?itemLabel ?linkcount
ORDER BY DESC(?linkcount)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article")
v3("?item"):::projected
v1("?linkcount"):::projected
c3(["en"]):::literal
c8(["wd:Q28"]):::iri
c5([https://en.wikipedia.org/]):::iri
c11(["bd:serviceParam"]):::iri
c13(["en,de,es,ar,fr"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"schema:about"--> e0v2
e0v1 --"schema:inLanguage"--> e0c3
e0v1 --"schema:isPartOf"--> e0c5
e0v1("?article"):::projected
e0v2("?item"):::projected
e0c5([https://en.wikipedia.org/]):::iri
e0c3(["en"]):::literal
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
f0 --> c2
f0 --> c3
f0 --> c4
f0 --> c5
v2 --"schema:about"--> v3
v2 --"schema:inLanguage"--> c3
v2 --"schema:isPartOf"--> c5
f1[["?linkcount >= '1^^xsd:integer'"]]
f1 --> v1
v3 --"wdt:P17"--> c8
v3 --"wikibase:sitelinks"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end