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

Microdata implied property order

From: Gregg Kellogg <gregg@kellogg-assoc.com>
Date: Sun, 2 Oct 2011 13:13:54 -0400
To: "public-html-data-tf@w3.org" <public-html-data-tf@w3.org>
Message-ID: <E569FE2A-7C87-42EC-A29F-BB2C2546C76D@greggkellogg.net>
The Microdata spec [1] has a defined property order for the JSON serialization. The (former) RDF processing rules [2] did not take this into consideration, but ordering of properties in RDF is commonly presumed, even though it doesn't exist.

If an RDF conversion were to be specified to preserve order, it should probably make use of RDF collections (rdf:List). The question would be, are single-valued properties also in a collection? If multi-valued properties are presumed to be ordered in a collection, how can you express unordered properties in Microdata?

For example (from schema.org):

	<div itemscope itemtype="http://schema.org/MusicPlaylist">
	  1. <div itemprop="tracks" itemscape itemtype="http://schema.org/MusicRecording">...</div>
	  2. <div itemprop="tracks" itemscape itemtype="http://schema.org/MusicRecording">...</div>

There is an assumed ordering of the tracks in a playlist, but no clear processing rules (for RDF anyway) to describe the ordering. With previously existing rules, this would render the following:

	@prefix : <http://schema.org/> .
	[ a :MusicPlaylist
	  :tracks [ a :MusicRecording; ...], [a :MusicRecording; ...]

RDFa recently added the @inlist attribute to indicate that property values should be added to a list, so the same thing could be represented as follows:

	<div vocab="http://schema.org/" typeof="MusicPlaylist">
	  <div rel="tracks" inlist>
	    1. <div typeof="MusicRecording">...</div>
	    2. <div typeof="MusicRecording">...</div>

which would render the following:

	@prefix : <http://schema.org/> .
	[ a :MusicPlaylist
	  :tracks ([ a :MusicRecording; ...] [a :MusicRecording; ...])


[1] http://dev.w3.org/html5/md/#json
[2] http://www.w3.org/TR/2011/WD-microdata-20110525/#rdf
Received on Sunday, 2 October 2011 17:14:40 UTC

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