query-8269a56fbeab0646fbbc4a43945f4b56

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?shape ((?letter) as ?layer) ?name ?wikilangLabel 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, 'Б')) . bind('Б' as ?letter) } # title starts with Б
  optional { filter(STRSTARTS(?name, 'П')) . bind('П' as ?letter) } # title starts with П
  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
  { ?wiki wdt:P856 ?x . ?wiki wdt:P407 ?wikilang . ?country wdt:P37 ?wikilang . 
   ?country wdt:P3896 ?shape . ?country wdt:P31 wd:Q3624078 .  }
  filter(bound(?letter))
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by ?letter #defaultView:Map

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?article") v8("?country") v5("?lang") v10("?layer") v6("?letter"):::projected v2("?name"):::projected v9("?shape"):::projected v6("?wiki") v7("?wikilang") v3("?x") c16(["wd:Q3624078"]):::iri c18(["bd:serviceParam"]):::iri c20(["#91;AUTO_LANGUAGE#93;,en"]):::literal c7(["wd:Q16520"]):::iri f0[["bound(?letter)"]] f0 --> v6 f1[["contains(str(?x),'wikipedia')"]] f1 --> v3 v4 --"schema:about"--> c7 v4 --"schema:name"--> v2 v4 --"schema:inLanguage"--> v5 v4 --"schema:isPartOf"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; bind2[/"'Б'"/] bind2 --as--o v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; bind3[/"'П'"/] bind3 --as--o v6 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; bind4[/"'B'"/] bind4 --as--o v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; bind5[/"'P'"/] bind5 --as--o v6 end v6 -."wdt:P856".-> v3 v6 --"wdt:P407"--> v7 v8 --"wdt:P37"--> v7 v8 --"wdt:P3896"--> v9 v8 --"wdt:P31"--> c16 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c18 --"wikibase:language"--> c20 end bind6[/"?letter"/] v6 --o bind6 bind6 --as--o v10