20 Avr 2005

Deconstructing SB-Review XSD

I had a first look at the XDS-file for reviews as defined by Structured Blogging. And as I am to lazy to find a good XSD-resource, I has a go at it without any prior knowledge on XSD.

I am not sure what such a XSD-file defines. Is it just a single file or can I repurpose the definitions also in other files. I assume that it is the latter. Anyway the XSD-file defines a simple-review and its embedded elements. The simple-review consists of two parts: a sequence and version. I assume that version is the version-number of the StructuredBlogging (SB) definition. What the current version number is not defined in this XSD-file.

The most interesting thing is the content of the sequence. This is a set of 9 elements (I usually call this fields), which describe the review. These fields are: review-title, review-type, rating, product-name, product-author, product-editor, product-link, product-image-link, description. For each of these elements two attributes are defined minOccurs and maxOccurs. I guess this means how often an element can occur in a sequence. All elements have a minOccurs of 0, except review-title. I assume that this means that only the review-title is required and all other elements can be left out. I like this approach as it gives a lot of freedom. (I start to like the fuzziness of MicroContent). I would however have added minOccurs=“1” to the review-title to really pin it down.

The maxOccurs attribute defines how often element might occur. Several elements defined maxOccurs as unbounded, i.e. there is no limit to the number of occurrences. Thus you might add as many links to an image as you want. Only the review-type, rating, product-name and description may occur once. They should have added the maxOccurs=“1” attribute.

And as a next step all the separate elements are better defined. Most of these elements are pretty straightforward. Thus product-link and product-image-link are an URI, review-type, product-editor, review-title and product-author, product-name are a string.

Only the description and the rating are more complex. Thus the description consists of two attributes: type (string) and escaped (boolean, optional). I am not sure what escaped is supposed to mean. The rating consists of three attributes: number (integer), base (integer), value (float). With this could define a rating of 3 (number) out of 5 (base). I am not sure what value is supposed to do. Does it replace number in case you want to use a non-integer number?

Let me now look at the meaning of the elements. What am I supposed to enter there? I would use the description for entering the actual review in text as I would write it. The product-author would be an author of a book, the artist of the album, the director(?) of the movie, the producer(?) of my PC, etc. What the product-editor should contain is not clear to me. The product-link and the product-image-link is straightforward and could be used to point to any URI on the web (and not just Amazon’s). The product-name is also easy to fill: the name of the book, the name of the album, the name of the product in general. If all is well the product-* fields should be produced by the producer of the the product and serve only as identification. The rating is also an easy element. The review-title is something that the reviewer makes up. The review-type is not clear to me. I assume that it should be “book”, “DVD”, etc. But shouldn’t it be a product-type then?

Note that no creation- or edit-dates are defined, nor the author of the review. I guess that this information is in the XSD-envelope. This definition of a review leaves a lot of freedom. There are no element for ISBN-numbers, EAN-codes or whatever. In my review I use to note where I bought the product. And thus one can think of many more fields, which can be added to a review. I would like to see the product-elements in a separate schema, so that the product definition can be reused. And I would like to add a provider (shop) element, which is defined in a separate scheme as well.

And that is all that there is to the review. It leaves me with only a few questions:

  • What should the product-editor element contain?
  • What does review-type contain?
  • Shouldn’t minOccurs and maxOccurs be present for all elements to make things more clear?
  • What does the value attribute of the rating element mean?
  • What does the escaped attribute of the description element mean?
Categories/tags: review
PermaLink Comments TrackBacksTrackback URL

Comments

Please enter Your Comments

Name:

Email:

Location:

URL:

Smileys

Remember my personal information

Notify me of follow-up comments?

Please enter the word you see in the image below: