W3C

BRQL - A Query Language for RDF

Version:
archival draft ($Revision: 1.18 $ of $Date: 2006/05/02 11:57:03 $)
obsoleted by
BRQL draft started 2004/07/14 05:33:29
Editor:
Eric Prud'hommeaux, W3C, eric@w3.org
Andy Seaborne, HPLabs, Bristol

Abstract

This document describes the Bristol RDF Query Language, or BRQL (pronounced 'burkol'),  designed to meet the requirements and design objectives described in the W3C RDF Data Access Working Group (DAWG) document RDF Data Access Use Cases and Requirements (and its working version).  This query language is based on RDQL Member Submission.

Status of This document

This document was produced under the 5 February 2004 W3C Patent Policy. The Working Group maintains a public list of patent disclosures relevant to this document; that page also includes instructions for disclosing [and excluding] a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) with respect to this specification should disclose the information in accordance with section 6 of the W3C Patent Policy.


Table of contents

  1. Introduction
  2. Description
  3. Comparison with RDQL
  4. Grammar
  5. Test Cases
  6. Correlation to DAWG UC&R
  7. References and Resources

Documents


1. Introduction

BRQL is an extension of RDQL which has been implemented in a number of RDF systems for extracting information from RDF graphs. This extension is designed to meet the requirements and design objectives specified by the W3C RDF Data Access Working Group in their RDF Data Access Use Cases and Requirements document.

RDQL itself is an evolution from several languages and including ideas described in [6]. See [1] for the original paper about three similar query languages, together with some history and context.  See [2] for a comprehensive survey of many RDF query languages (and also rule systems) and [3] for a number of use case with examples in several languages.

2. Description

This section is a non-normative description of BRQL with examples.  It is not a tutorial (see the [4] Jena RDQL tutorial) but a quick description of the key elements of the query language. The @@@ and grammar, given later, is normative.

An RDF [8] model is graph, often expressed as a set of triples.  An RDQL consists of a graph pattern, expressed as a list of triple patterns.  Each triple pattern is comprised of named variables and RDF values (URIs and literals).  An RDQL query can additionally have a set of constraints on the values of those variables, and a list of the variables required in the answer set.

Example 1:

