GData.FreebaseService¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
d/r/w/co |
Your Freebase developer API key. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GData.FreebaseService(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
All the fields in the
GData.FreebaseService
structure are private and should never be accessed directly.New in version 0.15.1.
- classmethod get_primary_authorization_domain()¶
- Returns:
the service’s authorization domain
- Return type:
The primary
GData.AuthorizationDomain
for interacting with Freebase. This will not normally need to be used, as it’s used internally by theGData.FreebaseService
methods. However, if using the plainGData.Service
methods to implement custom queries or requests which libgdata does not support natively, then this domain may be needed to authorize the requests.The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains.
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- classmethod new(developer_key, authorizer)¶
- Parameters:
developer_key (
str
orNone
) – developer key to use the API, orNone
authorizer (
GData.Authorizer
orNone
) – aGData.Authorizer
to authorize the service’s requests, orNone
- Returns:
a new
GData.FreebaseService
; unref withGObject.Object.unref
()- Return type:
Creates a new
GData.FreebaseService
using the givenGData.Authorizer
. If authorizer isNone
, all requests are made as an unauthenticated user. Having both developer_key and authorizer set toNone
is allowed, but this should be reserved for debugging situations, as there is a certain key-less quota for those purposes. If this service is used on any code intended to be deployed, one or both of developer_key and authorizer should be non-None
and valid.New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- get_image(value, cancellable, max_width, max_height)¶
- Parameters:
value (
GData.FreebaseTopicValue
) – aGData.FreebaseTopicValue
from a topic resultcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
max_width (
int
) – maximum width of the image returned, or 0max_height (
int
) – maximum height of the image returned, or 0
- Raises:
- Returns:
a
Gio.InputStream
opened to the image; unref withGObject.Object.unref
()- Return type:
Creates an input stream to an image object returned in a topic query. If max_width and max_height are unspecified (i.e. set to 0), the image returned will be the smallest available.
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- get_topic(query, cancellable)¶
- Parameters:
query (
GData.FreebaseTopicQuery
) – aGData.FreebaseTopicQuery
containing the topic IDcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
GData.FreebaseTopicResult
containing information about the topic; unref withGObject.Object.unref
()- Return type:
Queries information about a topic, identified through a Freebase ID. You can find out more about topic queries in the
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- get_topic_async(query, cancellable, callback, *user_data)¶
- Parameters:
query (
GData.FreebaseTopicQuery
) – aGData.FreebaseQuery
with the MQL querycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when authentication is finisheduser_data (
object
orNone
) – data to pass to the callback function
Queries information about a topic, identified through a Freebase ID. self and query are all reffed when this function is called, so can safely be unreffed after this function returns. When the query is replied, or fails, callback will be executed, and the result can be obtained through
GData.Service.query_single_entry_finish
().For more details, see
GData.FreebaseService.get_topic
(), which is the synchronous version of this function.New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- query(query, cancellable)¶
- Parameters:
query (
GData.FreebaseQuery
) – aGData.FreebaseQuery
with the MQL querycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
GData.FreebaseResult
containing the query result; unref withGObject.Object.unref
()- Return type:
Performs a MQL query on the service, you can find out more about MQL in the online MQL documentation.
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- query_async(query, cancellable, callback, *user_data)¶
- Parameters:
query (
GData.FreebaseQuery
) – aGData.FreebaseQuery
with the MQL querycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when authentication is finisheduser_data (
object
orNone
) – data to pass to the callback function
Performs a MQL query on the service. self and query are all reffed when this function is called, so can safely be unreffed after this function returns. When the query is replied, or fails, callback will be executed, and the result can be obtained through
GData.Service.query_single_entry_finish
().For more details, see
GData.FreebaseService.query
(), which is the synchronous version of this function.New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- search(query, cancellable)¶
- Parameters:
query (
GData.FreebaseSearchQuery
) – aGData.FreebaseSearchQuery
containing the topic IDcancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
- Raises:
- Returns:
a
GData.FreebaseSearchResult
containing the results for the given search query; unref withGObject.Object.unref
()- Return type:
Performs a search for any given search term, filters can be set on query to narrow down the results. The results returned are ordered by relevance. You can find out more about topic queries in the
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
- search_async(query, cancellable, callback, *user_data)¶
- Parameters:
query (
GData.FreebaseSearchQuery
) – aGData.FreebaseQuery
with the MQL querycancellable (
Gio.Cancellable
orNone
) – optionalGio.Cancellable
object, orNone
callback (
Gio.AsyncReadyCallback
orNone
) – aGio.AsyncReadyCallback
to call when authentication is finisheduser_data (
object
orNone
) – data to pass to the callback function
Performs a search for any given search term. self and query are all reffed when this function is called, so can safely be unreffed after this function returns.
For more details, see
GData.FreebaseService.search
(), which is the synchronous version of this function.New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.
Property Details¶
- GData.FreebaseService.props.developer_key¶
- Name:
developer-key
- Type:
- Default Value:
- Flags:
The developer key your application has registered with the Freebase API. For more information, see the online documentation.
New in version 0.15.1.
Deprecated since version 0.17.7: Google Freebase has been permanently shut down.