Print

Print


An alternative would be to use the DBpedia SPARQL endpoint. Something like
this might work:

SELECT DISTINCT ?wikiResource WHERE {
?s rdfs:label "Denarius"@en .
?s owl:sameAs ?wikiResource
FILTER(REGEX(?wikiResource, "wikidata", "i"))
} LIMIT 1

Once you get into REGEXs for the lookup though, the responses will get a
lot slower.

Frank

On 12 May 2016 at 13:43, Ethan Gruber <[log in to unmask]> wrote:

> To add a little more info, here's the documentation for wbgetentities:
> https://www.wikidata.org/w/api.php?action=help&modules=wbgetentities
>
> You can refine the response format with the 'props' request parameter. If
> you only want to resolve the Wikipedia title and get the Wikidata entity
> ID, you can use props=info (
> https://www.wikidata.org/w/api.php?action=wbgetentities&titles=Denarius&sites=enwiki&format=xml&props=info),
> and you'll get a shorter response for better efficiency.
>
> On Thu, May 12, 2016 at 8:38 AM, Ethan Gruber <[log in to unmask]> wrote:
>
>> Yes, there are a number of wikidata APIs:
>> https://www.wikidata.org/w/api.php
>>
>> We use the APIs in the Nomisma RDF editing interface to pull authority
>> URIs and labels in alternative languages into our concepts. E.g.,
>>
>>
>> https://www.wikidata.org/w/api.php?action=wbgetentities&titles=Denarius&sites=enwiki&format=xml
>>
>> The request above will get the Wikidata entity ID for the title
>> "Denarius" in the English wikipedia. The API works for all languages of
>> Wikipedia.
>>
>> On Thu, May 12, 2016 at 7:31 AM, Gabriel BODARD <[log in to unmask]
>> > wrote:
>>
>>> Has anyone come up with a simple look-up or conversion table for finding
>>> Wikidata URIs relating to a given Wikipedia page URL? I know the Wikidata
>>> uri is given as a link in all Wikipedia pages, but short of web-scraping,
>>> is there a simple lookup table or API that one could use to get URIs for a
>>> long list of WP pages?
>>>
>>> Any suggestions welcome!
>>>
>>> Thanks,
>>>
>>> Gabby
>>>
>>>
>>> --
>>> Dr Gabriel BODARD
>>> Reader in Digital Classics
>>>
>>> Institute of Classical Studies
>>> University of London
>>> Senate House
>>> Malet Street
>>> London WC1E 7HU
>>>
>>> E: [log in to unmask]
>>> T: +44 (0)20 78628752
>>>
>>> http://digitalclassicist.org/
>>>
>>
>>
>

-- 
Dr Frank Lynam
Adjunct Lecturer in Digital Humanities
School of English
Trinity college Dublin
Twitter: @flynam