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:
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.
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 ">".
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
rdf:type
rdf:type
and binds the object to the variable
x
rdf:type
whose object has an
rdf:Property
foo:bar
.
This is abbrviated as
rdf:type[rdf:Property="foo:bar"]
<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>)
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]
<#Pat> <#states> <#triple(foo:example,:bar,:baz)>