W3C home > Mailing lists > Public > public-lod@w3.org > March 2010

Notes on "RDFa For Turtles"

From: Paul Houle <ontology2@gmail.com>
Date: Fri, 12 Mar 2010 10:21:56 -0500
Message-ID: <3e12f6f41003120721v268d957cj272a0ca235e5e91d@mail.gmail.com>
To: Linked Data community <public-lod@w3.org>
I’ve gotten some great feedback and spent some time looking at specs, and
here are some thoughts.

“RDFa For Turtles” is an RDFa subset (profile?) that makes it easy to
specify triples in the <HEAD> of an HTML document.   I intend to distill it
into a short “HOWTO” document that any webmaster can understand and
correctly apply.  Towards that goal, it fixes certain choice to improve
interoperability.  I'm interested in any feedback that can further improve
interoperability.

---

Now, it’s tempting to say that RDFa documents can be ‘duck typed’; that is,
try to extract some RDFa triples, and if you get some, it’s an RDFa
document.

I see one problem with that.  Superficially, it looks like RDFa should be
able to extract old-school


<link rel=”{p}” href=”{o}” />

elements from the headers of legacy HTML and XHTML documents.   (Similarly,
people are being told to add <a rel=”license” href=”{o}”> to today’s HTML
documents.)

These constructions havve the desired effect when the <base> of the document
is not specified, however, the use of <base href=”{base}” > causes the RDFa
interpretation of these constructs to be different from that in legacy
systems.

To avoid this and other problems,  “RDFa For Turtles” documents use the
@about attribute of the <html> element to  explicitly specify the URL of the
current document.   “RDFa For Turtles” documents are not allowed to assert
triples about the current document unless that URI of that document is
specified explicitly.

It would be nice to have a reliable and simple way to make statements about
the current document for documents that are being written by hand,  but I
don’t think there is any,  at least not if the <base> element is in use.

---

When used in an XHTML document,  “RDFa For Turtles” uses the standard
DOCTYPE for XHTML+RDFa documents and is completely conformant with the
XHTML+RDFa specification.

“RDFa For Turtles” embedding in HTML will be based on the HTML 5 + RDFa
specification,

http://dev.w3.org/html5/rdfa/rdfa-module.html

but will not require the use of a specific DOCTYPE.   “RDFa For Turtles”
will follow changes in HTML5 + RDFa as the standard matures.

Conformant “RDFa for Turtles” HTML documents have the following
characteristics:
(i) One or more RDFa statements can be extracted from the <head> using the
HTML 5 + RDFa rules
(ii) No statements are made without an explicit @about;  the head element
cannot contain an @about element;  the html element can contain only an
@about element that points to the current document URI
(iii) RDFa statements specified in the head must use the restricted “RDFa
For Turtles” vocabulary,   however
(iv) Arbitrary RDFa statements are allowed elsewhere in the document,
subject only to rule (ii)

“RDFa For Turtles” uses xmlns notation to define CURIE prefixes, as do
current HTML+RDF specifications,  but will track the change if a new
mechanism is introduced.

---

Here’s the “RDFa For Turtles” vocabulary:  all of these go into the <head>

If @about is specified explicitly in the <html> element, we can write

<meta property="{predicate}" content="{object}">
<meta property="{predicate}" content="{object}">

To assert triples about the current document.  We can also use @datatype
here,  @lang in HTML documents,  and @xml:lang in XHTML documents.

We can also write

<link rel=”{reserved_value}” href=”{object}”>
<link rev=”{reserved_value}” href=”{subject}”>

And

<link rel=”{curie_predicate}” resource=”{object}”>
<link rel=”{curie_predicate}” resource=”{subject}”>

I think the differential use of href and resource here maximizes backwards
and forwards compatibility.  It is non-conformant to use legacy
link/@relelements if @about is not set in the <html> element.  Also,

<link about=”{any_subject}” rel=”{reserved_value}” href=”{object}”>
<link about=”{any_subject}” rel=”{reserved_value}” href=”{object}”>

Is disallowed because legacy clients could misinterpret it.  If we want to
assert predicates such as “alternate”, “cite” about documents that are not
the present document, we need to add a namespace declaration like

xmlns:xhv=”http://www.w3.org/1999/xhtml/vocab#”

and then write the predicate as a CURIE:

<link about=”{any_subject}” rel=”xhv:{reserved_value}” resource=”{object}”>

Of course, to assert triples about other things, we may add @about to <link>
and <meta>.  The shorthand form

<link about=”{subject}” typeof=”{object}”>

Is equivalent to

<link about=”{subject}” predicate=”rdf:type” value=”{object}”>

@about is required when using @typeof.

RDFa For Turtles allows (but discourages) the creation of blank nodes with
the safe CURIE syntax [_:suffix]

RDFa For Turtles supports the full range of possible syntax in @about,
@resource,  @rel, @rev and @property attributes (other than the
compatibility restrictions above.)  I’m planning,  however,  to split the
“RDFa For Turtles” spec to have a basic half that leaves out certain
features (@typeof,  use of Safe CURIEs, and space-separated CURIE/URI lists)
and an advanced half that adds a few dashes of syntactic sugar.

RDFa For Turtles does not restrict the use of non-RDFa attributes in <link>
and <rel> attributes and does not allow the use of RDFa attributes on
<script>, <base> and <style> elements.

---

XML Literals – Not!

Although embedding of XML literals in HTML looks like a solved problem, I
don’t see any sane way to embed them in the HEAD.  Now,if the HTML 5 spec
were to allow <META> to have content,  that would be a great answer,  but
that would be asking a lot.  (This issue doesn’t bother me;  I’ve got 5
billion or so triples and none of them have XML literals)
Received on Friday, 12 March 2010 15:22:31 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 31 March 2013 14:24:25 UTC