1

From the Freebase dump available here, I need to find the relation between two entities.

Eg.

entity1 = "barack_obama"  
entity2 = "USA"  
get_relation_from_freebase(entity1, entity2) -> "President"

As of 2018, is there a straightforward way to do that from the RDF dump? If I have around 10k unique entity pairs, what's the most efficient way to get the relation, if it is available in Freebase?

Note : I'm trying to align a large corpus with freebase relations, to generate training sample for relation extraction task.

Also, I have looked at following questions - here and here, I can create a subset for few domains but still haven't figured out a good way to retrieve relations.

holmes840
  • 1,063
  • 2
  • 11
  • 24

1 Answers1

1

The Freebase schema was/is nowhere near as simplistic as your question implies.

From memory it's something along the lines of:

Governmental Office
  .name President of the United States
  .jurisdiction United States of America
  .office_holders[]

Governmental Office Holder
  .office ^entity above^
  .term start <date>
  .term end <date>
  .office_holder Barak Obama

There will be some entities directly connected by relations (e.g. Person.birthplace), but a number of multi-hop, including the example you picked.

If you're only interested in direct relationships, you can just grab all the relations that an entity is the source or target of and filter those by the entities of interest on the other end of the relation.

Tom Morris
  • 10,490
  • 32
  • 53