Hi all,
I was wondering if anyone had any advice for mapping a set of Freebase identifiers to WikiData identifiers. I’m looking to port over a few thousand entities in use in an application since Freebase is going to be shut off next month.
My apologies if this is a rudimentary question. I took a quick look at the API [1] and didn’t see an obvious way of doing it. Or is the WikiData Query API [2] a better fit for this? I was able to figure out how to do a lookup based on the FreebaseID,
https://wdq.wmflabs.org/api?q=string%5B646:%27/m/04hcw']
Any tips or pointers would be appreciated.
//Ed
[1] https://www.wikidata.org/w/api.php [2] https://wdq.wmflabs.org/api_documentation.html
On Sun, May 17, 2015 at 4:23 PM, Ed Summers ehs@pobox.com wrote:
Hi all,
I was wondering if anyone had any advice for mapping a set of Freebase identifiers to WikiData identifiers. I’m looking to port over a few thousand entities in use in an application since Freebase is going to be shut off next month.
My apologies if this is a rudimentary question. I took a quick look at the API [1] and didn’t see an obvious way of doing it. Or is the WikiData Query API [2] a better fit for this? I was able to figure out how to do a lookup based on the FreebaseID,
https://wdq.wmflabs.org/api?q=string[646:'/m/04hcw']
Any tips or pointers would be appreciated.
To do this you want to either use Wikidata Query, which you already found, or work on dumps. More about them at https://www.wikidata.org/wiki/Wikidata:Data_access
Cheers Lydia
Hi Ed. In addition to the API(s), there's a specific Freebase<->Wikidata mapping dump which is a little old (18 months), but very compact and easy to work with. The identifiers are likely to be pretty stable, so if the entities you are interested in have been around for a while, it might be easier to work with.
https://developers.google.com/freebase/data#freebase-wikidata-mappings
The three hits for your sample topic make me suspicious about the quality of the mapping though
$ curl http://storage.googleapis.com/freebase-public/fb2w.nt.gz | zgrep 'm.04hcw' http://rdf.freebase.com/ns/m.04hcw < http://www.w3.org/2002/07/owl#sameAs%3E http://www.wikidata.org/entity/Q9391 . http://rdf.freebase.com/ns/m.04hcw4 < http://www.w3.org/2002/07/owl#sameAs%3E < http://www.wikidata.org/entity/Q1579293%3E . http://rdf.freebase.com/ns/m.04hcwh < http://www.w3.org/2002/07/owl#sameAs%3E < http://www.wikidata.org/entity/Q1347932%3E .
I don't know if this dump was used as the basis for the identifiers loaded into Wikidata, but you might want to consider building in some safeguards like double checking that names match -- whatever lookup scheme you decide to use.
Tom
On Sun, May 17, 2015 at 10:23 AM, Ed Summers ehs@pobox.com wrote:
Hi all,
I was wondering if anyone had any advice for mapping a set of Freebase identifiers to WikiData identifiers. I’m looking to port over a few thousand entities in use in an application since Freebase is going to be shut off next month.
My apologies if this is a rudimentary question. I took a quick look at the API [1] and didn’t see an obvious way of doing it. Or is the WikiData Query API [2] a better fit for this? I was able to figure out how to do a lookup based on the FreebaseID,
https://wdq.wmflabs.org/api?q=string[646:'/m/04hcw']
Any tips or pointers would be appreciated.
//Ed
[1] https://www.wikidata.org/w/api.php [2] https://wdq.wmflabs.org/api_documentation.html
Wikidata-l mailing list Wikidata-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikidata-l
Oops! Never mind!
On Sun, May 17, 2015 at 5:28 PM, Tom Morris tfmorris@gmail.com wrote:
The three hits for your sample topic make me suspicious about the quality of the mapping though
$ curl http://storage.googleapis.com/freebase-public/fb2w.nt.gz | zgrep 'm.04hcw' http://rdf.freebase.com/ns/m.04hcw < http://www.w3.org/2002/07/owl#sameAs%3E < http://www.wikidata.org/entity/Q9391%3E . http://rdf.freebase.com/ns/m.04hcw4 < http://www.w3.org/2002/07/owl#sameAs%3E < http://www.wikidata.org/entity/Q1579293%3E . http://rdf.freebase.com/ns/m.04hcwh < http://www.w3.org/2002/07/owl#sameAs%3E < http://www.wikidata.org/entity/Q1347932%3E .
Those are prefix matches, of course. A better grep is:
$ curl http://storage.googleapis.com/freebase-public/fb2w.nt.gz | zgrep 'm.04hcw>'
Tom