All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Installer experience.

...

Follow the steps given below.

  1. Download the product installer from here, and run the installer.

    Excerpt Include
    Installing the Product
    Installing the Product
    nopaneltrue

  2. Start the ESB profile:

    Panel
    borderColor#542989
    bgColor#ffffff
    borderWidth1
    Localtab Group
    Localtab
    activetrue
    titleOn MacOS/Linux/CentOS

    Open a terminal and execute the following command:

    Code Block
    wso2ei-6.4.0-integrator
    Localtab
    titleOn Windows
    Go to Start Menu -> Programs -> WSO2 -> Enterprise Integrator 6.4.0 Integrator. This will open a terminal and start the ESB profile.
  3. Log in to the product's management console.
  4. Click Data Service → Create, to start creating a data service.
  5. Enter the following name for the data service.

    Data Service NameRDFDataService
  6. Click Next to enter the datasource connection details.

...

  1. Click Add New Query and enter the following details:

    Query IDGetMoviewbyGenreGetMoviebyGenre
    DatasourceRDF
    SPARQL

    In this field, enter the sparql query describing the data that should be retrieved from the RDF datasource. We will use the following query:

    Code Block
    PREFIX cd: <http://www.popular.movies/cd#>
     
    SELECT ?title ?director ?year ?genre ?actor 
    WHERE {   
          ?movie cd:title ?title. 
          ?movie cd:director ?director. 
          ?movie cd:year ?year. 
          ?movie cd:genre ?genre. 
          ?movie cd:actor ?actor.
    }
  2. The input mapping section is used to specify the type of input that should be given in order to get the output result. 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.

    Mapping Namegenre
    Sparql TypeString
  3. Now let's specify output mappings to specify how the data fetched from the query should be displayed. We will create output mappings for all the types of data in the RDF file:  title, director, year, genre and actor. Follow the steps given below.
    1. Start by giving the following information:

      Output typeYou can select XML, JSON or RDF. We will use XMLXML for this tutorial. This specifies the format in which the query results should be presented. 
      Grouped by elementEnter Moview Movies. This will be the XML element that will group the query result.
      Row NameEnter Movie. This is the XML element that should group each individual result.
    2. Click Add New Output Mapping to start creating the output mapping for the title column. 
    3. Click Add to save the output mapping. You will now have one output mapping listed for the GetMoviesbyGenre query.
    4. Now, add the following output mappings:

      Mapping TypeElement NameDatasource TypeDatasource Column NameParameter TypeSchema Type
      ElementtitleColumntitleSCALARstring
      ElementdirectorColumndirectorSCALARstring
      ElementyearColumnyearSCALARstring
      ElementgenreColumngenreSCALARstring
      ElementactorColumnactorSCALARstring
    5. Click Main Configuration to return to the Query screen.
  4. Save the query, and click Next to go to the Operations screen.

...

You can now invoke the data service query using SOAP.

...

Creating a REST resource to invoke the query

Now, let's create REST resources to invoke the query created above. Alternatively, you can create SOAP operations to invoke the queries. See the previous section for instructions.

  1. Click Add New Resource and enter the following information.

    Resource PathMovies/{genre}
    Resource MethodGET
    Query IDGetMoviesbyGenre
  2. Save the resource.

...

Code Block
curl -X GET http://localhost:8280/services/RDFDataService.HTTPEndpoint/Movies/Drama

This will return the response in XML.