SELECT ?x
WHERE (?x,  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,
                                   <http://xmlns.com/foaf/0.1/Person>)

This triple pattern matches all statements in the graph that have predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type and object http://example.com/someType.  The variable "?x" will be bound to the label of the subject resource.  All such "x" are returned (strictly, "x" is the variable name, "?" introduces a variable but is not part if its name).

An RDQL query treats an RDF graph purely as data. If the implementation of that graph provides inferencing to appear as "virtual triples" (i.e. triples that appear in the graph but are not in the ground facts) then an RDQL will include those triples as possible matches in triple patterns. RDQL makes no distinction between inferred triples and ground triples.

The terms quoted by "<>" are URIrefs.  Other RDF values are literals which, following N-Triples syntax [7], are a string and optional language tag (introduced with '@') and datatype URI (introduced by '^^').  URIrefs can also abbreviated with an XML QName-like form; this is syntactic assistance and is translated to the full URIref.

The example query above had just one triple pattern forming a single edge in the graph pattern. More complicated graph patterns are made by writing all the edges in the query. Like RDF, these are interpreted conjunctively – all of them must match for a result to be added to the result set of the query. This may mean that variables are used to link together triple patterns.

Example 2:

SELECT ?given, ?family
WHERE  (?vcard  vcard:FN "Alice Antwerp")
       (?vcard  vcard:N  ?name)
       (?name   vcard:Family  ?family)
       (?name   vcard:Given  ?given)
USING  vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>

This query, based on the vCard vocabulary [9], finds the family name and given name from any vcards with formatted name (FN) "John Smith".  The vCard vocabulary has a structured value for the name, using the vcard:N property to point to another node in the RDF graph.  This node, in turn, has the various name elements as further statements. This intermediate node can be a blank node (an RDF node without a URIref in this RDF graph).

We have used the prefix 'vcard' to abbreviate the URI or URIref.  Writing the full URI or writing the abbreviated form is the same query as RDF only deals with full URIrefs.

We have used a comma to separate the variables in the SELECT clause.  Commas in queries in triple patterns or in places where lists of items occur are optional and the application writer can choose to use them or not for readability and personal style.

Example 3:

SELECT ?name
WHERE (?who info:age ?age)
      (?who vcard:FN ?name)
AND ?age >= 30
USING info FOR <http://example.org/peopleInfo#>, 
      vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>

In this example, there is a constraint to restrict the object value of the matched statements.

Example 4:

SELECT ?resource
FROM   <http://example.org/someWebPage>
WHERE  (?resource info:age ?age)
AND    ?age >= 30
USING  info FOR <http://example.org/peopleInfo#>

In this example, the source of the data to be queried is supplied.

Where not supplied, it is the responsibility of the execution environment to associate the query with the RDF graph to be queried. Such mechanisms are outside the scope of this note.

3. Comparison with RDQL

BRQL includes several features taken from existing RDQL implementations or other query lanaguges. With the exception of non-existent triple testing and filter functions, all features have been implemented somewhere.

  1. SELECT DISTINCT; SELECT LIMIT
  2. New result form: DESCRIBE
  3. New result form: CONSTRUCT
  4. Triple source identification (sometimes known as "quads")
  5. Optional triple matching
  6. Non-existent triple testing
  7. Filter functions on values

3.1. Result forms

SELECT

In addition to the existing RDQL form, "SELECT", there are additional modifiers DISTINCT and LIMIT

DESCRIBE

Form:

DESCRIBE ?var1 ?var2 ... WHERE ...

Example:

DESCRIBE ?x WHERE (?x rdf:type foaf:Person) (?x foaf:mbox_sha1sum "ABCD1234")
DESCRIBE ?x, ?y WHERE (?x ns:marriedTo ?y)
DESCRIBE <http://example.org/>

The DESCRIBE form returns a single RDF graph that the server deems describes the resource.  The exact nature of the returned graph depends on what the publisher decides meets a useful "description" of the binding of the variables mentioned in the DESCRIBE clause.  Explicit variable bindings are not returned.

The graph is formed by describing the resource for each possible binding of the variables.  One such description algorithm is to form the bNode closure.

Example Description

A simple query such as

DESCRIBE ?x WHERE (?x ent:employeeId	"1234")

might return a descrription of the employee and some other potentially useful details:

@prefix vcard: 	<...> .
@prefix myOrg:   <...> .

<x>   myOrg:employeeId    "1234" ;
      foaf:mbox_sha1sum   "ABCD1234" ;
      vcard:N
       [ vcard:Family       "Smith" ;
         vcard:Given        "John" ; ] .

foaf:mbox_sha1sum  rdf:type  owl:InverseFunctionalProperty .

which includes the bNode closure for the vcard vocabulary vcard:N and vcard:ORG statements. For a vocabulary such as FOAF, where the data is typically all bNodes, returning sufficient information to identify a node such as the  inverseFunctionProperty foaf:mbox_sha1sum as well information which as name and other details recorded would be appropriate. In the example, the match to the WHERE clause was returned but this is not required. Also, in the returned graph is information about one of the properties.

CONSTRUCT

Form:

CONSTRUCT {construct pattern} WHERE {query pattern}
CONSTRUCT * WHERE {query pattern}

Example:

CONSTRUCT (?x rdf:type ns:Class5) WHERE (?x ns:prop 5) USING . . . 

The CONSTRUCT form returns a single RDF graph formed as the union of the construct pattern with variable values obtained from each matching of the query pattern.  Explicit variable bindings are not returned.

The form CONSTRUCT * WHERE {query pattern} is shorthand for CONSTRUCT {pattern} WHERE {pattern}, that is, the query pattern is the same as the construct pattern.

3.2. Triple Matching Features

Triple source

Form:

 SOURCE ?source (?s ?p ?o)

Example:

SELECT ?x, ?src WHERE
    SOURCE ?src (?x rdf:type ns:Engineer)
    (?x ns:skill "RDF")

The SOURCE clause added to a triple pattern causes the variable or literal to match or bind the RDF graph which the statement came from, if the server knows. If it does not have a source identifier for triple, ?src is bound to null; if a constant is provided in the SOURCE term and there is no known source, the triple pattern still matches.

This is often implemented as the more compact and intuitive (?s ?p ?o ?src) quad.  We use the explicit keyword only to highlight it as an additional feature.

Optional Patterns

Form:

OPTIONAL {pattern}

Example:

SELECT *
WHERE     (?x  foaf:mbox_sha1sum "ABCD1234")
          (?x  foaf:name         ?name)
OPTIONAL  (?x  foaf:nick         ?nick)
OPTIONAL  (?x  foaf:family_name  ?fname)  // Get ?fname and ?gname together
          (?x  foaf:givenName    ?gname)

For each OPTIONAL clause, the query processor attempts to match the query pattern.  Failure to match does not cause this query solution to be rejected. All triples patterns of a single OPTIONAL clause must match.   Multiple OPTIONAL clauses are allowed and can fail or cause bindings independently.

Non-Existence of Triples

Form:

NOT (?s ?p ?o)

Example:

SELECT ?x
WHERE      (?x rdf:type foaf:Person)
       NOT (?x foaf:foaf:family_name "Smith")
           (?x foaf:foaf:first_name "John")

When a query processor encounters a NOT modifier, a query result is rejected if there is a RDF statement in the RDF graph that matches the pattern. No bindings are caused.

3.3. Value Operations

Functions

Form:

&qname(?var or constant, ?var or constant , ...)

Example:

SELECT ?x WHERE (?x ns:location ?loc) AND &func:test(?loc, 20) 

A function can test some condition of bound variables or constants.  The function is called for each possible query result (or equivalent effect if optimized in some way).  A function is named by URI in a qname form, and returns a boolean value.  "true" means accept; "false" means reject this result.

If a query processor encounters a function that it does not provide, the query is not executed and an error is returned.

4. Grammar

Note: this is a permissive grammar.  It is designed for convenience and includes liberal interpretations of terms from other systems.

4.1. Lexical Tokens

QuotedURI  ::=  '<' URI characters (from RFC 2396) '>'
NSPrefix  ::=   NCName As defined in XML Namespace v1.1 and XML 1.1
LocalPart  ::=   NCName As defined in XML Namespace v1.1 and XML 1.1
SELECT  ::=  'SELECT' Case Insensitive match
FROM  ::=  'FROM'   Case Insensitive match
SOURCE  ::=  'SOURCE' Case Insensitive match
WHERE  ::=  'WHERE' Case Insensitive match
AND  ::=  'AND' Case Insensitive match
USING  ::=  'USING' Case Insensitive match
Identifier  ::=  ([a-z][A-Z][0-9][-_.])+  
EOF  ::=  End of file
COMMA  ::=  ','
INTEGER_LITERAL   ::=  ([0-9])+
FLOATING_POINT_LITERAL  ::=  ([0-9])*'.'([0-9])+('e'('+'|'-')?([0-9])+)?
STRING_LITERAL1  ::=  '"'UTF-8 characters'"' (with escaped \")
STRING_LITERAL2  ::=  "'"UTF-8 characters"'" (with escaped \')
LPAREN  ::=  '('
RPAREN  ::=  ')'
COMMA  ::=  ','
DOT  ::=  '.'
GT  ::=  '>'
LT  ::=  '<'
BANG  ::=  '!'
TILDE  ::=  '~'
HOOK  ::=  '?'
COLON  ::=  ':'
EQ  ::=  '=='
NEQ  ::=  '!='
LE  ::=  '<='
GE  ::=  '>='
SC_OR  ::=  '||'
SC_AND  ::=  '&&'
STR_EQ  ::= 'EQ' Case Insensitive match
STR_NE  ::= 'NE' Case Insensitive match
PLUS  ::=  '+'
MINUS  ::=  '-'
STAR  ::=  '*'
SLASH  ::=  '/'
REM  ::=  '%'
STR_MATCH  ::=  '=~' | '~~'
STR_NMATCH  ::=  '!~'
DATATYPE  ::=  '^^'
AT  ::=  '@'

4.2. Productions

References to lexical tokens are enclosed in <>.  Whitespace is skipped.

Notes: The term "literal" refers to a constant value, and not only an RDF Literal.

The grammar starts with the doc-BRQLQuery production.

[1]    BRQLQuery    ::=    SELECT VarList ( SourceClause )? WHERE GraphPattern ( ConstraintClause )? ( PrefixesClause )?
| DESCRIBE VarList ( SourceClause )? WHERE GraphPattern ( ConstraintClause )? ( PrefixesClause )?
| DESCRIBE URI ( SourceClause )? ( PrefixesClause )?
| CONSTRUCT Graph ( SourceClause )? WHERE GraphPattern ( ConstraintClause )? ( PrefixesClause )?
A BRQL query will SELECT a set of variable bindings, CONSTRUCT a set of statements from the variable bindings, or DESCRIBE a resource with a set of statements.
SELECT ?p
WHERE (?s ?p ?o)
[2]    SourceClause    ::=    ( SOURCE | FROM ) SourceSelector ( ( COMMA )? SourceSelector )*
The SourceClause identifies a set of documents or virtual documents to query.
  • Multiple FROM in a request => union query
  • Scaling issues here?
FROM <http://example.org/doc1.rdf> , <http://example.org/database-2>
[3]    SourceSelector    ::=    URI
[4]    GraphPattern    ::=    Graph ( GroundPattern )*
The GraphPattern describes a set of RDF graphs. The initial graph must be an exact match of the included TriplePatterns. Any graph following the NOT keyword much not be present in the @@@returned@@@ set. Graphs following the OPTIONAL may be preset (in their entirety) but a failure to match an OPTIONAL component does not eliminate resutls from the @@@returned@@@ set.
(?x rdf:type foaf:Person)
(?x foaf:mbox_sha1sum "ABCD1234")
[5]    GroundPattern    ::=    NOT Graph
| OPTIONAL Graph
NOT and OPTIONAL graphs must follow .
NOT (?x rdf:type foaf:UnPerson)
OPTIONAL (?x foaf:created ?creation)
[6]    Graph    ::=    TriplePattern ( ( COMMA )? TriplePattern )*
The Graph defines a set of TriplePatterns that compose a query graph. A query graph is composed of TriplePatterns and may have variables as node or arc labels where an RDF Graph is a simple conjunction of RDF Statements (with no variables).
(?x rdf:type foaf:Person)
(?x foaf:mbox_sha1sum "ABCD1234")
[7]    TriplePattern    ::=    SourceOpt LPAREN ( Var | URI ) ( COMMA )? ( Var | URI ) ( COMMA )? ( Var | Const ) RPAREN
Simple TriplePatterns are conjunctions with any that have come before in the query. NOT triples match only if the expressed pattern (with any already bound variables) is not found in the data. OPTIONAL TriplePatterns match just as simple TriplePatterns do, however, if no match is found, the solution is not eliminated. Instead, all newly introduced variables are known to be unbound.
[8]    SourceOpt    ::=   
| SOURCE '?' Identifier
The Source of a TriplePattern identifies the variable which will hold @@@ needs href @@@ the provenance of a matched TriplePattern.
[9]    Var    ::=    '?' Identifier
[10]    PrefixesClause    ::=    USING PrefixDecl ( ( COMMA )? PrefixDecl )*
[11]    PrefixDecl    ::=    Identifier FOR QuotedURI

Constraints

Expressions express constraints that will not match literal statements in the queried data.

[12]    ConstraintClause    ::=    AND Expression ( ( COMMA | AND ) Expression )*
[13]    Expression    ::=    ConditionalOrExpression
| QName LPAREN ( PrimaryExpression )* RPAREN
[14]    ConditionalOrExpression    ::=    ConditionalAndExpression
| ConditionalAndExpression SC_OR ConditionalOrExpression
[15]    ConditionalAndExpression    ::=    StringEqualityExpression
| StringEqualityExpression SC_AND ConditionalAndExpression
[16]    StringEqualityExpression    ::=    ArithmeticCondition
| ArithmeticCondition STR_EQ StringEqualityExpression
| ArithmeticCondition STR_NE StringEqualityExpression
| PatternLiteral STR_MATCH StringEqualityExpression
| PatternLiteral STR_NMATCH StringEqualityExpression
[17]    ArithmeticCondition    ::=    EqualityExpression
[18]    EqualityExpression    ::=    RelationalExpression
| RelationalExpression EQ RelationalExpression
| RelationalExpression NEQ RelationalExpression
[19]    RelationalExpression    ::=    AdditiveExpression
| AdditiveExpression LT AdditiveExpression
| AdditiveExpression GT AdditiveExpression
| AdditiveExpression LE AdditiveExpression
| AdditiveExpression GE AdditiveExpression
[20]    AdditiveExpression    ::=    MultiplicativeExpression
| MultiplicativeExpression PLUS MultiplicativeExpression
| MultiplicativeExpression MINUS MultiplicativeExpression
[21]    MultiplicativeExpression    ::=    UnaryExpression
| UnaryExpression STAR MultiplicativeExpression
| UnaryExpression SLASH MultiplicativeExpression
| UnaryExpression REM MultiplicativeExpression
[22]    UnaryExpression    ::=    UnaryExpressionNotPlusMinus
| PLUS UnaryExpression
| MINUS UnaryExpression
[23]    UnaryExpressionNotPlusMinus    ::=    TILDE UnaryExpression
| BANG UnaryExpression
| PrimaryExpression
[24]    PrimaryExpression    ::=    Var
| Const
| LPAREN Expression RPAREN
[25]    Const    ::=    URI
| NumericLiteral
| TextLiteral
| BooleanLiteral
| NullLiteral
[26]    NumericLiteral    ::=    INTEGER_LITERAL
| FLOATING_POINT_LITERAL
[27]    TextLiteral    ::=    ( STRING_LITERAL1 | STRING_LITERAL2 ) ( AT Identifier )? ( DATATYPE URI )?
[28]    PatternLiteral    ::=    PATTERN_LITERAL
[29]    BooleanLiteral    ::=    BOOLEAN_LITERAL
[30]    NullLiteral    ::=    NULL_LITERAL
[31]    URI    ::=    QuotedURI
| QName
[32]    QName    ::=    NSPrefix ':'
| NSPrefix ':' LocalPart
[33]    Identifier    ::=    IDENTIFIER
| SELECT
| SOURCE
| FROM
| WHERE
| PREFIXES
| FOR
| STR_EQ
| STR_NE

5. Test Cases

Following is a set of test cases. They are presented as a query, a table of results, and a ResultSet graph expressed in Notation 3. These queries are performed over the following data (also in Notation 3):

@prefix foaf:       <http://xmlns.com/foaf/0.1/> .
@prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:	    <http://www.w3.org/2000/01/rdf-schema#> .

_:alice
    rdf:type        foaf:Person ;
    foaf:name       "Alice" ;
    foaf:mbox       <mailto:alice@work> ;
    foaf:knows     _:bob.

_:bob
    rdf:type        foaf:Person ;
    foaf:name       "Bob" ; 
    foaf:knows     _:alice ;
    foaf:mbox       <mailto:bob@work> ;
    foaf:mbox       <mailto:bob@home>.


_:eve
    rdf:type      foaf:Person ;
    foaf:name     "Eve" ; 
    foaf:knows    _:fred.

_:fred
    rdf:type      foaf:Person ;
    foaf:mbox     <fred@edu>.

1. example 1

SELECT ?x
WHERE (?x,  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>,
                                   <http://xmlns.com/foaf/0.1/Person>)
x
_:g2
_:g1
_:g4
_:g3


    

2. example 2

SELECT ?given, ?family
WHERE  (?vcard  vcard:FN     "Alice Antwerp")
       (?vcard  vcard:N      ?name)
       (?name   vcard:Family ?family)
       (?name   vcard:Given  ?given)
USING  vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>
given family
"Alice""Antwerp"


    

3. example 3

SELECT ?name
WHERE (?who info:age ?age)
      (?who vcard:FN ?name)
AND ?age >= 30
USING info FOR <http://example.org/peopleInfo#>, 
      vcard FOR <http://www.w3.org/2001/vcard-rdf/3.0#>
name
"Alice Antwerp"


    

99. Optional Test 1

# Get name, and optionally the mbox, of each person

SELECT ?name ?mbox
WHERE
    (?person foaf:name ?name)
OPTIONAL
    (?person foaf:mbox	?mbox)
USING foaf FOR <http://xmlns.com/foaf/0.1/>
name mbox
"Bob"<mailto:bob@home>
"Bob"<mailto:bob@work>
"Alice"<mailto:alice@work>
"Eve" NULL
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rs:     <http://jena.hpl.hp.com/2003/03/result-set#> .

[] rdf:type rs:ResultSet ;
    rs:resultVariable "name" ;
    rs:resultVariable "mbox" ;
    rs:size "4" ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Bob" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:bob@home> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Bob" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:bob@work> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Alice" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:alice@work> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Eve" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:nonValue "NULL" ] 
        ] .

99. Optional Test 2

# Get names of people, together with the names of people they know.

SELECT ?name, ?name2
WHERE
    (?person foaf:name ?name)
OPTIONAL
    (?person foaf:knows ?p2)
    (?p2     foaf:name   ?name2)
USING foaf FOR <http://xmlns.com/foaf/0.1/>
name name2
"Bob""Alice"
"Alice" "Bob"
"Eve" NULL
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rs:     <http://jena.hpl.hp.com/2003/03/result-set#> .

[] rdf:type rs:ResultSet ;
    rs:resultVariable "name" ;
    rs:resultVariable "name2" ;
    rs:size "3" ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Bob" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name2" ; rs:value "Alice" ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Alice" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name2" ; rs:value "Bob" ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Eve" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name2" ; rs:nonValue "NULL" ] 
        ] .

