Thanks Ettore for your excellent reply.
Richard, I have taken notice of your request here:
https://github.com/wetneb/openrefine-wikibase/issues/17
Antonin
On 11/20/18 12:59 PM, 'Richard Fabio' via OpenRefine wrote:
> Hi Ettore,
>
> thank you for your perfect answer and helpful explanation. The process
> took some time, but worked well. I managed also to get the German
> Wikipedia links by replacing site ="enwiki" with site ="dewiki".
>
> Kind regards
> Richard
>
> Am Mo., 19. Nov. 2018 um 22:25 Uhr schrieb Ettore Rizza
> <
ettor...@gmail.com <mailto:
ettor...@gmail.com>>:
> <
http://www.wikidata.org/w/api.php?action=wbgetentities&format=xml&props=sitelinks/urls&ids=Q5&sitefilter=enwiki>|
>
>
> If you are not used to working with APIs in OpenRefine
> <
https://programminghistorian.org/en/lessons/fetch-and-parse-data-with-openrefine>,
> you can try this Python script. Just add a new column based on the
> column that contains your names matched with Wikidata, change the
> scripting language to "Python/Jython " and paste this code in the
> window.
>
> |
> importjson
> importurllib2
>
> site ="enwiki"
>
> url
> ="
https://www.wikidata.org/w/api.php?action=wbgetentities&format=json&props=sitelinks/urls&ids="+
cell.recon.match.id
> +"&sitefilter=%s"%site
>
> response =urllib2.urlopen(url)
>
> json =json.loads(response.read())
>
> fori injson['entities'].values():
> returni['sitelinks'][site]['url']
>
> |
>
>
> screenshot-localhost-3333-2018.11.19-22-14-49.png
>
>
>
> Feel free to ask for clarification if it's not clear.
>
> Ettore
>
> On Monday, 19 November 2018 17:15:07 UTC+1,
richi...@googlemail.com
> <mailto:
richi...@googlemail.com> wrote:
>
> Dear Group Members,
>
> I am trying to get the Wikipedia URL for the wikipedias articles
> about a list of "humans" in different languages (if there is an
> entry), based on a variable I already successfully reconciled
> with wikidata. Since the Wikipedia links seem not to be directly
> available as statements, I do not know how to get them.
> Can someone help me?
>
> Kind regards
> Richard
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "OpenRefine" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
openrefine+...@googlegroups.com
> <mailto:
openrefine+...@googlegroups.com>.
> --
> You received this message because you are subscribed to the Google
> Groups "OpenRefine" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
openrefine+...@googlegroups.com
> <mailto:
openrefine+...@googlegroups.com>.