Skip to 0 minutes and 5 secondsBARRY NORTON: This week, we'll start to talk about how we query, that's how we retrieve, knowledge that's being represented in linked data. This brings us on to a language called SPARQL, which is the query language specifically for RDF. In this week we will concentrate on those features of SPARQL, which will be most familiar to people who've seen querying over other longer standing databases. So in particular, what it has in common with SQL or SQL, and also with no SQL querying. SPARQL queries are useful because of some of the advantages of RDF. The first one is that RDF models knowledge in terms of relationships between things. So increasingly in current IT context, relationship-oriented exploration of data is very important.

Skip to 0 minutes and 56 secondsAnd SPARQL immediately lends itself to that, and it is a graph query language. In the second place, RDF has the advantage of being able to integrate different data sets from different sources easily. So by learning to query RDF using SPARQL, we can make queries that span data sets from different places without some of the traditional data integration woes. The introductory material on SPARQL this week will give learners an idea of how to query interlinked data using SPARQL. But also what this means in terms of building applications, so most applications on the web and off the web are about bringing together and enriching knowledge, but also being able to pick out the right knowledge for a user context.

Skip to 1 minute and 42 secondsAnd it's that form of drawing out knowledge in a query which SPARQL will allow over linked data applications. During this course, we've split up the material on querying with SPARQL into two parts. The first part is typified by the ASK and the SELECT query. ASK queries allow us to form a pattern of knowledge that we're looking for and simply to find out from a database or a knowledge source whether that pattern is represented or not. The SELECT query retrieves exactly those resources that lead to the patterns being matched, and they represent that in the form of a table.

Skip to 2 minutes and 18 secondsAnd SELECT queries then allow manipulation of that table to understand the results in a form that will be familiar from SQL and from NoSQL queries. When we have results as a table, there are manipulations that we can do to those results to fit our application needs. In particular, we might look at it in terms of columns where we can project to which columns we're interested in. We can manipulate it in terms of rows. We can filter to just those rows that fulfil certain requirements. Or we can do grouping operations about rows and say certain things belong together and what we want to know is an aggregate of those rows together, which might be arithmetic or string-based or sampling.

Skip to 3 minutes and 1 secondIn the second part of our coverage of SPARQL, we'll concentrate more on graph-oriented queries. So in common with SELECT and ASK queries, we'll form graph patterns that we're looking for, patterns over the graph that represent our knowledge. But what we return to the user is a graph itself, the result set will be a graph. In the DESCRIBE query and the simple form of a CONSTRUCT query, what we're doing is retrieving subgraphs of the stored graph, but CONSTRUCT also allows us to form more complex queries, where based on the resources that match the patterns that we've expressed, we can recombine those resources into new graphs using new representations of relationships and classifications.

Welcome to Week 2

In this video, Dr Barry Norton introduces you to the content of the two following weeks.

Over the next two weeks you will learn SPARQL, the query language with which we can retrieve and operate data represented in RDF. This week will be focused on the data retrieval: we will learn how to formulate ASK and SELECT queries, and how to organise the results of such queries.

Share this video:

This video is from the free online course:

Introduction to Linked Data and the Semantic Web

University of Southampton

Get a taste of this course

Find out what this course is like by previewing some of the course steps before you join: