Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Click Add New Query to open the Add New Query screen.
  2. 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 is weatherInfo (< var-def name = 'AppInfo' >).
  3. 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
    1. 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.
    2. 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. 
    3. In the Row Name field, specify the XML element that should group each individual result.  Enter App in this field.
    4. Click Add New Output Mapping to start creating the output mapping for the Title field. Enter values as shown below:
    5. Click Add to save the output mapping. 
    6. Now, add another output mapping for the Description column.

    7. You will now have the following output mappings listed for the webquery query:

    8. 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.

  4. Click Save, to save the query.
  5. Click Next to go to the Operations screen.

...