fadmaa / grefine-rdf-extension

An extension to Google Refine that enables graphical mapping of Google Refine project data to an RDF skeleton and then exporting it in RDF format
http://refine.deri.ie
Other
94 stars 55 forks source link

Can I get Freebase reconciled URIs in the RDF export? #6

Closed bvatant closed 13 years ago

bvatant commented 13 years ago

I have reconciled a very simple data sample with Freebase (linking companies to some domain of interest). For example Whirlpool is reconciled with http://www.freebase.com/view/m/04d8tw (which is not actually the actual URI of the Freebase topic, but a good proxy ...) Can I get this URI into the RDF, and how? Actually the only export format of Refine which seems able to capture the reconciled URIs is Excel. Shh...

Thanks for the tool anyway. Great stuff!

Bernard

fadmaa commented 13 years ago

Hi Bernard, you can use: cell.recon.match.id for the cell URI expression.

This is part of the standard Google Refine Expression Language, I will be considering adding some sort of shortcut to use it.

Regards, Fadi

bvatant commented 13 years ago

Hi Fadi

Thanks for the quick answer, but sorry to be dumb, how do I "use" cell.recon.match.id? Mind you I'm not a developer, just an average application user :)

Bernard

fadmaa commented 13 years ago

I think I was not clear at all in my response... pardon :-)

In the node configuration dialog (the one that appears after clicking on a node in the graph template) you can use the preview/edit link to enter a custom expression. cell.recon.match.id needs to be used there as the value for the expression input.

also make sure that the cell is used as a URI and not as a label.

the dialog is shown in this image http://lab.linkeddata.deri.ie/2010/grefine-rdf-extension/imgs/preview_uri_example.png

let me please know if this helps!

Fadi

bvatant commented 13 years ago

OK understood

It (almost) works but there is a little glitch remaining with the base URI I declare the base URI to be http://rdf.freebase.com/ns But what I get is e.g., the following in the preview

value cell.recon.match.id resolved against the base URI Accordions /m/0mkg http://rdf.freebase.com/m/0mkg

the /ns part of the base URI is trimmed for some reason. The correct URI I should get is http://rdf.freebase.com/ns/m/0mkg

Of course I can post-process the RDF to add id, but it would be better to get the correct URI to begin with :)

Thanks a lot for the support !

Bernard

fadmaa commented 13 years ago

Add a trailing slash to the base URI i.e. http://rdf.freebase.com/ns/

It is the way the default java.net.URI resolving algorithm works which might not be perfect, but hopefully good enough for now :)

Regards, Fadi

bvatant commented 13 years ago

I tried it of course, but it does not work better :(

Sorry ...

fadmaa commented 13 years ago

I think this is because the value of cell.recon.match.id starts with a slash (it is an absolute path) to work around this use one of these two:

hope that helps! Fadi

bvatant commented 13 years ago

Bingo!

cell.recon.match.id.substring(1) with Base URI = http://rdf.freebase.com/ns/ works

The conneg on http://rdf.freebase.com/ns/m/01kh63 redirects the html to http://www.freebase.com/view/en/casio and the RDF to http://rdf.freebase.com/rdf/en.casio. So far so good but the latter does not mention either http://rdf.freebase.com/ns/m/01kh63 or any other URI built on the m/01kh63 key.

Freebase URI policy is weird indeed :)

Bernard

tfmorris commented 13 years ago

Bernard - that sounds like a bug in the Freebase RDF output (it should reference all identifiers for the page that it knows about). Have you reported it to the Freebase team?

bvatant commented 13 years ago

Hi Tom

Indeed I would call that a Freebase bug, not a feature. I've not (yet) reported to FB team. Do you want to do it?

Bernard