Top | ![]() |
![]() |
![]() |
![]() |
GDataFreebaseService is a subclass of GDataService for communicating with the Google Freebase API. It supports queries in MQL format, that allows highly flexible queries on any topic. MQL is a JSON based query language, MQL requests consist of a mix of defined and empty values for types in the Freebase schema, those "placeholder" values will be filled in on the reply. For more information and examples, see the MQL overview page.
For more details of Google Freebase API, see the online documentation.
GDataFreebaseService * gdata_freebase_service_new (const gchar *developer_key
,GDataAuthorizer *authorizer
);
Creates a new GDataFreebaseService using the given GDataAuthorizer. If authorizer
is NULL
, all requests are made as an unauthenticated user.
Having both developer_key
and authorizer
set to NULL
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-NULL
and valid.
developer_key |
developer key to use the API, or |
[allow-none] |
authorizer |
a GDataAuthorizer to authorize the service's requests, or |
[allow-none] |
Since: 0.15.1
GDataAuthorizationDomain *
gdata_freebase_service_get_primary_authorization_domain
(void
);
The primary GDataAuthorizationDomain for interacting with Freebase. This will not normally need to be used, as it's used internally by the GDataFreebaseService methods. However, if using the plain GDataService 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.
Since: 0.9.0
GDataFreebaseResult * gdata_freebase_service_query (GDataFreebaseService *self
,GDataFreebaseQuery *query
,GCancellable *cancellable
,GError **error
);
Performs a MQL query on the service, you can find out more about MQL in the online MQL documentation.
self |
||
query |
a GDataFreebaseQuery with the MQL query |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
[allow-none] |
a GDataFreebaseResult containing the query result; unref with g_object_unref()
.
[transfer full]
Since: 0.15.1
void gdata_freebase_service_query_async (GDataFreebaseService *self
,GDataFreebaseQuery *query
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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_freebase_service_query()
, which is the synchronous version of
this function.
self |
||
query |
a GDataFreebaseQuery with the MQL query |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when authentication is finished |
|
user_data |
data to pass to the |
[closure] |
Since: 0.15.1
GDataFreebaseTopicResult * gdata_freebase_service_get_topic (GDataFreebaseService *self
,GDataFreebaseTopicQuery *query
,GCancellable *cancellable
,GError **error
);
Queries information about a topic, identified through a Freebase ID. You can find out more about topic queries in the
online documentation.self |
||
query |
a GDataFreebaseTopicQuery containing the topic ID |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
[allow-none] |
a GDataFreebaseTopicResult containing information about the topic; unref with g_object_unref()
.
[transfer full]
Since: 0.15.1
void gdata_freebase_service_get_topic_async (GDataFreebaseService *self
,GDataFreebaseTopicQuery *query
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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_freebase_service_get_topic()
, which is the synchronous version of
this function.
self |
||
query |
a GDataFreebaseQuery with the MQL query |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when authentication is finished |
|
user_data |
data to pass to the |
[closure] |
Since: 0.15.1
GDataFreebaseSearchResult * gdata_freebase_service_search (GDataFreebaseService *self
,GDataFreebaseSearchQuery *query
,GCancellable *cancellable
,GError **error
);
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
self |
||
query |
a GDataFreebaseSearchQuery containing the topic ID |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
error |
[allow-none] |
a GDataFreebaseSearchResult containing the results for the given search query; unref with g_object_unref()
.
[transfer full]
Since: 0.15.1
void gdata_freebase_service_search_async (GDataFreebaseService *self
,GDataFreebaseSearchQuery *query
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
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_freebase_service_search()
, which is the synchronous version of
this function.
self |
||
query |
a GDataFreebaseQuery with the MQL query |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
callback |
a GAsyncReadyCallback to call when authentication is finished |
|
user_data |
data to pass to the |
[closure] |
Since: 0.15.1
GInputStream * gdata_freebase_service_get_image (GDataFreebaseService *self
,GDataFreebaseTopicValue *value
,GCancellable *cancellable
,guint max_width
,guint max_height
,GError **error
);
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.
self |
||
value |
a GDataFreebaseTopicValue from a topic result |
|
cancellable |
optional GCancellable object, or |
[allow-none] |
max_width |
maximum width of the image returned, or 0 |
|
max_height |
maximum height of the image returned, or 0 |
|
error |
[allow-none] |
Since: 0.15.1
typedef struct _GDataFreebaseService GDataFreebaseService;
All the fields in the GDataFreebaseService structure are private and should never be accessed directly.
Since: 0.15.1
typedef struct { } GDataFreebaseServiceClass;
All the fields in the GDataFreebaseServiceClass structure are private and should never be accessed directly.
Since: 0.15.1
“developer-key”
property“developer-key” gchar *
The developer key your application has registered with the Freebase API. For more information, see the online documentation.
Flags: Read / Write / Construct Only
Default value: NULL
Since: 0.15.1