Versions Compared

Key

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

...

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

...

Add

...

an RDF file as the datasource

You can add an RDF file as the datasource as explained below.

  1. Click Add New Datasource and enter values as shown below.
    Image RemovedImage Added
  2. 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.
  3. Save the datasource.
  4. Click Next to go to the Queries screen.

...

  1. Click Add New Input Mapping to start creating the input mapping.
  2. 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.
    Image RemovedImage Added
  3. The new input mapping will be listed as shown below.
    Image RemovedImage Added
Info

Find out more about defining Input Mappings.

...

  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 Movies in this field. 
  3. In the Row Name field, specify the XML element that should group each individual result. Enter Movie in this field.
  4. Click Add New Output Mapping to start creating the output mapping for the title column. Enter values as shown below:
    Image RemovedImage Added
  5. Click Add to save the output mapping. You will now have one output mapping listed for the GetMoviesbyGenre query as shown below.
  6. Now, add the following output mappings:

    Mapping TypeElement NameDatasource TypeDatasource Column NameParameter TypeSchema Type
    ElementdirectorColumndirectorSCALARstring
    ElementyearColumnyearSCALARstring
    ElementgenreColumngenreSCALARstring
    ElementactorColumnactorSCALARstring
Info

Find out more about defining Output Mappings.

...