GData Reference Manual: GDataFreebaseTopicResult

## GDataFreebaseTopicResult GDataFreebaseTopicResult — GData Freebase topic result object |

## Stability Level

Unstable, unless otherwise indicated

## Functions

GDataFreebaseTopicResult * | gdata_freebase_topic_result_new ()
GDataFreebaseTopicObject * | gdata_freebase_topic_result_dup_object ()
GDataFreebaseTopicObject * | gdata_freebase_topic_object_ref ()
void | gdata_freebase_topic_object_unref ()
GPtrArray * | gdata_freebase_topic_object_list_properties ()
const gchar * | gdata_freebase_topic_object_get_id ()
guint64 | gdata_freebase_topic_object_get_property_count ()
guint64 | gdata_freebase_topic_object_get_property_hits ()
GDataFreebaseTopicValue * | gdata_freebase_topic_object_get_property_value ()
GDataFreebaseTopicValue * | gdata_freebase_topic_value_ref ()
void | gdata_freebase_topic_value_unref ()
const gchar * | gdata_freebase_topic_value_get_property ()
const gchar * | gdata_freebase_topic_value_get_text ()
const gchar * | gdata_freebase_topic_value_get_language ()
const gchar * | gdata_freebase_topic_value_get_creator ()
gint64 | gdata_freebase_topic_value_get_timestamp ()
GType | gdata_freebase_topic_value_get_value_type ()
void | gdata_freebase_topic_value_copy_value ()
gint64 | gdata_freebase_topic_value_get_int ()
gdouble | gdata_freebase_topic_value_get_double ()
const gchar * | gdata_freebase_topic_value_get_string ()
const GDataFreebaseTopicObject * | gdata_freebase_topic_value_get_object ()
gboolean | gdata_freebase_topic_value_is_image ()

## Types and Values

| GDataFreebaseTopicResult
| GDataFreebaseTopicResultClass
| GDataFreebaseTopicObject
| GDataFreebaseTopicValue

## Object Hierarchy

        GBoxed
        ├── GDataFreebaseTopicObject
        ╰── GDataFreebaseTopicValue
        GObject
        ╰── GDataParsable
            ╰── GDataEntry
                ╰── GDataFreebaseResult
                    ╰── GDataFreebaseTopicResult

## Includes

    #include <gdata/services/freebase/gdata-freebase-topic-result.h>

## Description

GDataFreebaseTopicResult is a subclass of GDataFreebaseResult that contains all or a subset of the information contained in Freebase about the Freebase ID given to the GDataFreebaseTopicQuery.

For more details of Google Freebase API, see the online documentation.

## Functions

### gdata_freebase_topic_result_new ()

    GDataFreebaseTopicResult *
    gdata_freebase_topic_result_new (void);

Creates a new GDataFreebaseTopicResult with the given ID and default properties.

#### Returns

a new GDataFreebaseTopicResult; unref with `g_object_unref()`.

[transfer full]

Since 0.15.1

### gdata_freebase_topic_result_dup_object ()

    GDataFreebaseTopicObject *
    gdata_freebase_topic_result_dup_object
                                   (GDataFreebaseTopicResult *self);

Returns a reference to the root GDataFreebaseTopicObject containing the topic query results.

#### Parameters

self | a GDataFreebaseTopicResult |

#### Returns

A new reference on the result object, unref with `gdata_freebase_topic_object_unref()`.

[transfer full]

Since 0.15.1

### gdata_freebase_topic_object_ref ()

    GDataFreebaseTopicObject *
    gdata_freebase_topic_object_ref (GDataFreebaseTopicObject *object);

Creates and returns a new reference on `object` .

#### Parameters

object | a GDataFreebaseTopicObject |

#### Returns

`object` , with an extra reference.

[transfer full]

Since 0.15.1

### gdata_freebase_topic_object_unref ()

    void
    gdata_freebase_topic_object_unref (GDataFreebaseTopicObject *object);

Removes a reference from `object` . If the reference count drops to 0, the object is freed.

#### Parameters

object | a GDataFreebaseTopicResult. | [transfer full]

Since 0.15.1

