Is anyone tracking the fit between HTML5 Microdata (e.g.,
schema.org)
and JSON Schema? The basic HTML5 Microdata defined mapping of elements
such as "items", "properties", and "id" to JSON seems to match well
against JSON Schema. One possible exception is "type". Being able to
properly express HTML5 Microdata schemas in JSON Schema would seem to
be a nice win and would help cement JSON Schema's usefulness. This
seems to be JSON-LD's rear guard action now that HTML5 Microdata has
supplanted RDFa as the main semantic web data candidate.
Good examples of JSON sample output are at
http://foolip.org/microdatajs/live/.
For instance (from "
schema.org/Product"),
{
"items": [
{
"type": "
http://schema.org/Product",
"properties": {
"name": ["Kenmore White 17\" Microwave"],
"aggregateRating": [
{
"type": "
http://schema.org/AggregateRating",
"properties": {
"ratingValue": ["3.5"],
"reviewCount": ["11"]
}
}
],
"offers": [
{
"type": "
http://schema.org/Offer",
"properties": {
"price": ["$55.00"],
"availability": ["
http://schema.org/InStock"]
}
}
],
"description": ["0.7 cubic feet countertop microwave.\n Has
six preset cooking categories and convenience features like\n Add-A-
Minute and Child Lock."],
"reviews": [
{
"type": "
http://schema.org/Review",
"properties": {
"name": ["Not a happy camper"],
"author": ["Ellie"],
"publishDate": ["2011-04-01"],
"reviewRating": [
{
"type": "
http://schema.org/Rating",
"properties": {
"worstRating": ["1"],
"ratingValue": ["1"],
"bestRating": ["5"]
}
}
],
"description": ["The lamp burned out and now I have to
\n replace it."]
}
},
...
]
}
}
]
}