invoke_service_query¶
Calls the Service Interface query associated with a question and makes its answer available to the dialogue.
Attributes and children¶
| Attribute | Default | Meaning |
|---|---|---|
type | wh_question | Question type: goal, wh_question, kpq, alt_question, or yn_question. |
predicate | — | Required for a predicate-backed WH question. |
min_results | 1 | Minimum number of expected results. |
max_results | 1 | Maximum number of expected results; set above one to accept multiple results. |
A yes/no question can use a proposition child; a KPQ uses embedded_question; an alternative question uses alt children. The item can appear in a plan, postplan, or conditional branch.
Behavior and usage¶
The service query returns an answer that becomes known to the system. If the question is a goal question and the answer is known, the system can provide the answer to the user. When max_results is greater than one, the service may return multiple results. Declare the queried ontology predicate with multiple_instances="true" if more than one fact for that predicate must be retained.
Examples¶
WH query:
Allow two results:
<invoke_service_query type="wh_question" predicate="available_animal"
min_results="2" max_results="2"/>
Yes/no query:
<invoke_service_query type="yn_question">
<proposition predicate="need_visa"/>
</invoke_service_query>
KPQ form:
<invoke_service_query type="kpq">
<embedded_question type="wh_question" predicate="destination"/>
</invoke_service_query>
See Service Interface queries and Findout.