### gdata_freebase_topic_object_list_properties ()

    GPtrArray *
    gdata_freebase_topic_object_list_properties
                                   (const GDataFreebaseTopicObject *object);

Returns the list of Freebase properties described by `object` .

#### Parameters

object | a GDataFreebaseTopicObject |

#### Returns

An array of property names, free with `g_ptr_array_unref()`.

[transfer container][element-type gchar*]

Since 0.15.1

### gdata_freebase_topic_object_get_id ()

    const gchar *
    gdata_freebase_topic_object_get_id (const GDataFreebaseTopicObject *object);

Gets the Freebase ID for this specific object.

#### Parameters

object | a GDataFreebaseTopicObject |

#### Returns

the Freebase ID of this object.

[transfer none]

Since 0.15.1

### gdata_freebase_topic_object_get_property_count ()

    guint64
    gdata_freebase_topic_object_get_property_count
                                   (const GDataFreebaseTopicObject *object,
                                    const gchar *property);

Returns the number of values that `object` holds for the given `property` . If `object` contains no information about `property` , 0 is returned.

#### Parameters

object | a GDataFreebaseTopicObject |
property | a property name contained in `object` |

#### Returns

The number of values contained for `property`

Since 0.15.1

### gdata_freebase_topic_object_get_property_hits ()

    guint64
    gdata_freebase_topic_object_get_property_hits
                                   (const GDataFreebaseTopicObject *object,
                                    const gchar *property);

Returns the total number of hits that the Freebase database stores for this object, this number either equals or is greater than `gdata_freebase_topic_object_get_property_count()`, the query limit can be controlled through `gdata_query_set_max_results()` on the topic query.

If `object` contains no information about `property` , 0 is returned.

#### Parameters

object | a GDataFreebaseTopicObject |
property | a property name contained in `object` |

#### Returns

the total number of hits for this property

Since 0.15.1

### gdata_freebase_topic_object_get_property_value ()

    GDataFreebaseTopicValue *
    gdata_freebase_topic_object_get_property_value
                                   (const GDataFreebaseTopicObject *object,
                                    const gchar *property,
                                    gint64 item);

Gets the value that `object` stores for this `property` /`item` pair, as a generic GDataFreebaseTopicValue. If `object` contains no information about `property` , or `item` is outside the [0..gdata_freebase_topic_object_get_property_count() - 1] range, `NULL` is returned.

#### Parameters

object | a GDataFreebaseTopicObject |
property | a property name contained in `object` |
item | item number to retrieve from `property` |

#### Returns

the value for this property/item.

[allow-none][transfer none]

Since 0.15.1

### gdata_freebase_topic_value_ref ()

    GDataFreebaseTopicValue *
    gdata_freebase_topic_value_ref (GDataFreebaseTopicValue *value);

Creates and returns a new reference on `value` .

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

`value` , with an extra reference.

[transfer full]

Since 0.15.1

### gdata_freebase_topic_value_unref ()

    void
    gdata_freebase_topic_value_unref (GDataFreebaseTopicValue *value);

Removes a reference from `value` . If the reference count drops to 0, the object is freed.

#### Parameters

value | a GDataFreebaseTopicValue. | [transfer full]

Since 0.15.1

### gdata_freebase_topic_value_get_property ()

    const gchar *
    gdata_freebase_topic_value_get_property
                                   (GDataFreebaseTopicValue *value);

Returns the property name that this value describes

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the property name of `value`

Since 0.15.1

### gdata_freebase_topic_value_get_text ()

    const gchar *
    gdata_freebase_topic_value_get_text (GDataFreebaseTopicValue *value);

Returns a textual representation of this value, this is either the value contained transformed to a string, or a concatenation of subvalues for compound types.

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

a textual representation of `value`

Since 0.15.1

### gdata_freebase_topic_value_get_language ()

    const gchar *
    gdata_freebase_topic_value_get_language
                                   (GDataFreebaseTopicValue *value);

Returns the language used in the content of `value`

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the language `value` is written in

Since 0.15.1

### gdata_freebase_topic_value_get_creator ()

    const gchar *
    gdata_freebase_topic_value_get_creator
                                   (GDataFreebaseTopicValue *value);

