W3C home > Mailing lists > Public > public-html-data-tf@w3.org > October 2011

Data blocks, not marked up content

From: Gavin Carothers <gavin@carothers.name>
Date: Tue, 4 Oct 2011 12:28:48 -0700
Message-ID: <CAPqY83xNOpDh0oTrvfubJWexH0w3KfibpZO6VpiG7QUbwQP=sA@mail.gmail.com>
To: public-html-data-tf <public-html-data-tf@w3.org>
One of the use cases for both Microdata and RDFa (but not
microformats) is the exchange of data that is NOT displayed. Perhaps
they should not try and meet this use case. An example:

<div xmlns="http://www.w3.org/1999/xhtml"

  <div typeof="gr:Location" about="#store">
    <div rev="gr:hasPOS" resource="#company"></div>
    <div property="gr:name" content="Hair Masters"></div>
    <div property="vcard:tel" content="707-829-2443"></div>
    <div rel="vcard:adr">
      <div typeof="vcard:Address">
        <div property="vcard:country-name" content="USA"></div>
        <div property="vcard:locality" content="Sebastpol"></div>
        <div property="vcard:postal-code" content="95472"></div>
        <div property="vcard:street-address" content="6980 Mckinley Ave"></div>
    <div rel="vcard:geo">
        <div property="vcard:latitude" content="38.40323"
        <div property="vcard:longitude" content="-122.82459"
    <div rel="foaf:page" resource=""></div>

The GoodRelations snippet generator creates these blocks. These blocks
pollute the DOM, create a mass of useless elements and encode simple
data in a complex serialization. HTML already has a way of placing
data blocks in-line, "The script element allows authors to include
dynamic script and data blocks in their documents". So what does it
look like to place a the same data into a data block rather then using
Microdata or RDFa?

<script type="text/turtle">
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<#company> gr:hasPOS <#store> .

<#store> a gr:Location;
    gr:name "Hair Masters";
    vcard:adr [ a vcard:Address;
            vcard:country-name "USA";
            vcard:locality "Sebastpol";
            vcard:postal-code "95472";
            vcard:street-address "6980 Mckinley Ave" ];
    vcard:geo [ vcard:latitude 38.40323;
            vcard:longitude -122.82459 ];
    vcard:tel "707-829-2443";
    foaf:page <> .


* VERY copy and paste-able
* Prefixes (which some consider complicated) are scoped only inside
the script tag. Do not "infect" DOM.
* DOM and display almost completely unchanged.
* No huge hidden blobs of elements
* Extension point for new serializations is Media Type!


* Access is limited to User Agents (or scripts) that understand the
"text/turtle" media type.
* Does not markup existing content structures, that is what we have
RDFa, Microdata and Microformats for.

* Relationship (if any) between multiple data blocks on the same page

Turtle in HTML http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-turtle/index.html#in-html
HTML5 http://dev.w3.org/html5/spec/Overview.html#the-script-element
Received on Tuesday, 4 October 2011 19:29:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:08:24 UTC