99. Optional Test 3

# Get names and mboxes, each of which may be optional.

SELECT ?name, ?mbox
WHERE
    (?person rdf:type foaf:Person)
OPTIONAL
    (?person foaf:name  ?name)
OPTIONAL
    (?person foaf:mbox  ?mbox)
USING foaf FOR <http://xmlns.com/foaf/0.1/>
name mbox
NULL<file://na/home/eric/sources/public/perl/modules/W3C/Rdf/bin/fred@edu>
"Alice" <mailto:alice@work>
"Bob" <mailto:bob@home>
"Bob" <mailto:bob@work>
"Eve" NULL
@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rs:     <http://jena.hpl.hp.com/2003/03/result-set#> .

[] rdf:type rs:ResultSet ;
    rs:resultVariable "name" ;
    rs:resultVariable "mbox" ;
    rs:size "5" ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:nonValue "NULL" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <file://na/home/eric/sources/public/perl/modules/W3C/Rdf/bin/fred@edu> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Alice" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:alice@work> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Bob" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:bob@home> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Bob" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:value <mailto:bob@work> ] 
        ] ;
    rs:solution
        [ rdf:type rs:ResultSolution ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "name" ; rs:value "Eve" ] ;
          rs:binding [ rdf:type rs:ResultBinding ;
                       rs:variable "mbox" ; rs:nonValue "NULL" ] 
        ] .

