query-5a1a0db70d90bc2da24731fe524b5a3d

rq turtle/ttl

Get all articles from the Wikipedia: namespace of all language editions with 10 or more sitelinks

adapted from "Get all Featured Articles (Q17437796)" (https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Featured_articles_of_all_Wikimedia_projects)

SELECT ?lang ?name ?itemLabel ?sitelink ?linkcount ?item WHERE { ?item wikibase:sitelinks ?linkcount . ?sitelink schema:name ?name ; schema:inLanguage ?lang ; schema:about ?item . #;wikibase:badge wd:Q17437796. # Comment this in (from original example) and the query works FILTER (?linkcount >= 394) . # For smaller queries, I've been testing with 394 (max is 395) instead of 10 FILTER (CONTAINS(?name, 'Wikipedia:')) . SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Must this change outside of main namespace? } ORDER BY DESC(?linkcount) LIMIT 100 #for testing

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Get all articles from the Wikipedia: namespace of all language editions with 10 or more sitelinks
#  adapted from "Get all Featured Articles (Q17437796)" (https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples#Featured_articles_of_all_Wikimedia_projects)
SELECT ?lang ?name ?itemLabel ?sitelink ?linkcount ?item WHERE {
  ?item wikibase:sitelinks ?linkcount 
    .
  ?sitelink schema:name ?name
    ; schema:inLanguage ?lang
    ; schema:about ?item
    .
    #;wikibase:badge wd:Q17437796.  # Comment this in (from original example) and the query works
  FILTER (?linkcount >= 394) .      # For smaller queries, I've been testing with 394  (max is 395) instead of 10
  FILTER (CONTAINS(?name, 'Wikipedia:')) .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } # Must this change outside of main namespace?
}
ORDER BY DESC(?linkcount)
LIMIT 100                           #for testing

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v5("?lang"):::projected v1("?linkcount"):::projected v2("?name"):::projected v4("?sitelink"):::projected c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["contains(?name,'Wikipedia:')"]] f0 --> v2 f1[["?linkcount >= '394^^xsd:integer'"]] f1 --> v1 v3 --"wikibase:sitelinks"--> v1 v4 --"schema:name"--> v2 v4 --"schema:inLanguage"--> v5 v4 --"schema:about"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end