Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{color:#000000}The WSO2 Data Services

...

In order to expose relational data in RDF format, you need to configure the relevant data service query accordingly. To start, add a new query to your CSV data service. For instructions on creating a CSV data service, refer to section CSV.

1. Log on to the Data Services Server Management Console.

Image Removed

2.  Click the Main menu and select List under Web Services.

Image Removed

3. The Deployed Services page appears which lists out all the currently active services and service groups.

Image Removed

Click on the data service you want to edit.

4. The dashboard of the data service opens. Click on the Edit Data Service link. In this example, we edit using the management console.

Image Removed

5. Navigate to the Queries page of the data service and click the Add New Query link.

6. The Add New Query page opens.

Since the output is a RDF result set, select output type as RDF from the drop-down list in the Output Mapping section.

RDF Base URI contains the format of rdf:about URI which uniquely identifies each resource. In this example, the RDF base URI is http://www.product/cd/. This takes the value of column 1 of the CSV for each row and replaces it with the RDF about attribute inside rdf:Description element.

...

 Server supports  exposing relational data in RDF (Resource Description Framework) format as a service. In the following example, we demonstrate how a CSV data source can be exposed as a RDF resource.{color}

{color:#000000}In order to expose relational data in RDF format, you need to configure  the relevant data service query accordingly. To start, add a new query to your  CSV data service. For instructions on creating a CSV data service, refer to section{color} {color:#000000}[DSS263:CSV]{color}.

{color:#000000}1. Log on to the{color} {color:#000000}Data Services{color} {color:#000000}Server{color} {color:#000000}Management Console.{color}

!login.png|border=1!

{color:#000000}2. {color} {color:#000000}Click the{color} {color:#000000}{_}Main{_}{color} {color:#000000}menu and select{color} {color:#000000}{_}List{_}{color} {color:#000000}under{color} {color:#000000}{_}Web Services{_}{color}{color:#000000}.{color}

!dss1.PNG|border=1!

{color:#000000}3.{color} {color:#000000}The{color} {color:#000000}{_}Deployed Services{_}{color} {color:#000000}page appears which lists out all the currently active services and service groups.{color}

!dash1.PNG|border=1!

{color:#000000}Click on the data service you want to edit.{color}

{color:#000000}4. The dashboard of the data service opens. Click on the{color} {color:#000000}{_}Edit Data Service{_}{color} {color:#000000}link. In this example, we edit using the management console.{color}

!dash5.png|border=1!

{color:#000000}5. Navigate to the Queries page{color} {color:#000000}of the data service and click the{color} {color:#000000}{_}Add New Query{_}{color} {color:#000000}link{color}{color:#000000}.{color}

{color:#000000}6. The{color} {color:#000000}{_}Add New{_}{color} {color:#000000}{_}Query{_}{color} {color:#000000}page opens.{color}

Since the output is a RDF result set, select output type as RDF from the drop-down list in the Output Mapping section.

_RDF Base URI_ contains the format of rdf:about URI which uniquely identifies each resource. In this example, the _RDF base URI_ takes the value of column 1 of the CSV for each row and replaces it with the RDF about attribute inside rdf:Description element.

*RDF Base URI* :\- [http://www.product/cd/

...

{1}|http://www.product/cd/]
*Row namespace* :\- [http://www.product/cd#

...

]

!step10.png|border=1!

{color:#000000}7. To generate the response in RDF format, click the{color} {color:#000000}{_}Add New Output Mapping{_}{color} {color:#000000}link. The{color} {color:#000000}{_}Add/Edit Output Mapping{_}{color} {color:#000000}window opens.{color}

{color:#000000}There are two mapping types in RDF Output mapping.{color}

* {color:#000000}as an element{color}
* {color:#000000}as a resource{color}

{color:#000000}When mapping an element as a resource, you need to give the resource URI along with the column name which needs to be mapped in curly brackets as shown below. This way we can link two RDF resources together and create a relationship between the two.{color}

!step11.png|border=1!

{color:#000000}8. Once you create the output mappings, go back to the main configuration and save your RDF query.{color}

!step12.png|border=1!