RDF-3T

From W3C Wiki
Revision as of 20:00, 15 February 2009 by MartinMcEvoy (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

RDF-3T - RDF in Machine Tags

Introduction

RDF-3T is a Metaformat(a language used to describe another language) that uses a Triple Tag syntax to describe RDF triples in XHTML. The Wikipedia definition of a triple tag says...

 A triple tag is a tag that uses a special syntax to define extra information about the tag, making it easier or more meaningful for interpretation by a computer program. Triple tags comprise three parts: a namespace, a predicate and a value.

Triple Tags were first devised in 2004 by Mikel Maron as an experiment in using del.icio.us as a collaborative geo-annotation database. This Method was adopted by Flicr who used the Technical term Machine Tags when referring to Triple Tags. RDF-3T uses Machine Tags and a minimal set of standard html attributes to provide easily discoverable RDF triples or NTriples on any xhtml page.

Attributes

RDF-3T uses a minimal set of three standard html attributes.

id::
 
A unique Identifier used in combination with item as a relative url of the subject. The contents of an id are either a plain text string or a CURIE
href::
 
Also a unique Identifier used in combination with item as an absolute url of the subject
class::
 
This attribute assigns a class name or set of class names to an element and is used for general syntax processing.

RDF-3T syntax

RDF-3T uses the following syntax,

[ prefix ] ' : ' [ term ] ' = ' [ value ]

colon (:)::
 
Is a Prefix, Term seperator.
equals (=)::
 
The string after equals(=) is the value of the object that you are describing.

Define a prefix

Define a prefix by using a <meta> tag in the <head>...</head> of a page using the meta name "prefix", you should also define a scheme using using the meta attribute scheme with the value of your chosen prefix. The content attribute should contain the url of your prefix example:

<meta name="prefix" scheme="foaf" content=" http://xmlns.com/foaf/0.1/ "/>

Reference a Term using a "follow your nose" principle and easy RDF-3T statements.

RDF-3T Values

RDF-3T has eight possible Values.

item::
 
An instance of a RDF class that may contain a set of RDF classes, What type of thing this is.
content::
 
Content is Text or Plain literal.
resource::
 
A RDF resource type, the values will be either @src or @href
literal::
 
RDF datatype XMLLiteral, the contents are html markup.
hash (#)::
 
A relative hash uri reference of an id example: foaf:maker=#thatid
hash underscore (#_)::
 
Looks down the document for the first child item with a href attribute or an ID containing a curie if none exists the parser will generate a "blank node" example: foaf:maker=#_
[prefix:reference] (curie)::
 
A compact uri expression of a resource examples: mo:release_type=[mo:album], rdf:type=[pim:ContactLocation] and foaf:maker=[doc:me].
string::
 
Any string after equals(=) example: dc:date=2008-12-25, a string should not contain any spaces.

GRDDL Profile

RDF-3T Tests

The following pages are some basic tests that were used during the development of RDF-3T, they all including source snippets and conversions.

See Also