RDF Abstract Syntax

Editors:

Jonathan Borden jonathan@openhealth.org

Pat Hayes phayes@ai.uwf.edu

Drew McDermott drew.mcdermott@yale.edu

This version: June 10, 2001

Latest version

Previous version: June 3, 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 it is useful to group triples into sets of statements termed: Contexts.

Context

A Context is represented by an atom. A context is a list (ordered set) of Statement triples <predicate,subject,object>. For each context the statement quadruple: <predicate,subject,object,context> is equivalent to the triple <predicate,subject,object>.

Statement

A Statement is represented by the 4-tuple: <predicate,subject,object,context>

atom

An atom represents either an XML QName, according to XML Namespaces, or a variable matching the EBNF:

atom := (QName | quantifiedVariable| rowVariable | Statement)

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

rowVariable := ('@' Name)

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.

context

A context is represented by a QName

Purpose of the Context

The context allows separation of statements into lists which can be asserted as a group. Contexts allow 'coloring' of subgraphs. The document from which a set of statements arises forms a context (represented by its URI). Contexts can 'contain' other contexts.

Abstract Syntax

  1. There exists a set called QNames
  2. There exists a set called QuantifiedVariables
  3. There exists a set called RowVariables
  4. There exists a set called AtomicNames where for all a in AtomicNames => (a in QNames) or (a in quantifiedVariables) or (a in rowVariables)
  5. for all atomicName(x) <=> x in AtomicNames
  6. There exists a set called Predicates where for all p in Predicates => atomicName(p)
  7. There exists a set called Subjects where for all s in Subjects => atomicName(s)
  8. There exists a set called Objects where for all o in Objects => atomicName(o)
  9. There exists a set called Contexts where for all c in Contexts => atomicName(c)
  10. There exists a set of Statements := {<predicate,subject,object,context>}

Examples:

The statement:

(not (says jon (color sky blue))

is represented by the Expression:

[not [says jon [color sky blue]]]

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

is represented as:

  1. <dc:creator,foo,?x,ctx-query>
  2. <foaf:mbox,?x,mailto:jonathan@openhealth.org,ctx-query>

S Expressions

An s-expression may be represented in XML:

(or a b c d)

becomes

<or rdf:parseType="daml:list">
 <a/>
 <b/>
 <c/>
 <d/>
</or>

In the case of representing an s-expression in RDF:

[or a [or b [or c d]]]

is this correct?

    Expressions

    Expressions are collections of statements within a common context. An expression is a subgraph. The root or top level expression within a particular context are those statements which are not referred as the subject or object of any other statement within the context.

    Is there a formal expression of this?

  1. W3C RDF Model and Syntax 1.0
  2. ILRT Squish
  3. RDF DB
  4. 1
  5. N3
  6. Klyne's Contexts