Joe Gregorio | 0250385 | 2011-08-31 09:07:55 -0400 | [diff] [blame^] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: class Resource</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | <p> |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 7 | <tr bgcolor="#ffc8d8"> |
| 8 | <td colspan=3 valign=bottom> <br> |
| 9 | <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> |
| 10 | |
| 11 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 12 | <td colspan=2><tt>A class for interacting with a resource.<br> </tt></td></tr> |
| 13 | <tr><td> </td> |
| 14 | <td width="100%">Methods defined here:<br> |
| 15 | <dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| 16 | |
| 17 | <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> |
| 18 | <br> |
| 19 | Args:<br> |
| 20 | format: string, The format of the result.<br> |
| 21 | Allowed values<br> |
| 22 | json - The content is a JSON encoded object.<br> |
| 23 | raw - The content of the response is the raw bytes of the desired value. The content-type is set to text/plain<br> |
| 24 | id: string, The id of the item that you want data about (required) (repeated)<br> |
| 25 | dbName: string, A parameter (required)</tt></dd></dl> |
| 26 | |
| 27 | <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> |
| 28 | <br> |
| 29 | Args:<br> |
| 30 | maxwidth: integer, Maximum width in pixels for resulting image.<br> |
| 31 | maxheight: integer, Maximum height in pixels for resulting image.<br> |
| 32 | fallbackid: string, Use the image associated with this secondary id if no image is associated with the primary id.<br> |
| 33 | pad: boolean, A boolean specifying whether the resulting image should be padded up to the requested dimensions.<br> |
| 34 | mode: string, Method used to scale or crop image.<br> |
| 35 | Allowed values<br> |
| 36 | fill - TODO(bendrees)<br> |
| 37 | fillcrop - TODO(bendrees)<br> |
| 38 | fillcropmid - TODO(bendrees)<br> |
| 39 | fit - TODO(bendrees)<br> |
| 40 | id: string, Freebase entity or content id, mid, or guid. (required) (repeated)</tt></dd></dl> |
| 41 | |
| 42 | <dl><dt><a name="Resource-mqlread"><strong>mqlread</strong></a> = method(self, **kwargs)</dt><dd><tt>Performs MQL Queries.<br> |
| 43 | <br> |
| 44 | Args:<br> |
| 45 | lang: string, The language of the results - an id of a /type/lang object.<br> |
| 46 | cursor: string, The mql cursor.<br> |
| 47 | indent: integer, How many spaces to indent the json.<br> |
| 48 | callback: string, JS method name for JSONP callbacks.<br> |
| 49 | uniqueness_failure: string, How MQL responds to uniqueness failures.<br> |
| 50 | Allowed values<br> |
| 51 | hard - Be strict - throw an error.<br> |
| 52 | soft - Just return the first encountered object.<br> |
| 53 | html_escape: boolean, Whether or not to escape entities.<br> |
| 54 | cost: boolean, Show the costs or not.<br> |
| 55 | query: string, An envelope containing a single MQL query. (required)<br> |
| 56 | as_of_time: string, Run the query as it would've been run at the specified point in time.</tt></dd></dl> |
| 57 | |
| 58 | <dl><dt><a name="Resource-mqlwrite"><strong>mqlwrite</strong></a> = method(self, **kwargs)</dt><dd><tt>Performs MQL Write Operations.<br> |
| 59 | <br> |
| 60 | Args:<br> |
| 61 | body: object, The request body. (required)<br> |
| 62 | indent: integer, How many spaces to indent the json.<br> |
| 63 | callback: string, JS method name for JSONP callbacks.<br> |
| 64 | use_permission_of: string, Use the same permission node of the object with the specified id.<br> |
| 65 | query: string, An MQL query with write directives. (required)</tt></dd></dl> |
| 66 | |
| 67 | <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> |
| 68 | |
| 69 | <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> |
| 70 | <br> |
| 71 | Args:<br> |
| 72 | lang: string, An id of a /type/lang object that will be used as the language - e.g. '/lang/fr'<br> |
| 73 | body: object, The request body.<br> |
| 74 | license: string, An id of a /common/license object that you want to use as the license of this content<br> |
| 75 | media_body: string, The filename of the media request body.<br> |
| 76 | text_encoding: string, The encoding of the content - e.g. 'utf-8'<br> |
| 77 | 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> |
| 78 | use_permission_of: string, An id of an object that has the permissions that you want to use in the document node.<br> |
| 79 | 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> |
| 80 | document: string, An id of a /common/document object that you'd like to attach this content.</tt></dd></dl> |
| 81 | |
| 82 | <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> |
| 83 | |
| 84 | <hr> |
| 85 | Data descriptors defined here:<br> |
| 86 | <dl><dt><strong>__dict__</strong></dt> |
| 87 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 88 | </dl> |
| 89 | <dl><dt><strong>__weakref__</strong></dt> |
| 90 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 91 | </dl> |
| 92 | </td></tr></table> |
| 93 | </body></html> |