Export URL as clickable hyperlink (HTML Table)

117 views
Skip to first unread message

Lothar Huber

unread,
Jul 17, 2018, 9:43:49 AM7/17/18
to OpenRefine
Hello,

when I use reconciliation (wikidata) the reconciled values can be exported as clickable hyperlinks using Export > HTML table

I can create a new colum based on the reconciled values with "https://www.wikidata.org/wiki/"+cell.recon.match.id and will get a new colum with clickable hyperlinks in OpenRefine. If I export the data as HTML table those hyperlinks will not exported as clickable hyperlinks.

What do I have tho change to get clickable hyperlinks?

Thanks, Lothar

John Little

unread,
Jul 17, 2018, 10:23:45 AM7/17/18
to openr...@googlegroups.com
The first idea that comes to my mind is creating a custom template report.  You can find more about that in the templating documentation.  In this case you would need to write the actual HTML.  To create a link  it would look something like this:      

<a href="{{cells["url"].value)}}">{{cells["url_label"].value)}}</a>

There's an example about how to create a YAML report.  Using that as a guide you could would create an HTML report.  In your use case you probably also need to wrap the HTML link inside the full compliment of HTML Table tags.  

You might also want to encode the url (See escape documentation.)

Hope that helps.

--
John Little


--
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.
For more options, visit https://groups.google.com/d/optout.

Owen Stephens

unread,
Jul 18, 2018, 4:55:22 AM7/18/18
to OpenRefine
It seems like if we have a clickable link in the OpenRefine data table, that should export as a clickable link in the HTML table export. Can you submit an enhancement request for this?  Go to https://github.com/OpenRefine/OpenRefine/issues and click 'New Issue' - from there you should be prompted for all the relevant information.

Owen
Reply all
Reply to author
Forward
0 new messages