...
Following sample shows a query written for the RDF data source created in Resource Description Framework, which is based on a RDF resource hosted by NASAthe added RDF file. This sample uses the following SPARQL query to extract aircraft movies information from the data source.
Code Block |
---|
PREFIX spacecd: <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/>www.popular.movies/cd#> SELECT ?homepagetitle ?namedirector ?alternateNameyear ?internationalDesignatorgenre ?mass ?score ?launch ?agency ?description WHERE {actor WHERE { ?craftmovie foafcd:homepagetitle ?homepagetitle. ?craft foaf:name ?name. ?craftmovie spacecd:alternateNamedirector ?alternateNamedirector. ?craft space:internationalDesignator ?internationalDesignator. ?craftmovie spacecd:massyear ?massyear. ?craft relevance:score ?score. ?craftmovie spacecd:launchgenre ?launchgenre. ?craft space:agency ?agency. ?craftmovie dccd:descriptionactor ?descriptionactor. } |
The input mapping section is used to specify parameters to the query. The above query extracts aircraft movie information according to the agencygenre. Therefore, we add agency add genre as an input parameter. Next, the output mappings are used to map the response to an output XML.
Sample 5: Querying a Web data source
...