-->

Entity Relations from freebase dump

2019-04-16 10:47发布

问题:

I want to dump all entity-name-pair with a relation.

Example :

subject predicate object
<freebase/ns/g.11bc7__xnw>  <freebase/ns/people.place_lived.location>   <freebase/ns/m.02_286>  .

Freebase in above line refers to url of freebase website. I extracted all triplets which have mid in subject and object, then I took the predicate as the relation.

For the above example my code will output something like this:

entity pair : g.11bc7__xnw , m.02_286
relation : people.place_lived.location

I have two issues:

  1. when I ran my code on freebase dump I got 14887 relations but the actual number of relations in freebase are more than 25,000 .
  2. for some mid's, there is no property name or alias. (/type/object/name, /common/topic/alias)

Please tell me what I am doing wrong.

回答1:

Well, some relations to not point to a mid, but to a basic value:

<http://rdf.freebase.com/ns/g.11vjz1ynm> <http://rdf.freebase.com/ns/measurement_unit.dated_percentage.date> "2001-02"

And that's basically the entire measurement_unit domain.

Then, the mids that don't have name and alias sound like cvt's (compound value types) which are artificial nodes that hold a complex relationship (eg. node to node + time).

So I think you should account better for measurements, booleans, dates, etc. and cvts.