6. Correlation to DAWG UC&R

The email contained an evaluation of RDQL against the DAWG requirements and design objectives.  This document adds:

Requirement 3.3 Extensible Value Testing

Boolean valued functions (as per the original RDQL design but not generally implemented).

Requirement 3.4 Subgraph Results

Added DESCRIBE

Added CONSTRUCT

Requirement 3.6 Optional Match

Added OPTIONAL

Requirement 3.10 Result Limits

Added SELECT LIMIT

Design Objective 4.1 Human-friendly Syntax

The illustrative syntax used here is not proposed as a way to meet this objective.

Design Objective 4.2 Provenance

Added SOURCE ?src

Design Objective 4.3 Non-existent Triples

Added NOT

7.0 References and Resources

Resources

References

[1] "Three Implementations of SquishQL, a Simple RDF Query Language", Libby Miller, Andy Seaborne, Alberto Reggiori; ISWC2002

[2] "RDF Query and Rules: A Framework and Survey", Eric Prud'hommeaux

[3] "RDF Query and Rule languages Use Cases and Example", Alberto Reggiori, Andy Seaborne

[4] RDQL Tutorial for Jena (in the Jena tutorial).

[5] RDQL BNF from Jena

[6] Enabling Inference, R.V. Guha, Ora Lassila, Eric Miller, Dan Brickley

