...
The RDF file (Movies.rdf
), stored in the <EI_HOME>/samples/data-services/resources/
folder contains data about some popular movies. Each movie data has the following sub elements: "title", "director", "year", "genre" and "actor".
...
Log in to the management console of WSO2 EI using the following URL on your browser: "https://localhost:8243/carbon/".
Click Create under the under Data Service menu to to open the Create Data Service window.
Enter RDF as the data service name as shown below. Leave the default values for the other fields.
Click Next to go to the Datasources screen.
Add
...
an RDF file as the datasource
You can add an RDF file as the datasource as explained below.
- Click Add New Datasource and enter values as shown below.
- Follow the instructions below to fill the datasource details.
- Datasource ID: Enter RDF as the ID for the datasource.
- Datasource Type: Select RDF as the datasource type from the list. You can then specify the location of your RDF file: ./samples/data-services/resources/Movies.rdf
- RDF File Location: Enter the path to the RDF file. In this tutorial we are using a sample RDF file that is shipped with your product. The file location is ./samples/data-services/resources/Movies.rdf.
- Save the datasource.
- Click Next to go to the Queries screen.
...
- Click Add New Input Mapping to start creating the input mapping.
- We will create an input mapping for 'genre', which will allow us to query for data based on the genre of the movie. Enter the values as shown below.
- The new input mapping will be listed as shown below.
Info |
---|
Find out more about defining Input Mappings. |
...
- 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 Movies in this field.
- In the Row Name field, specify the XML element that should group each individual result. Enter Movie in this field.
- Click Add New Output Mapping to start creating the output mapping for the title column. Enter values as shown below:
- Click Add to save the output mapping. You will now have one output mapping listed for the GetMoviesbyGenre query as shown below.
Now, add the following output mappings:
Mapping Type Element Name Datasource Type Datasource Column Name Parameter Type Schema Type Element director Column director SCALAR string Element year Column year SCALAR string Element genre Column genre SCALAR string Element actor Column actor SCALAR string
Info |
---|
Find out more about defining Output Mappings. |
...