2021/4/7 Querying SPARQL on a triple store
Querying SPARQL on a triple store
Start Assignment
Due Monday by 15:00 Points 100 Submitting a file upload File types txt Available 11 Mar at 0:00 – 19 Apr at 23:59 about 1 month
In this assignment you will set up a triple store on your machine to load the linked data Noble Prize Dataset, and you will compose a number of SPARQL queries. The deadline for the assignment is April 12th, 2021 at 3 pm. This assignment contributes 10% of the module’s final mark.
This dataset contains information about the Nobel laureates and their prizes from the creation of the Nobel prize (1901) until 2016. The RDF file with the dump of the dataset (http://www.csc.liv.ac.uk/~valli/nobelprize.nt) (in N-Triple format, size 14.8 Mb) is modelled according to the ontology (schema) specified in the Nobel Prize Linked Data Vocabulary illustrated in the figure below. A full description of the Nobel Linked Data Vocabulary is also available (https://www.nobelprize.org/about/linked-data- documentation/) . For your convenience, here is a fragment of the Nobel Prize data dump, that
describes nobel laureate “Barack H. Obama” (https://liverpool.instructure.com/courses/17158/files/3560896/download? download_frd=1)
For your assignment, you will use Blazegraph DB (https://blazegraph.com) , a ultra high-performance graph database supporting Blueprints and RDF/SPARQL APIs. It supports up to 50 Billion edges on a single machine.
Please download Blazegraph (file blazegraph.jar (https://github.com/blazegraph/database/releases/tag/BLAZEGRAPH_2_1_6_RC) ) from the link provided. Save blazegraph.jar in a folder on your hard disk and navigate to that folder with your command line/terminal; for example using cd on a linux or MacOS platform (cd /Users/valli/COMP318/Assignment for example, in my case on OSX). Run the following command:
java -server -Xmx4g -jar blazegraph.jar
You might have to install java 8 64-bit JDK if you have problems running blazegraph.
If when running Blazegraph you get an “Address already in use” error, it is likely the case that blazegraph has been terminated improperly. Therefore, either restart the terminal session or alternatively try to run this command instead, that changes the port of the blazegraph server:
java -server -Xmx4g -Djetty.port=19999 -jar blazegraph.jar
If Blazegraph has been started successfully, it will report the local Web address where it provides a workspace:
https://liverpool.instructure.com/courses/17158/assignments/97953
1/5
2021/4/7 Querying SPARQL on a triple store
After opening this address in a browser window, you should see the following welcome page.
To load the Nobel dataset, you need to click UPDATE in the menu, which will take you to the upload page. Here you click Choose File to select the dump file of the Nobel dataset that you will have beforehand, and then click the UPDATE button.
https://liverpool.instructure.com/courses/17158/assignments/97953
2/5
2021/4/7 Querying SPARQL on a triple store
Please note that the file “Nobeldump.nt” is too large to be displayed by Blazegraph, but will be uploaded as normal.
After the uploading is finished, you can click QUERY in the menu, which will load the query page where you can write and execute SPARQL queries:
https://liverpool.instructure.com/courses/17158/assignments/97953
3/5
2021/4/7 Querying SPARQL on a triple store
Write the queries in SPARQL that correspond to the following questions:
1. Find all the Nobel prize categories (hint: you might want to look for everything of type nobel:Category);
2. Find the name of the winner of the Nobel Prize in Literature in 1965 (you can access the full name of a nobel prize winner through the foaf:name property);
3. List the names of all the winners of the Nobel Prize in Physics with the year of award, and their date of birth;
4. For all Nobel Prize laureates from 2010, list their name, year of award, date of birth, and date of death if the person has
passed away;
5. Find all the Nobel laureates who are either from Italy or Spain. Hint: the place of birth is identified by a URI, but its name will
appear as the object of an rdfs:label property;
6. Verify if there are any female noble prize winners who are from Belgium. Hint: the gender of a laureate can be accessed by
using the foaf:gender property;
7. Find the name of most recent Nobel laureate for Medicine (hint: the category to use is Physiology_or_Medicine) in the
dataset;
8. Find the categories awarded during the first edition of the Nobel prize (1901);
9. List, in ascending order of number of prizes, the countries who have Chemistry prize winners affiliated to one of their
universities;
10. Find all the Nobel laureates, with the year of the award, who were born either in Germany (present but not at the time of their
birth) or in a country that is now known as Germany (Hint: a country now known as Germany contains the string “now_Germany”.
For your convenience, here is a list of the namespaces used in the Nobel dataset. You can change the abbreviations to what is most convenient for you:
https://liverpool.instructure.com/courses/17158/assignments/97953
4/5
2021/4/7 Querying SPARQL on a triple store
PREFIX dbpedia-owl:
PREFIX yago:
PREFIX meta:
PREFIX rdfs:
PREFIX d2r:
PREFIX owl:
PREFIX xsd:
PREFIX dbpprop:
PREFIX skos:
You should submit a text file (.txt) with the queries and the corresponding results generated by Blazegraph.
https://liverpool.instructure.com/courses/17158/assignments/97953
5/5