Prev: Web and TV Workshop     Next: HTML Overview

SPARQL Query Language for RDF (accepted 15 January 2008)

Abstract

Resource Description Framework corresponds to the directed, labeled graph data format that is used for the representation of the Internet information. This very option is aimed at the defining of the SPARQL language syntax and semantics that are used in RDF. SPARQL helps to reflect the emerged queries as regards the data sources in the case if this data is stored in the native RDF software or if it is reflected with the help of the RDF middleware. The RDF query language possesses the capabilities for querying required and optional graph patterns. Besides that, SPARQL contains the conjunctions and disjunctions of these patterns. The source RDF graph provides the RDF query language with the ability to support extensible value testing and constraining queries. The results of the RDF language operation are presented with the RDF graphs and the results sets.

Introduction

Resource Description Framework corresponds to the directed, labeled graph data format that is used for the representation of the Internet information. RDF serves the purpose of the supply of the integration means regarding the disparate information sources and the representation of such items as the personal information, social networks and the digital information database scheme. This very option is aimed at the defining of the SPARQL language syntax and semantics that are used in RDF.

Document Conventions

Prefix IRI
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs: http://www.w3.org/2000/01/rdf-schema#
xsd: http://www.w3.org/2001/XMLSchema#
fn: http://www.w3.org/2005/xpath-functions#

Result sets are illustrated in tabular form.

x y z
"Alice" <http://example/a>      

Writing a Simple Query

Hereinafter you can see how it is possible to find the specified book title with the help of the SPARQL query language. There are two integral parts of the query: the select and the where clauses. The select clause is responsible for the search of the variables that are to be received in the result while the where clause causes the hit of the basic graph pattern and the data graph. In this very case, we can see that the basic graph pattern is a single triple pattern that possesses the single variable in the object position.

Data:

<http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> "SPARQL Tutorial" .

Query:

SELECT ?title
WHERE
{
  <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title .
}    

This query, on the data above, has one solution:

Query Result:

title
"SPARQL Tutorial"