query-90d92ed95b8d5a0e7523ab109ad5a3e9
TODO
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?officialLabel ?itemLabel ?langcode ?article
WHERE
{
?item wdt:P361 wd:Q83741704. #item is one of the articles about Covid by territor
?item wdt:P17 ?country. #item has a country
?country wdt:P37 ?official. #country has an official language
?official wdt:P424 ?langcode. #official language has wiki language code
?wiki wdt:P31 wd:Q10876391; #there is a wikipedia
wdt:P424 ?langcode; #that wikipedia has a langcode that is the same as an official language
wdt:P856 ?sitesurl. #that wiki has a site url
#check if official languages are represented in Wikipedia
OPTIONAL
{
?article schema:about ?item.
?article schema:isPartOf ?sitesurl.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?article"):::projected
v2("?country")
v1("?item"):::projected
v4("?langcode"):::projected
v3("?official")
v6("?sitesurl")
v5("?wiki")
c2(["wd:Q83741704"]):::iri
c14(["en"]):::literal
c7(["wd:Q10876391"]):::iri
c12(["bd:serviceParam"]):::iri
v1 --"wdt:P361"--> c2
v1 --"wdt:P17"--> v2
v2 --"wdt:P37"--> v3
v3 --"wdt:P424"--> v4
v5 --"wdt:P31"--> c7
v5 --"wdt:P424"--> v4
v5 --"wdt:P856"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v1
v7 --"schema:isPartOf"--> v6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end