Semantic Web Technologies - RDF Tutorial

Theme 1: SPARQL

In this hands-on, what you need to do is writing SPARQL queries to answer following questions defined against the Nobel Prize Laureates from 1901-2016 dataset. You can take a look at the specification here or download the RDF dump data from here. After you have a look at the data, you can go to this SPARQL editor to write your queries to solution following questions.


Theme 2: RDF triple stores

In this hands-on, we will still use Nobel Prize Laureates from 1901-2016 dataset. In addition, we make use of Blazegraph for RDF triple stores. After you download Blazegraph from here. You need to run the jar file though command line.

It will return the address of Blazegraph in your local computer. The address is as follows for example:

Then you can access this server through your browser. The welcome interface of Blazegraph is shown as Fig.1.

Fig.1 Welcome page of Blazegraph

To upload a dataset, you need to click UPDATE in the menu and then click Choose File to choose the dataset in your computer. The upload page is shown as Fig.2.

Fig.2 Update dataset in Blazegraph

After the uploading is finished, you can go to the QUERY menu to write and execute your queries. The query page is shown as Fig.3.

Fig.3 Query in Blazegraph

The last task you need to do in this theme is to re-write the query against question 2 by using full text search. You can check how the full text search works in Blazegraph here.

Fig.4 Namespaces settings in Blazegraph

Theme 3: RDF Publishing

In this hands-on, we will use Pubby to publish the SPARQL endpoint that we create in last theme.

We also need Jetty or Tomcat because Pubby is ran based on a servlet container.

Download latest Pubby version from here and unzip.

If you don't have Tomcat installed in your computer, Jetty is a light option for you. Download latest Jetty version from here and unzip. Then go to the Pubby distribution and copy the webapp directory into Jetty's webapps folder. If Pubby is the only web application you want to run in the container, then rename the webapp directory to root. Otherwise, rename it to something like mydataset. This will change the Pubby root to http://myserver/mydataset/.

If you have Tomcat installed, then you need to copy the webapp directory under Pubby into Tomcat's webapps folder.

Modify the configuration file to suit your needs. It is located within Pubby's webapp directory initially, at /WEB-INF/config.ttl.

 a conf:Configuration;
        # Project name for display in page titles
        conf:projectName value;
        # Homepage with description of the project for the link in the page header, default <>
        conf:projectHomepage value;
        # where the webapp is running inside the servlet container, e.g. http://localhost:8081/SELF_DEFINED_NAME
        conf:webBase value;
        (...)
        conf:dataset [
            # SPARQL endpoint URL of the dataset, e.g. http://192.168.1.100:9999/blazegraph/sparql
            conf:SparqlEndpoint value;
            # common URI prefix of all resource URIs in the SPARQL dataset
            conf:datasetBase value;
            # resource URIs;
            conf:webResourcePrefix "resource/";
        ];
        .
    

Then run Jetty by command (you should take care of the port you are using):

Then you can do URI lookups in your browser. For examples, access following URIs to see what are shown.

In addition you can do URI lookups by using curl command and get result in the format that you want, for example, in RDF/XML or Turtle.