[7] N-Triples

[8] RDF http://www.w3.org/RDF/

[9] "Representing vCard Objects in RDF/XML", Renato Iannella, W3C Note.

[10] "RDF Data Access Working Group"

[11] "RDF Data Access Use Cases and Requirements — W3C Working Draft 2 June 2004", Kendall Grant Clark.

 

Valid XHTML 1.0!

CVS Change Log:

 
$Log: Overview.html,v $
Revision 1.18  2006/05/02 11:57:03  eric
~ fix character decl

Revision 1.17  2006/05/02 11:34:32  eric
~ fixed duplicate anchors

Revision 1.16  2006/05/02 11:33:30  eric
fixed well-formedness errors around <COMMA>

Revision 1.15  2004/08/16 15:36:17  connolly
pointer to newer work

Revision 1.14  2004/07/19 13:11:51  eric
added examples from #description to #tests

Revision 1.13  2004/07/16 00:24:52  eric
style for issues
added Example 1 test
issue: CONSTRUCT (unbound variable)

Revision 1.12  2004/07/16 00:08:43  eric
removed ^Ms
validated head div

Revision 1.11  2004/07/15 19:51:01  connolly
per ftf discussion

Revision 1.10  2004/07/14 21:09:33  eric
added Andy's three OPTIONAL test cases

Revision 1.9  2004/07/14 05:33:29  eric
Added Log