A fragment identifier syntax for RDF.

Jonathan Borden The Open Healthcare Group, May 3, 2001

This paper proposes a fragment identifier syntax for the MIME media types: text/rdf+xml and application/rdf+xml. This syntax is intended to be compatible with and an extension of the fragment identifier syntax for text/xml and application/xml namely XPointer.

Three forms are proposed:

  1. Raw names. The set of raw names in a document is formed by the set of values of the rdf:ID attribute.
  2. Triple syntax. A triple is defined by the extension triple containing the parameters: predicate, subject and object. This syntax is similar to Prolog syntax though predicate, subject and object are all URIs.
  3. RDF Path A path syntax, analagous to XPath, for RDF.

Raw names

Raw names are an uncontroversial feature of the RDF fragment identifier syntax. The rdf:ID attribute serves like an ID attribute for RDF but without use of a validating XML parser nor DTD. The value of the rdf:ID attribute must be unique to the document as with an ID type attribute.

Triple syntax

The triple syntax serves as a quoting mechanism for RDF triples, and leverages the syntax of a triple in Prolog. The proposed triple syntax is a purely syntactic mechanism for 'quoting' an RDF triple which itself can be used as a URI reference, is an extension of XPointer and hence compatible with the general XML family of specifications. The 'triple' XPointer extension is defined to have 3 parameters, a predicate URI reference, a subject URI reference and an object URI reference. Similarly to the N3 notation, the predicate, subject and object may be represented as a QName or alternatively as an expanded URI reference delimited between "<" and ">".

RDF Path

XPointer provides for an extension mechanism to be used with XML media types other than text/xml or application/xml, in this case: application/rdf+xml.

The basic triple syntax defines a set of triples throught the use of wildcards and variables

Triple syntax examples

<rdf:Description rdf:ID="foo">

       <example:bar rdf:resource="#baz"/>

</rdf:Description>

is quoted as:

#xmlns(example=http://example.org) triple(example:bar,:foo,:baz)

another example:

<rdf:Description rdf:about="#Jon">

    <example:says>This is a good thing</example:says>

</rdf:Description>

is quoted as:

#triple(example:says, <#Jon>, <data:text/plain,This is a good thing>)

and another

<rdf:Description rdf:about="#Jon">

    <example:states>

          <rdf:Description rdf:about="#foo">

               <example:bar rdf:resource="#baz/>

         </rdf:Description>

     </example:states>

</rdf:Description>

#triple(example:states, :Jon, <#triple(example:bar, :foo, :baz>)

Collections:

When any of the predicate, subject or object parameters are blank, the triple fragment identifier may match a collection of statements. A particular statement is selected using the standard XPointer/XPath index syntax, and as in XPath/XPointer the statements are considered ordered in document order.

For example:

<rdf:Seq rdf:ID="coll">

    <rdf:li rdf:resource="#foo"/>

    <rdf:li rdf:resource="#bar"/>

     <rdf:li rdf:resource="#baz/>

</rdf:Seq>

#triple(rdf:li,:coll,)[1]

Quoting statements in N3

<#Pat> <#states> <#triple(foo:example,:bar,:baz)>