XesamGQueryToken

XesamGQueryToken — Enum and utilities for modelling a Xesam query

Synopsis

enum                XesamGQueryToken;
const gchar*        xesam_g_query_token_get_name        (XesamGQueryToken tok);
XesamGQueryToken    xesam_g_query_token_parse           (const gchar *elt);
gboolean            xesam_g_query_token_is_query_type   (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_field_type   (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_value_type   (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_clause_type  (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_selector_type
                                                        (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_collector_type
                                                        (XesamGQueryToken tok);
gboolean            xesam_g_query_token_is_extension_type
                                                        (XesamGQueryToken tok);

Description

XesamGQueryToken is an enumeration that can be used to model the elements of a Xesam query.

This enumeration has an embedded type hierarchy, such that strings, intergers, booleans, and floats all can be regarded as subtypes of a value type. Likewise the individual clauses defined by the Xesam Query Language are also grouped into collectors and selectors.

Details

enum XesamGQueryToken

typedef enum  {
	XESAM_G_QUERY_TOKEN_NONE,
	
	XESAM_G_QUERY_TOKEN_REQUEST,
	
	/* Query token types */
	XESAM_G_QUERY_TOKEN_QUERY_FIRST,
	XESAM_G_QUERY_TOKEN_USER_QUERY,
	XESAM_G_QUERY_TOKEN_QUERY,
	XESAM_G_QUERY_TOKEN_QUERY_LAST,

	/* Field token types */
	XESAM_G_QUERY_TOKEN_FIELD_FIRST,
	XESAM_G_QUERY_TOKEN_FIELD,
	XESAM_G_QUERY_TOKEN_FULL_TEXT_FIELDS,
	XESAM_G_QUERY_TOKEN_FIELD_LAST,

	/* Value token types */
	XESAM_G_QUERY_TOKEN_VALUE_FIRST,
	XESAM_G_QUERY_TOKEN_STRING,
	XESAM_G_QUERY_TOKEN_INTEGER,
	XESAM_G_QUERY_TOKEN_BOOLEAN,
	XESAM_G_QUERY_TOKEN_FLOAT,
	XESAM_G_QUERY_TOKEN_DATE,
	XESAM_G_QUERY_TOKEN_VALUE_LAST,

	/* Collectors, Selectors,
	 * and Extensions are Clause sub-types. Everything until
	 * XESAM_G_QUERY_TOKEN_CLAUSE_LAST is considered a clause sub-type */
	XESAM_G_QUERY_TOKEN_CLAUSE_FIRST,
	
	/* Collectors (clause subtype) */
	XESAM_G_QUERY_TOKEN_COLLECTOR_FIRST,
	XESAM_G_QUERY_TOKEN_AND,
	XESAM_G_QUERY_TOKEN_OR,
	XESAM_G_QUERY_TOKEN_COLLECTOR_LAST,
	
	/* Selectors (clause subtype). All query language extensions
	 * are also selector sub-types */
	XESAM_G_QUERY_TOKEN_SELECTOR_FIRST,
	XESAM_G_QUERY_TOKEN_EQUALS,
	XESAM_G_QUERY_TOKEN_CONTAINS,
	XESAM_G_QUERY_TOKEN_LESS_THAN,
	XESAM_G_QUERY_TOKEN_LESS_THAN_EQUALS,
	XESAM_G_QUERY_TOKEN_GREATER_THAN,
	XESAM_G_QUERY_TOKEN_GREATER_THAN_EQUALS,
	XESAM_G_QUERY_TOKEN_STARTS_WITH,
	XESAM_G_QUERY_TOKEN_IN_SET,
	XESAM_G_QUERY_TOKEN_FULL_TEXT,
	
	/* Extensions. All extensions are also selectors */
	XESAM_G_QUERY_TOKEN_EXTENSION_FIRST,
	XESAM_G_QUERY_TOKEN_PROXIMITY,
	XESAM_G_QUERY_TOKEN_REG_EXP,
	XESAM_G_QUERY_TOKEN_CATEGORY,
	XESAM_G_QUERY_TOKEN_EXTENSION_LAST,
	
	/* End selector types */
	XESAM_G_QUERY_TOKEN_SELECTOR_LAST,
	
	/* End of clause subtypes */
	XESAM_G_QUERY_TOKEN_CLAUSE_LAST
	
} XesamGQueryToken;

XESAM_G_QUERY_TOKEN_NONE

An unset or non-existing token

XESAM_G_QUERY_TOKEN_REQUEST

XESAM_G_QUERY_TOKEN_QUERY_FIRST

XESAM_G_QUERY_TOKEN_USER_QUERY

XESAM_G_QUERY_TOKEN_QUERY

XESAM_G_QUERY_TOKEN_QUERY_LAST

XESAM_G_QUERY_TOKEN_FIELD_FIRST

XESAM_G_QUERY_TOKEN_FIELD

XESAM_G_QUERY_TOKEN_FULL_TEXT_FIELDS

XESAM_G_QUERY_TOKEN_FIELD_LAST

XESAM_G_QUERY_TOKEN_VALUE_FIRST

XESAM_G_QUERY_TOKEN_STRING

XESAM_G_QUERY_TOKEN_INTEGER

XESAM_G_QUERY_TOKEN_BOOLEAN

XESAM_G_QUERY_TOKEN_FLOAT

XESAM_G_QUERY_TOKEN_DATE

XESAM_G_QUERY_TOKEN_VALUE_LAST

XESAM_G_QUERY_TOKEN_CLAUSE_FIRST

XESAM_G_QUERY_TOKEN_COLLECTOR_FIRST

XESAM_G_QUERY_TOKEN_AND

XESAM_G_QUERY_TOKEN_OR

XESAM_G_QUERY_TOKEN_COLLECTOR_LAST

XESAM_G_QUERY_TOKEN_SELECTOR_FIRST

XESAM_G_QUERY_TOKEN_EQUALS

XESAM_G_QUERY_TOKEN_CONTAINS

XESAM_G_QUERY_TOKEN_LESS_THAN

XESAM_G_QUERY_TOKEN_LESS_THAN_EQUALS

XESAM_G_QUERY_TOKEN_GREATER_THAN

XESAM_G_QUERY_TOKEN_GREATER_THAN_EQUALS

XESAM_G_QUERY_TOKEN_STARTS_WITH

XESAM_G_QUERY_TOKEN_IN_SET

XESAM_G_QUERY_TOKEN_FULL_TEXT

XESAM_G_QUERY_TOKEN_EXTENSION_FIRST

XESAM_G_QUERY_TOKEN_PROXIMITY

XESAM_G_QUERY_TOKEN_REG_EXP

XESAM_G_QUERY_TOKEN_CATEGORY

XESAM_G_QUERY_TOKEN_EXTENSION_LAST

XESAM_G_QUERY_TOKEN_SELECTOR_LAST

XESAM_G_QUERY_TOKEN_CLAUSE_LAST


xesam_g_query_token_get_name ()

const gchar*        xesam_g_query_token_get_name        (XesamGQueryToken tok);

tok :

The token to look up the name for

Returns :

The Xml element name used in the Xesam Query Language version 1.0 for the token. The returned string should not be freed or manipulatied

xesam_g_query_token_parse ()

XesamGQueryToken    xesam_g_query_token_parse           (const gchar *elt);

elt :

Name of element from the Xesam Query Language version 1.0

Returns :

The XesamGQueryToken corresponding to the element. If elt does not correspond to any element in the Xesam Query Language XESAM_G_QUERY_TOKEN_NONE is returned

xesam_g_query_token_is_query_type ()

gboolean            xesam_g_query_token_is_query_type   (XesamGQueryToken tok);

tok :

The token to inspect

Returns :

TRUE if and only if tok is a XESAM_G_QUERY_TOKEN_QUERY or XESAM_G_QUERY_TOKEN_USER_QUERY

xesam_g_query_token_is_field_type ()

gboolean            xesam_g_query_token_is_field_type   (XesamGQueryToken tok);

tok :

The token to inspect

Returns :

TRUE if and only if tok is a XESAM_G_QUERY_TOKEN_FIELD or XESAM_G_QUERY_TOKEN_FULL_TEXT_FIELDS

xesam_g_query_token_is_value_type ()

gboolean            xesam_g_query_token_is_value_type   (XesamGQueryToken tok);

tok :

The token to inspect

Returns :

TRUE if and only if tok is a XESAM_G_QUERY_TOKEN_STRING, XESAM_G_QUERY_TOKEN_INTEGER, XESAM_G_QUERY_TOKEN_BOOLEAN, or XESAM_G_QUERY_TOKEN_FLOAT. Note that date and URLs from the Xesam ontology is treated as strings



xesam_g_query_token_is_collector_type ()

gboolean            xesam_g_query_token_is_collector_type
                                                        (XesamGQueryToken tok);

tok :

The token to inspect

Returns :

TRUE if and only if tok is one of XESAM_G_QUERY_TOKEN_AND or XESAM_G_QUERY_TOKEN_OR

xesam_g_query_token_is_extension_type ()

gboolean            xesam_g_query_token_is_extension_type
                                                        (XesamGQueryToken tok);

Note that this method will only detect query language extensions that are expressed as clause types. Other extensions to the Xesam Query Language exist as attributes on the string element.

You can inspect which query language extensions the search engine supports by reading the session property "vendor-extensions".

tok :

The token to inspect

Returns :

TRUE if and only if tok is one of XESAM_G_QUERY_TOKEN_PROXIMITY, XESAM_G_QUERY_TOKEN_REG_EXP, or XESAM_G_QUERY_TOKEN_CATEGORY,