Skip to content

Query

Definition

<query name="query_name">

Requests information from an http_service.

Attribute Type Description
name string Required. The name of the predicate that is requesting the information. Should match the name of the corresponding predicate of the invoke_service_query in the domain. Query names are written using lowercase separated by underscores, e.g. 'current_temperature'.

Children

Behaviour

The <query> element in the service interface connects the corresponding <invoke_service_query> element in the domain to a specific service query inside <target>. The target service must be http_service which returns a query response.

Each of the parameters used by the specified <target> must be passed under <parameters>.

Examples

Query a http service about the current temperature in a location

<query name="current_temperature">
  <parameters>
    <parameter predicate="location" format="grammar_entry"/>
  </parameters>
  <target>
    <http endpoint="http://climate-http-service/current_temperature"/>
  </target>
</query>

Last update: December 12, 2022