next up previous contents
Next: Header Up: Corese RDF Query and Previous: Introduction   Contents

RDF Query Language

Corese provides an RDF Query Language based on a triple syntax. The kernel of the language is the same as that of the SPARQL W3C RDF Query Language [18]. In addition, Corese query language offers some original statements among which approximate search that find best matches according to the RDF Schema, sort, group, path patterns.

The processor of the query language is the conceptual graph projection. It takes advantage of RDF Schema by using subsumption relations (rdfs:subClassOf and rdfs:subPropertyOf) and processes datatype values (i.e. not the lexical form). It also exploits property signature (domain and range). The query language can query the RDF schema itself.

The Corese query language is built upon the RDF triple model: a query is either a triple or a boolean combination of triples. For instance the following query retrieves all the persons (line 1) with their names (line 2) who are authors (line 3) of a thesis (line 4), and it returns their thesis title (line 5):

 (1) ?p rdf:type kmp:Person
 (2) ?p kmp:name ?n
 (3) ?p kmp:author ?doc
 (4) ?doc rdf:type kmp:Thesis
 (5) ?doc kmp:Title ?t

The first element of a Corese triple is either a variable or a resource qualified name (an XML qname); the third element is either a variable, a value or a resource qname; the second element is either a property qname, a variable or a comparison operator.

Variable names begin with a question mark: ?.

By default, triples are related by boolean AND but one can also use boolean OR and parenthesis to group expressions. Each triple represents a query triple, i.e. a triple that must be found in the target graph.

There are three kinds of query triples :

A query may have several results in the target graph. We use the term projection or solution to denote a simple solution, i.e. a binding for each resource and each property of the query. We use the term result to denote either a solution or the merge of several solutions according to a criteria (see group and merge). The answer to a query is a set of results (that may be a set of solutions if there is no group).


next up previous contents
Next: Header Up: Corese RDF Query and Previous: Introduction   Contents
Olivier Corby 2005-07-01