...
- Click Add New Query to open the Add New Query screen.
- Enter the following values:
- Query ID: In this field, enter webquery as the query ID.
- Datasource: In this field, select the datasource for which you are going to write a query. Select the web datasource that you created previously.
- Scrapper Variable: When you add a query to a Web datasource, you must enter a Scraper Variable. This scraper variable must be the same as the output name in the web datasource configuration, which returns the output from the configuration. In this example, the
var-def
name in the configuration isweatherInfo
AppInfo
(<
var-def
name
=
'AppInfo'
>
).
- Define Output Mapping: Now, let's specify how the data fetched from the datasource should be displayed in the output. We will create output mappings for the following data in the web resource: Title and Description.
- In the Output type field, specify the format in which the query results should be presented. You can select XML, JSON or RDF. We will use XML for this tutorial.
- In the Grouped by element field, specify a grouping for all the output mappings. This will be the XML element that will group the query result. Enter AppInfo in this field.
- In the Row Name field, specify the XML element that should group each individual result. Enter App in this field.
- Click Add New Output Mapping to start creating the output mapping for the Title field. Enter values as shown below:
- Click Add to save the output mapping.
Now, add another output mapping for the Description column.
You will now have the following output mappings listed for the webquery query:
Once you have created all the output mappings, click Main Configuration to return to the Edit Query screen.
Info Find out more about defining Output Mappings.
- Click Save, to save the query.
- Click Next to go to the Operations screen.
...