Editors:
Jonathan Borden jonathan@openhealth.org
Pat Hayes phayes@ai.uwf.edu
Drew McDermott drew.mcdermott@yale.edu
This version: June 19, 2001
Previous version: June 14, 2001
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: Bundles.
This document has no official status.
A bundle is a collection of statements.
world ::= (bundle*)
bundle ::= (term*)
A statement is a triple composed of a predicate, a subject and an object.
statement ::= (predicate,subject,object)
A word is either a statement, a bundle, a qname, a URI reference, a quantified variable or a literal. A literal is a string or quoted piece of XML.
word ::= (qname | URIreference | variable | literal)
term ::= (word | statement | bundle)
variable := ('?' Name) Name as defined in XML 1.0
A predicate is a QName.
A subject is a term.
An object is a term.
The bundle allows separation of statements into lists which can be asserted as a group. Bundles allow 'coloring' of subgraphs. The document from which a set of statements arises forms a bundle (represented by its URI). Bundles can 'contain' other bundles.
For each URIreference U, Q = QName(U) and U = URIreference(Q)
Converting a URI reference to a QName
A URI reference may be separated into a namespace URI part which is the substring of the URI reference up until the last non alphanumeric character. The localname part is the part subsequent to this last alphanumeric character. If the localname part is null, the special name "_" is used as the localname part of the QName.
If the namespace name ends in a non alphanumeric character, the namespace URI and localname are concatenated to form a URI reference. If the namespace name ends in an alphanumeric the namespace URI, '#' and localname are concatenated.
The functions first(bundle) , rest(bundle) and nth(i,bundle) are defined where:
the subject is the argument, the object must be nil
foo(bar) -> (foo bar nil)
the subject is the first argument, the object is the second argument
foo(bar,baz) -> (foo bar baz)
or(a b c d e) -> (or {a b c d e} nil)
predicaten.bundle := predicaten(nth(1,bundle),nth(2,bundle) ... nth(n,bundle))
the subject is of type bundle and holds the argument list, the object is nil
An expression is a statement that contains a statement or bundle as its predicate or object.
The statement:
(not(if (color sky blue)(color leaf green)))
predicate: not - type qname subject: [if [color sky blue][color leaf green]] - type statement predicate: if - type qname subject: [color sky blue] - type statement object: [color leaf green] - type statement object: nil
[or a b c d e f g]
predicate: or - type qname subject: {a b c d e f g} type bundle object: nil
[if [and [color sky blue][color leaf green]] [season summer]]
<rdf:If> <rdf:And> <ex:color rdf:aboutQ="ex:sky" rdf:resourceQ="ex:blue"/> <ex:color rdf:aboutQ="ex:leaf" rdf:resourceQ="ex:green"/> </rdf:And> <ex:season rdf:aboutQ="ex:summer"/> </rdf:If>
The Squish [2] query: (dc:creator, foo, ?x)(foaf:mbox, ?x, mailto:jonathan@openhealth.org)
is represented as the bundle:
In the context of a query, variables are existentially quantified over the conjunction of the bundle
(exists ?x and{(dc:creator, foo,?x),(foaf:mbox,?x,mailto:jonathan@openhealth.org)})
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?