| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: class Resource</title> |
| </head><body bgcolor="#f0f0f8"> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="Resource">class <strong>Resource</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> |
| |
| <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| <tr><td> </td> |
| <td width="100%">Methods defined here:<br> |
| <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="Resource-dataset"><strong>dataset</strong></a> = method(self, **kwargs)</dt><dd><tt>Provides access to various key/value databases used by Freebase, with the id in the path.<br> |
| <br> |
| Args:<br> |
| format: string, The format of the result.<br> |
| Allowed values<br> |
| json - The content is a JSON encoded object.<br> |
| raw - The content of the response is the raw bytes of the desired value. The content-type is set to text/plain<br> |
| id: string, The id of the item that you want data about (required) (repeated)<br> |
| dbName: string, A parameter (required)</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-image"><strong>image</strong></a> = method(self, **kwargs)</dt><dd><tt>Returns the scaled/cropped image attached to a freebase node.<br> |
| <br> |
| Args:<br> |
| maxwidth: integer, Maximum width in pixels for resulting image.<br> |
| maxheight: integer, Maximum height in pixels for resulting image.<br> |
| fallbackid: string, Use the image associated with this secondary id if no image is associated with the primary id.<br> |
| pad: boolean, A boolean specifying whether the resulting image should be padded up to the requested dimensions.<br> |
| mode: string, Method used to scale or crop image.<br> |
| Allowed values<br> |
| fill - TODO(bendrees)<br> |
| fillcrop - TODO(bendrees)<br> |
| fillcropmid - TODO(bendrees)<br> |
| fit - TODO(bendrees)<br> |
| id: string, Freebase entity or content id, mid, or guid. (required) (repeated)</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-mqlread"><strong>mqlread</strong></a> = method(self, **kwargs)</dt><dd><tt>Performs MQL Queries.<br> |
| <br> |
| Args:<br> |
| lang: string, The language of the results - an id of a /type/lang object.<br> |
| cursor: string, The mql cursor.<br> |
| indent: integer, How many spaces to indent the json.<br> |
| callback: string, JS method name for JSONP callbacks.<br> |
| uniqueness_failure: string, How MQL responds to uniqueness failures.<br> |
| Allowed values<br> |
| hard - Be strict - throw an error.<br> |
| soft - Just return the first encountered object.<br> |
| html_escape: boolean, Whether or not to escape entities.<br> |
| cost: boolean, Show the costs or not.<br> |
| query: string, An envelope containing a single MQL query. (required)<br> |
| as_of_time: string, Run the query as it would've been run at the specified point in time.</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-mqlwrite"><strong>mqlwrite</strong></a> = method(self, **kwargs)</dt><dd><tt>Performs MQL Write Operations.<br> |
| <br> |
| Args:<br> |
| body: object, The request body. (required)<br> |
| indent: integer, How many spaces to indent the json.<br> |
| callback: string, JS method name for JSONP callbacks.<br> |
| use_permission_of: string, Use the same permission node of the object with the specified id.<br> |
| query: string, An MQL query with write directives. (required)</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-text"><strong><a href="freebase.v1-dev.text.html">text</a></strong></a> = methodResource(self)</dt><dd><tt>A collection resource.</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-upload"><strong>upload</strong></a> = method(self, **kwargs)</dt><dd><tt>Uploads data to the Freebase blobstore and creates documents in the graph.<br> |
| <br> |
| Args:<br> |
| lang: string, An id of a /type/lang object that will be used as the language - e.g. '/lang/fr'<br> |
| body: object, The request body.<br> |
| license: string, An id of a /common/license object that you want to use as the license of this content<br> |
| media_body: string, The filename of the media request body.<br> |
| text_encoding: string, The encoding of the content - e.g. 'utf-8'<br> |
| rights_holder: string, An id of a user or topic that is considered to be the rights holder for this content - applies only to images.<br> |
| use_permission_of: string, An id of an object that has the permissions that you want to use in the document node.<br> |
| content: string, An id of a /type/content object that should be the last content attached to the document node specified. This is a consistency check and will make sure that the content has not changed since the request was created. The document parameter must also be passed if this is present.<br> |
| document: string, An id of a /common/document object that you'd like to attach this content.</tt></dd></dl> |
| |
| <dl><dt><a name="Resource-user"><strong><a href="freebase.v1-dev.user.html">user</a></strong></a> = methodResource(self)</dt><dd><tt>A collection resource.</tt></dd></dl> |
| |
| <hr> |
| Data descriptors defined here:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| </td></tr></table> |
| </body></html> |