Hi Paris Writers' News/PWN, Markus, and Wikidatans,
Based on your example (http://tinyurl.com/yahwql2n), Markus, I'm seeking to learn how to do a similar query for all languages.
In Wikidata I found a Q item # for "language" - Q34770 ( https://www.wikidata.org/wiki/Q34770) - and plugged this into your query, replaced the word "countries" with "languages," etc. but didn't get a result, where your query yields 209 countries, Markus.
In a parallel way, how would one compute them from the names of the articles in Wikipedia?
Thanks, Scott
On Fri, Apr 27, 2018 at 2:31 PM, Markus Kroetzsch < markus.kroetzsch@tu-dresden.de> wrote:
Hi,
(English) DBpedia URIs are basically just (English) Wikipedia URIs with the first part exchanged. So one can compute them from the names of the articles. Example: a query for DBpedia URIs for all countries:
""" SELECT ?dbpediaId WHERE { ?item wdt:P31 wd:Q6256 . # for the example: get IDs for all countries ?sitelink schema:about ?item ; schema:isPartOf https://en.wikipedia.org/ .
BIND(URI(CONCAT("http://dbpedia.org/resource/%22,SUBSTR(STR(?sitelink),31))) as ?dbpediaId) } """
Of course, depending on your use case, you can do the same offline (without requiring SPARQL to rewrite the id strings for you).
In theory, one could use federation to pull in data from the DBpedia endpoint, but in practice I could not find an interesting query that completes within the timeout (but I did not try for very long to debug this).
Best regards,
Markus
On 23/04/18 06:41, PWN wrote:
If one knows the Q code (or URI) for an entity on Wikidata, how can one find the Dbpedia Id and the information linked to it? Thank you.
Sent from my iPad _______________________________________________ Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata
Wikidata mailing list Wikidata@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata