query-ea5d147aa61d6754a0e34228ed762e0d

rq turtle/ttl

Get all latin alphabet interwikis of an item 09:42, 11 November 2020 (UTC) 💛●✒️●💬 Bouzinac, being an latin-alphabet language (eg. frwiki, enwiki, dewiki, vietnamese, etc). And then get a stats on the first letter (eg how much first B and how much first P). Thanks ! (Q16520)Busan Hello, how to get all wikititles of that item However, we don't really need it - because if the page title starts with a Latin character, we can assume it's in Latin script :-). So this query finds all the sitelinks, filters to just Wikipedias, and then checks if they start with "B" or "P": have several different alphabets set.(Q9292)Azerbaijani on the language, some like (P282)writing system on the Wikipedia, not all of them have it set; if we do it by (P282)writing system : So this one is a little tricky because it's hard to pick out a "Latin-alphabet language" through SPARQL. If we do it by Bouzinac@

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#>
SELECT ?article ?letter ?name ?lang  WHERE
{
  ?article schema:about wd:Q16520 . ?article schema:name ?name . ?article schema:inLanguage ?lang . ?article schema:isPartOf ?x .
  FILTER CONTAINS(str(?x), "wikipedia") . # only Wikipedias
  optional { filter(STRSTARTS(?name, 'B')) . bind('B' as ?letter) } # title starts with B
  optional { filter(STRSTARTS(?name, 'P')) . bind('P' as ?letter) } # title starts with P
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?letter ?name

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?article"):::projected v5("?lang"):::projected v6("?letter"):::projected v2("?name"):::projected v3("?x") c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q16520"]):::iri f0[["contains(str(?x),'wikipedia')"]] f0 --> v3 v4 --"schema:about"--> c5 v4 --"schema:name"--> v2 v4 --"schema:inLanguage"--> v5 v4 --"schema:isPartOf"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; bind1[/"'B'"/] bind1 --as--o v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; bind2[/"'P'"/] bind2 --as--o v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 -."wikibase:language".-> c12 end