Freebase gets simple type names and sorts by commonality

I would like to get a list of types by their common name from the freebase id

{ "id": "/m/02mjmr", #obama "type":[] }โ€‹ 

How can I return type names instead of their identifiers? The above returns

 0: "/common/topic"xp 1: "/people/person"xp 2: "/user/robert/default_domain/presidential_candidate"xp 3: "/book/author"xp 4: "/award/award_winner"xp 5: "/book/book_subject"xp 6: "/user/robert/x2008_presidential_election/candidate"xp 7: "/government/politician"xp 8: "/organization/organization_member"xp 9: "/user/robert/default_domain/my_favorite_things"xp 

And finally, how can I sort them by account? or if possible?

Those.,

 President Nobel Prize Winner Author Person 

etc.?

Maybe something similar to a well-known API, but it looks like it is leaving?

http://wiki.freebase.com/wiki/Notable_types_API

+4
source share
2 answers

You can get the names and instances of instances using

 { "id": "/m/02mjmr", "type": [{ "name": null, "id":null, "/type/type/domain":{"key":[{"namespace":"/","limit":0}],"id":null} "/freebase/type_profile/instance_count": null, "sort":"/freebase/type_profile/instance_count" }] }โ€‹ 

One definition of โ€œconspicuousโ€ is low frequency, so you can simply invert the sorting of the instance counter to get prominence. Limiting this type in Freebase "commons" would eliminate noisy user types. One way to determine commons types is to look for / type / type / domain values โ€‹โ€‹that are in the root namespace (i.e., one path segment, e.g. / government)

For your example, the smallest frequency types are:

  43 /government/us_president US President /government 51 /people/appointer Appointer /people 73 /architecture/building_occupant Building Occupant /architecture 204 /government/political_appointer Political Appointer /government 230 /book/poem_character Poem character /book 254 /event/public_speaker Public speaker /event 

You can refine the filtering by adding to the blacklist types that, in your opinion, are not noticeable for your application. There are currently 2134 public types, and some of them are primitive data types or things to use on the system, so you donโ€™t need much time to browse and list the entire list.

+3
source

You may also be interested in looking at the Freebase Search API , which returns one or more notable types with each result. You can find a specific topic by MID as follows:

https://www.googleapis.com/freebase/v1/search?query=/m/02mjmr&indent=true

+1
source

Source: https://habr.com/ru/post/1400428/


All Articles