Versions Compared

Key

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

...

Info

Note:
We use a sample resource hosted online but you can also use one in your local machine. The RDF resource used in this example is hosted by NASA in this URL: http://nasa.dataincubator.org/~search.rdf?query=all

5. Click Save.

5. The added data source page appears. You can edit or delete the Data Source. To proceed click Next.

Image Removed

6. The Queries page appears.

Initially your service does not include any queries. Click on 'Add New Query' to add a new query, input/output mappings, events etc. to your Data Service. Enter query details according to the structure of the response you want.

In the following example, we have usedthis example, we have used the following SPARQL query to extract the specific aircraft information from the data source.

Code Block

PREFIX space: <http://purl.org/net/schemas/space/>
PREFIX relevance: <http://a9.com/-/opensearch/extensions/relevance/1.0/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>

SELECT ?homepage ?name ?alternateName ?internationalDesignator ?mass ?score ?launch ?agency ?description
WHERE {
  ?craft foaf:homepage ?homepage.
  ?craft foaf:name ?name.
  ?craft space:alternateName ?alternateName.
  ?craft space:internationalDesignator ?internationalDesignator.
  ?craft space:mass ?mass.
  ?craft relevance:score ?score.
  ?craft space:launch ?launch.
  ?craft space:agency ?agency.
  ?craft dc:description ?description.
}

The input mapping section is used to specify parameters to the query. The above query extracts aircraft information according to the agency. Therefore, we take agency as an input parameter. Input parameters can be added by clicking Add Input Mappings.

We have also used the Grouped By Element Grouped By Element, Row Name and Row namespace.

Image Removed

7. Once a new query is added, it will be listed as followsClick on Add Output Mappings to map the response to an output XML. Once you have entered the output mapping details, click on Main Configuration and then the Save button.

Image Added

The output mappings:

7. You have added one query to your data service configuration.

...

Click Save once done. For example,

Image RemovedImage Added

9. The operation will be listed in the operations page

Image Removed

10. The Data Service configuration is done. Click Finish. (You can continue to add resources by clicking the Next button if you like)

1110. You will be navigated to the "Deployed services" page.

...