RDF Abstract Syntax

Author: Jonathan Borden jonathan@openhealth.org This version: May 27, 2001

Latest version

Previous version: May 24, 2001

Introduction

This document defines an Abstract Syntax or Infoset for RDF [1]. RDF Statements are commonly refered to as triples of {predicate,subject,object}. In practice RDF Datastores may supplement the triple with associated information. This abstract syntax defines the supplemented information items.

Context

A Context is a set of Statements

Statement

A Statement is represented by the 7-tuple: <predicate,subject,object, contextURI,id, index, asserted>

atom

An atom represents either a URI Reference, according to RFC 2396, or a quantified variable matching the EBNF:

atom := (quantvar | URIreference)

quantvar := ('?' Name) Name as defined in XML 1.0

predicate

A predicate is an atom.

subject

A subject is an atom.

object

An object is an atom. Note that literal strings may be represented by the data: URI scheme.

contextURI

A context is represented by a URI, directly analogous to the base URI information item in an XML Infoset.

id

An RDF Statement may have an optional id by which the statement is refered to (combined with the contextURI).

index

The index gives the index of a statement within a context in document order. The index allows preservation of statement order as if each RDF <Description> defines a container, and folds the RDF concept of container directly into the RDF Abstract Syntax.

asserted

A boolean flag indicating whether the statement is asserted within the context.

Referring to Statements by Index

A statement may be referred to by index using a syntax consistent with the ChildSeq syntax of XPointer []. For example, the 2nd statement in a context is referred to as:

/2

This syntax allows reference to a particular statement in a context as if the context were an <rdf:Seq> container. One can refer to a range of statements by inserting a hyphen between the start and ending index of the range, e.g.: /2-6.

Examples:

The statement:

(not (says jon (color sky blue))

is represented by the Statements:

  1. <not,#s2,true,ctx-foo,s1,1,true>
  2. <says,jon,#/3,ctx-foo,s2,2,false>
  3. <color,sky,blue,ctx-foo,,3,false>

These tuples may be expanded using URI references (assuming a namespace name http://example.org/logic# as:

  1. <http://example.org/logic#not,#s2,true,http://example.org/context-foo,s1,1,true>
  2. <http://example.org/logic#says,http://example.org/ex#jon,#/3,http://example.org/context-foo,s2,2,false>
  3. <http://example.org/ex#color,http://example.org/ex#sky,http://example.org/logic#blue,http://example.org/context-foo,,3,false>

The Squish [2] query: (dc:creator, foo, ?x)(foaf:mbox, ?x, mailto:jonathan@openhealth.org)

is represented as:

  1. <stmt,this,/2-3,ctx-query,,1,false>
  2. <dc:creator,foo,?x,ctx-query,,2,false>
  3. <foaf:mbox,?x,mailto:jonathan@openhealth.org,,3,false>
  1. W3C RDF Model and Syntax 1.0
  2. ILRT Squish
  3. RDF DB
  4. 1
  5. N3
  6. Klyne's Contexts