Package Classes (0.10.12)

Summary of entries of Classes for dataqna.

Classes

AutoSuggestionServiceAsyncClient

This stateless API provides automatic suggestions for natural language queries for the data sources in the provided project and location.

The service provides a resourceless operation suggestQueries that can be called to get a list of suggestions for a given incomplete query and scope (or list of scopes) under which the query is to be interpreted.

There are two types of suggestions, ENTITY for single entity suggestions and TEMPLATE for full sentences. By default, both types are returned.

Example Request:

::

GetSuggestions({ parent: "locations/us/projects/my-project" scopes: "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table" query: "top it" })

The service will retrieve information based on the given scope(s) and give suggestions based on that (e.g. "top item" for "top it" if "item" is a known dimension for the provided scope).

::

suggestions { suggestion_info { annotated_suggestion { text_formatted: "top item by sum of usd_revenue_net" markups { type: DIMENSION start_char_index: 4 length: 4 } markups { type: METRIC start_char_index: 19 length: 15 } } query_matches { start_char_index: 0 length: 6 } } suggestion_type: TEMPLATE ranking_score: 0.9 } suggestions { suggestion_info { annotated_suggestion { text_formatted: "item" markups { type: DIMENSION start_char_index: 4 length: 2 } } query_matches { start_char_index: 0 length: 6 } } suggestion_type: ENTITY ranking_score: 0.8 }

AutoSuggestionServiceClient

This stateless API provides automatic suggestions for natural language queries for the data sources in the provided project and location.

The service provides a resourceless operation suggestQueries that can be called to get a list of suggestions for a given incomplete query and scope (or list of scopes) under which the query is to be interpreted.

There are two types of suggestions, ENTITY for single entity suggestions and TEMPLATE for full sentences. By default, both types are returned.

Example Request:

::

GetSuggestions({ parent: "locations/us/projects/my-project" scopes: "//bigquery.googleapis.com/projects/my-project/datasets/my-dataset/tables/my-table" query: "top it" })

The service will retrieve information based on the given scope(s) and give suggestions based on that (e.g. "top item" for "top it" if "item" is a known dimension for the provided scope).

::

suggestions { suggestion_info { annotated_suggestion { text_formatted: "top item by sum of usd_revenue_net" markups { type: DIMENSION start_char_index: 4 length: 4 } markups { type: METRIC start_char_index: 19 length: 15 } } query_matches { start_char_index: 0 length: 6 } } suggestion_type: TEMPLATE ranking_score: 0.9 } suggestions { suggestion_info { annotated_suggestion { text_formatted: "item" markups { type: DIMENSION start_char_index: 4 length: 2 } } query_matches { start_char_index: 0 length: 6 } } suggestion_type: ENTITY ranking_score: 0.8 }

QuestionServiceAsyncClient

Service to interpret natural language queries. The service allows to create Question resources that are interpreted and are filled with one or more interpretations if the question could be interpreted. Once a Question resource is created and has at least one interpretation, an interpretation can be chosen for execution, which triggers a query to the backend (for BigQuery, it will create a job). Upon successful execution of that interpretation, backend specific information will be returned so that the client can retrieve the results from the backend.

The Question resources are named projects/*/locations/*/questions/*.

The Question resource has a singletion sub-resource UserFeedback named projects/*/locations/*/questions/*/userFeedback, which allows access to user feedback.

QuestionServiceClient

Service to interpret natural language queries. The service allows to create Question resources that are interpreted and are filled with one or more interpretations if the question could be interpreted. Once a Question resource is created and has at least one interpretation, an interpretation can be chosen for execution, which triggers a query to the backend (for BigQuery, it will create a job). Upon successful execution of that interpretation, backend specific information will be returned so that the client can retrieve the results from the backend.

The Question resources are named projects/*/locations/*/questions/*.

The Question resource has a singletion sub-resource UserFeedback named projects/*/locations/*/questions/*/userFeedback, which allows access to user feedback.

AnnotatedString

Describes string annotation from both semantic and formatting perspectives. Example:

User Query:

top countries by population in Africa

0 4 14 17 28 31 37

Table Data:

  • "country" - dimension
  • "population" - metric
  • "Africa" - value in the "continent" column

text_formatted = "top countries by population in Africa"

html_formatted = "top <b>countries</b> by <b>population</b> in <i>Africa</i>"

::

markups = [ {DIMENSION, 4, 12}, // 'countries' {METRIC, 17, 26}, // 'population' {FILTER, 31, 36} // 'Africa' ]

Note that html formattings for 'DIMENSION' and 'METRIC' are the same, while semantic markups are different.

SemanticMarkup

Semantic markup denotes a substring (by index and length) with markup information.

SemanticMarkupType

Semantic markup types.

BigQueryJob

BigQuery job information. This can be used to query the BigQuery API and retrieve the current job's status (using jobs.get <https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs/get>__).

CreateQuestionRequest

Request to create a question resource.

DataQuery

Representation of the data query for the backend. This is provided for informational purposes only. Clients should not use it to send it to the backend directly, but rather use the execute RPC to trigger the execution. Using the execute RPC is needed in order to track the state of a question and report on it correctly to the data administrators.

DebugFlags

Configuriation of debug flags.

ExecuteQuestionRequest

Request to execute an interpretation.

ExecutionInfo

Information about the backend status (such as BigQuery) of the execution.

JobExecutionState

Enum of possible job execution statuses.

GetQuestionRequest

A request to get a previously created question.

GetUserFeedbackRequest

Request to get user feedback.

HumanReadable

Human readable interpretation.

InterpretEntity

Query entities of an interpretation.

InterpretError

Details on the failure to interpret the question.

InterpretAmbiguityDetails

Details about a query that was too ambiguous. Currently, the message has no fields and its presence signals that there was ambiguity.

InterpretErrorCode

The interpret error code provides an error category why the interpretation failed.

InterpretErrorDetails

Details on interpretation failure.

InterpretIncompleteQueryDetails

Details about an incomplete query.

InterpretUnsupportedDetails

Details about unsupported parts in a query.

Interpretation

An interpretation of a natural language query.

InterpretationStructure

Information about the interpretation structure that helps to understand and visualize the response.

ColumnInfo

Information about a column.

VisualizationType

Enumeration of visualzation types to use for query response data.

Question

The question resource represents a natural language query, its settings, understanding generated by the system, and answer retrieval status. A question cannot be modified.

SuggestQueriesRequest

Request for query suggestions.

SuggestQueriesResponse

Response to SuggestQueries.

Suggestion

A suggestion for a query with a ranking score.

SuggestionInfo

Detailed information about the suggestion.

MatchInfo

MatchInfo describes which part of suggestion matched with data in user typed query. This can be used to highlight matching parts in the UI. This is different from the annotations provided in annotated_suggestion. The annotated_suggestion provides information about the semantic meaning, while this provides information about how it relates to the input.

Example: user query: top products

::

annotated_suggestion { text_formatted = "top product_group" html_formatted = "top product_group" markups { {type: TEXT, start_char_index: 0, length: 3} {type: DIMENSION, start_char_index: 4, length: 13} } }

query_matches { { start_char_index: 0, length: 3 } { start_char_index: 4, length: 7} }

SuggestionType

The type of suggestion.

UpdateUserFeedbackRequest

Request to updates user feedback.

UserFeedback

Feedback provided by a user.

UserFeedbackRating

Enumeration of feedback ratings.