GData.FreebaseSearchQuery

g GData.FreebaseSearchQuery GData.FreebaseSearchQuery GData.Query GData.Query GData.Query->GData.FreebaseSearchQuery GObject.Object GObject.Object GObject.Object->GData.Query

Subclasses:

None

Methods

Inherited:

GData.Query (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (search_terms)

add_filter (property, value)

add_location (radius, lat, lon)

close_filter ()

get_language ()

get_stemmed ()

open_filter (filter_type)

set_language (lang)

set_stemmed (stemmed)

Virtual Methods

Inherited:

GData.Query (1), GObject.Object (7)

Properties

Inherited:

GData.Query (11)

Name

Type

Flags

Short Description

language

str

d/r/w

Language in ISO-639-1 format. deprecated

stemmed

bool

d/r/w

Whether the search terms should be stemmed deprecated

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GData.Query

r

Class Details

class GData.FreebaseSearchQuery(**kwargs)
Bases:

GData.Query

Abstract:

No

Structure:

GData.FreebaseSearchQueryClass

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

New in version 0.15.1.

classmethod new(search_terms)
Parameters:

search_terms (str) – string to search for

Returns:

a new GData.FreebaseSearchQuery; unref with GObject.Object.unref()

Return type:

GData.FreebaseSearchQuery

Creates a new GData.FreebaseSearchQuery prepared to search for Freebase elements that match the given search_terms. Further filters on the query can be set through GData.FreebaseSearchQuery.add_filter() or GData.FreebaseSearchQuery.add_location().

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

add_filter(property, value)
Parameters:
  • property (str) – Freebase property ID

  • value (str) – match string

Adds a property filter to the query. property filters are always nested in containers, opened and closed through GData.FreebaseSearchQuery.open_filter() and GData.FreebaseSearchQuery.close_filter().

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

add_location(radius, lat, lon)
Parameters:
  • radius (int) – radius in meters

  • lat (float) – latitude

  • lon (float) – longitude

Adds a geolocation filter to the query. location filters are always nested in containers, opened and closed through GData.FreebaseSearchQuery.open_filter() and GData.FreebaseSearchQuery.close_filter().

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

close_filter()

Closes a filter level.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

get_language()
Returns:

The language used on the query.

Return type:

str or None

Gets the language set on the search query, or None if unset.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

get_stemmed()
Returns:

True if the GData.FreebaseSearchQuery performs stemming

Return type:

bool

Returns whether the GData.FreebaseSearchQuery will perform stemming on the search terms.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

open_filter(filter_type)
Parameters:

filter_type (GData.FreebaseSearchFilterType) – filter type

Opens a container of filter rules, those are applied according to the behavior specified by filter_type. Every call to this function must be paired by a call to GData.FreebaseSearchQuery.close_filter().

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

set_language(lang)
Parameters:

lang (str or None) – Language used on the search terms and results, in ISO-639-1 format, or None to unset.

Sets the language used, both on the search terms and the results. If unset, the locale preferences will be respected.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

set_stemmed(stemmed)
Parameters:

stemmed (bool) – True to perform stemming on the search results

Sets whether stemming is performed on the provided search terms. If stemmed is True, words like eg. “natural”, “naturally” or “nature” would be all reduced to the root “natur” for search purposes.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

Property Details

GData.FreebaseSearchQuery.props.language
Name:

language

Type:

str

Default Value:

None

Flags:

DEPRECATED, READABLE, WRITABLE

Language used for search results, in ISO-639-1 format.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.

GData.FreebaseSearchQuery.props.stemmed
Name:

stemmed

Type:

bool

Default Value:

False

Flags:

DEPRECATED, READABLE, WRITABLE

Whether word stemming should happen on the search terms. If this property is enabled, words like eg. “natural”, “naturally” or “nature” would be all reduced to the root “natur” for search purposes.

New in version 0.15.1.

Deprecated since version 0.17.7: Google Freebase has been permanently shut down.