Skip to content

Invoke Service Query

Definition

<invoke_service_query type="wh_question" predicate="p"/>
<invoke_service_query type="yn_question">
  <proposition predicate="p">
</invoke_service_query>

Calls for an query to be sent to a service.

Attribute Type Description
type string Optional. Defaults to wh_question, but can be one of wh_question, yn_question or kpq.
predicate string Required if type="wh_question". This attribute specifies the predicate of the question sent to the service.
min_results integer Optional. Minimum number of expected results. Defaults to 1.
max_results integer Optional. Maximum number of expected results. Defaults to 1. Use values greater than 1 to accept multi-result queries.

Parents

Children

JSON format

{
  "invoke_service_query": {
    "question": { "wh": { "predicate": "available_animal" } },
    "min_results": 2,
    "max_results": 2
  }
}

Behaviour

An element calls for a query to be sent to a service, which (if successful) returns an answer.

The answer first becomes known to the system, and if the system knows the answer and the question is a goal question, this will trigger the system providing the answer to the user.

If max_results is greater than 1, the service may return multiple results. To store more than one fact for the same predicate, define the predicate with multiple_instances="true" in the ontology.

Examples

Invoke service query for getting the price of a trip.

<invoke_service_query type="wh_question" predicate="price"/>

Invoke service query allowing two or more results

<invoke_service_query type="wh_question" predicate="available_animal" min_results="2" max_results="2"/>

Invoke service query for checking if a person needs a visa.

<invoke_service_query type="yn_question">
  <proposition predicate="need_visa"/>
</invoke_service_query>