In freebase data is organized into topics. Now, each topic has some
(atleast one) types. Multiple types are grouped into domain.
An id of a topic is something like : /domain/type/id
e.g. apple: /food/fruit/apple
AND, /food/ingredients/apple
(+ by default every topic is in /en domain)
/en/apple
new york city: /en/new_york
Now, to access the properties of a topic we should pass the EXACT id.
Then, furthermore, we should know the exact property name which we
want info about ("Scientific name", "color", are all properties of
apple fruit).
Here is one idea how we can query freebase for our system:
Using one query we can find out the list of id's for a keyword, i.e.
that query will return an array of ids which have the same topic name.
That query will return all the topics with apple in its name like
-apple (fruit)
-apple (tree)
-apple, inc (computer company)
-apple II (computer made by apple)
.....
Then we should retrieve the list of properties of each topic. And then
we can query the freebase database regarding the specific property.
PROBLEMS
How will the program know whether apple is the topic or color is the
topic? (We can probably try both of them, and whichever has relevant
result will be posted as the output)
For now, I will try to find the queries for this approach. I am
completely unfamiliar with JSON which is causing the problems. I
haven't read the full API yet and there might be easier ways to do
this... The JSON tutorial teaches us queries not by a programming
point of view, but by the point of view of a user who wants to
retrieve some data. Thus it relies a lot on a "query assist" feature,
which is somewhat like intellisense in IDEs like visual studio,
eclipse. And we obviously cant use query assist in a program.
Please read the freebase query tutorial and help me out! I will also
read JSON and freebase and think of ways to do this. (Many, many
applications use freebase so there definitely are ways to do this)
A LITTLE OVERVIEW OF HOW TO QUERY FREEBASE (for anyone who wants to
make this part of application)
-----------------------------------------------------------------------------------
Freebase queries are in JSON. If you want to learn how to query
freebase start here:
http://www.freebase.com/docs/data/introduction
Then you would need an API so that a program can give a query...
http://code.google.com/p/freebase-java/wiki/GettingStarted
This tutorial will teach you how to use JSON in java...