Returns the Freebase ID of the user that created this value.

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the creator of this value, as a Freebase ID

Since 0.15.1

### gdata_freebase_topic_value_get_timestamp ()

    gint64
    gdata_freebase_topic_value_get_timestamp
                                   (GDataFreebaseTopicValue *value);

Returns the time at which this value was created in the Freebase database. It's a UNIX timestamp in seconds since the epoch. If `value` has no timestamp, -1 will be returned.

#### Parameters

value | GDataFreebaseTopicValue |

#### Returns

The creation time of `value` , or -1

Since 0.15.1

### gdata_freebase_topic_value_get_value_type ()

    GType
    gdata_freebase_topic_value_get_value_type
                                   (GDataFreebaseTopicValue *value);

Returns the GType of the real value held in `value` .

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the GType of the contained value

Since 0.15.1

### gdata_freebase_topic_value_copy_value ()

    void
    gdata_freebase_topic_value_copy_value (GDataFreebaseTopicValue *value,
                                           GValue *gvalue);

Copies in `gvalue` the value held in `value` . the GValue must be later freed through `g_value_unset()`

#### Parameters

value | a GDataFreebaseTopicValue |
gvalue | an empty GValue. | [out caller-allocates][transfer full]

Since 0.15.1

### gdata_freebase_topic_value_get_int ()

    gint64
    gdata_freebase_topic_value_get_int (GDataFreebaseTopicValue *value);

Returns a gint64 value held in `value` . It is only valid to call this if the GType is a `G_TYPE_INT64`

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the gint64 value

Since 0.15.1

### gdata_freebase_topic_value_get_double ()

    gdouble
    gdata_freebase_topic_value_get_double (GDataFreebaseTopicValue *value);

Returns a gdouble value held in `value` . It is only valid to call this if the GType is a `G_TYPE_DOUBLE`

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the gdouble value

Since 0.15.1

### gdata_freebase_topic_value_get_string ()

    const gchar *
    gdata_freebase_topic_value_get_string (GDataFreebaseTopicValue *value);

Returns a string value held in `value` . It is only valid to call this if the GType is a `G_TYPE_STRING`

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the string value

Since 0.15.1

### gdata_freebase_topic_value_get_object ()

    const GDataFreebaseTopicObject *
    gdata_freebase_topic_value_get_object (GDataFreebaseTopicValue *value);

Returns a compound/complex object held in `value` . It is only valid to call this if the GType is a `GDATA_TYPE_FREEBASE_TOPIC_OBJECT`.

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

the compound value as a GDataFreebaseTopicObject.

[transfer none]

Since 0.15.1

### gdata_freebase_topic_value_is_image ()

    gboolean
    gdata_freebase_topic_value_is_image (GDataFreebaseTopicValue *value);

Returns true if `value` holds a freebase image object, on such values it will be valid to call `gdata_freebase_service_get_image()` to get a stream to the image itself.

#### Parameters

value | a GDataFreebaseTopicValue |

#### Returns

Whether `value` holds a Freebase image object

Since 0.15.1

## Types and Values

### GDataFreebaseTopicResult

    typedef struct _GDataFreebaseTopicResult GDataFreebaseTopicResult;

All the fields in the GDataFreebaseTopicResult structure are private and should never be accessed directly.

Since 0.15.1

### GDataFreebaseTopicResultClass

    typedef struct {
    } GDataFreebaseTopicResultClass;

All the fields in the GDataFreebaseTopicResultClass structure are private and should never be accessed directly.

Since 0.15.1

### GDataFreebaseTopicObject

    typedef struct _GDataFreebaseTopicObject GDataFreebaseTopicObject;

Opaque struct containing a Freebase topic object. This object may contain one or more GDataFreebaseTopicValue structs, which may in turn contain nested GDataFreebaseTopicObject structs to express complex data.

Since 0.15.1

### GDataFreebaseTopicValue

    typedef struct _GDataFreebaseTopicValue GDataFreebaseTopicValue;

Opaque struct containing a value of a Freebase topic object. This struct may contain a simple value (integers, doubles, strings...) or complex values, expressed through a GDataFreebaseTopicObject.

Since 0.15.1