Microdata schemas

83 views
Skip to first unread message

michaelswest

unread,
Aug 7, 2011, 10:27:59 AM8/7/11
to JSON Schema
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."]
}
},
...
]
}
}
]
}

Nate Morse

unread,
Aug 9, 2011, 11:57:49 AM8/9/11
to json-...@googlegroups.com
I suspect the fit is fine, you could easily write JSON Schema(s) for any of those microfomats.
 
You can write Schemas to enforce that a "type" property to be included in a microfomat, but JSON Schema itself (i.e. the meta schema) would never require that a reference to its schema MUST be included in some JSON-data.

Once you have a JSON Schema for a format, you can take advantage of the JSON Schema validators etc.


--
You received this message because you are subscribed to the Google Groups "JSON Schema" group.
To post to this group, send email to json-...@googlegroups.com.
To unsubscribe from this group, send email to json-schema...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/json-schema?hl=en.


Reply all
Reply to author
Forward
0 new messages