[Developers] Getting back an article !!

Tejas Lagvankar linuxtej at gmail.com
Sat Nov 1 00:13:34 UTC 2008


Hi,

Few days back I saw a discussion regarding adding an article to topics. I
was successful in doing that.
But, I'm not at all finding a way to get that content back through a query
!! Basically what I don't understand is the way in which the objects(or
elements in the MQL infrastructure) are arranged, and what is the
relationship between them. For example, in the write tutorial, a code
segment says (I used this one to add article to my test topic on the
sandbox):

result = metaweb.write({'create':'unless_exists',
                        'type':'/common/topic',
                        'id':None,
                        'name':title,
                        'article' : { 'create':'unless_exists',
                                      'type':'/common/document',
                                      'id':None,
                                      'content':content_id }},
                       credentials)

So, I interpret that 'article' is a "property" of the object named by title
here (TestObject3 in my case). Assuming this, if I query back for the
article, it gives me 'null' :

QUERY:
{
  "article" : [],
  "name" : "TestObject3",
  "type" : "/common/topic"
}
RESPONSE:
{
  "article" : [
    null
  ],
  "name" : "TestObject3",
  "type" : "/common/topic"
}

while I can view the article when i see through browser !! So either my
understanding is wrong OR there seems to be some problem (which is highly
unlikely) !!
Anyways, can anyone point me to some link/document where the various
elements and their relationships are clearly mentioned !! (By relationship I
mean to understand like which elements contains which one, which can be a
property of other.. and so on... )... I'm already very confused about all
this !!

Regards,
Tej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20081031/9a447526/attachment-0001.htm 


More information about the Developers mailing list