0

How can we obtain the output of the Freebase topic api (used like this from the web api) from offline dumps of the id: /m/09937 ?

Actually, I would like to obtain similar (if not the same) output without querying the web.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Knight
  • 223
  • 2
  • 10

1 Answers1

0
  1. Collect all the triples (lines) for the desired subject (first column value)
  2. Filter out unneeded stuff like /base and /user properties in second column
  3. Sort by property name (second column value)
  4. Construct JSON with a hierarchy to match type/property occurrences and populate it with the values from the third column

For extra credit, process the URI templates for key/value pairs to construct links to other web sites and attribution templates to create the corresponding attribution strings.

Of course, the whole point of the Topic API is to save you having to go to all this trouble.

Tom Morris
  • 10,490
  • 32
  • 53