[Developers] Can a link's opposite direction name be retrieved with less queries?
Jim Weaver
jlweaver at lat-inc.com
Fri Sep 21 14:44:46 UTC 2007
I am trying to develop a freebase browser in JavaFX Script. Attached is
a screenshot to help me articulate the question. By the way, please
forgive me as I use terminology that reflects how new I am to freebase.
Anyway, to populate the tree on the left, I'm using the following query:
{
"query":[{
"/type/reflect/any_master":[{
"id":null,
"link":null,
"name":null,
"type":[]
}],
"/type/reflect/any_reverse":[{
"id":null,
"link":null,
"name":null,
"type":[]
}],
"/type/reflect/any_value":[{
"link":null,
"type":null,
"value":null
}],
"id":"/topic/en/the_police",
"name":null
}]
}
To find the name of each link, I'm using the following query:
{
"query":[{
"id":"/music/artist/genre",
"name":null
}]
}
That works fine (e.g. "Musical Genres" in the screenshot), except when
the link is an "any_reverse". In this case, the link (and the name that
comes back) is from the wrong perspective (like the "Recorded By" name
in the screenshot). I know that I can do an additional query to get the
link from the opposite perspective:
{
"query":{
"expected_type":null,
"id":"/music/album/artist",
"master_property":null,
"reverse_property":null,
"type":"/type/property"
}
}
I can then use the master_property or reverse_property value returned to
get the link name, and then do a query to get the correct name:
{
"query":{
"id":"/music/artist/album",
"name":null
}
}
My question is, can the number of queries to accomplish these results be
reduced? By the way, when a link name (e.g. "Musical Genres" is
returned, I'm caching that name so that I don't have to query for it
again.
Thanks in advance,
Jim Weaver
http://jmentor.com/about.php
http://lat-inc.com <http://lat-inc.com/>
jim.weaver at lat-inc.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20070921/652fe0de/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freebaseBrowserScreenShot.gif
Type: image/gif
Size: 20293 bytes
Desc: freebaseBrowserScreenShot.gif
Url : http://lists.freebase.com/pipermail/developers/attachments/20070921/652fe0de/attachment-0001.gif
More information about the Developers
mailing list