I can use the following query to list all sovereign states via the Wikidata query interface:
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?cid ?country WHERE {
?cid wdt:P31 wd:Q3624078 .
OPTIONAL {
?cid rdfs:label ?country filter (lang(?country) = "en") .
}
}
The result listing contains the Wikidata entity ID and the English label, if available. I'd like to also query the URL of the corresponding English Wikipedia article if it exists. As far as I can tell, Wikipedia URLs are not properties of a Wikidata entity and I have no idea how I can express a relation between a Wikidata entity and Wikipedia URL in the SPARQL query.