Description
Given this HTML:
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> </head> <body> <div itemscope itemtype="http://schema.org/Product"> <span itemprop="name">Product Name</span> <div itemprop="review" itemscope itemtype="http://schema.org/Review"> <span itemprop="name">Name</span> - by <span itemprop="author">Author</span>, <span itemprop="datePublished" content="2011-04-01">April 1, 2011</span> <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"> <span itemprop="worstRating" content="1"></span> <span itemprop="ratingValue">1</span>/<span itemprop="bestRating">5</span>stars </div> <span itemprop="description">Desc</span> </div> </div> </body> </html>
And the following Java:
List<Node> itemNodes = MicrodataParser.getTopLevelItemScopeNodes(document); MicrodataParser microdataParser = new MicrodataParser(document); System.out.println(microdataParser.getItemScope(itemNodes.get(0)).toJSON()));
The output of of the 2.1 was OK (I removed xpath/refs from output):
{ "type": "http://schema.org/Product", "properties": [ { "name": "review", "value": { "content": { "type": "http://schema.org/Review", "properties": [ { "name": "datePublished", "value": { "content": "April 1, 2011", "type": "Plain" } }, { "name": "author", "value": { "content": "Author", "type": "Plain" } }, { "name": "name", "value": { "content": "Name", "type": "Plain" } }, { "name": "description", "value": { "content": "Desc", "type": "Plain" } }, { "name": "reviewRating", "value": { "content": { "type": "http://schema.org/Rating", "properties": [ { "name": "bestRating", "value": { "content": "5", "type": "Plain" } }, { "name": "ratingValue", "value": { "content": "1", "type": "Plain" } }, { "name": "worstRating", "value": { "content": "Null", "type": "Plain" } } ] }, "type": "Nested" } } ] }, "type": "Nested" } }, { "name": "name", "value": { "content": "Product Name", "type": "Plain" } } ] }
But with the 2.2 the ratings's properties are directly in product:
{ "type": "http://schema.org/Product", "properties": [ { "name": "datePublished", "value": { "content": "2011-04-01", "type": "Plain" } }, { "name": "bestRating", "value": { "content": "5", "type": "Plain" } }, { "name": "review", "value": { "content": { "type": "http://schema.org/Review", "properties": [ { "name": "datePublished", "value": { "content": "2011-04-01", "type": "Plain" } }, { "name": "bestRating", "value": { "content": "5", "type": "Plain" } }, { "name": "author", "value": { "content": "Author", "type": "Plain" } }, { "name": "ratingValue", "value": { "content": "1", "type": "Plain" } }, { "name": "name", "value": { "content": "Name", "type": "Plain" } }, { "name": "description", "value": { "content": "Desc", "type": "Plain" } }, { "name": "reviewRating", "value": { "content": { "type": "http://schema.org/Rating", "properties": [ { "name": "bestRating", "value": { "content": "5", "type": "Plain" } }, { "name": "ratingValue", "value": { "content": "1", "type": "Plain" } }, { "name": "worstRating", "value": { "content": "1", "type": "Plain" } } ] }, "type": "Nested" } }, { "name": "worstRating", "value": { "content": "1", "type": "Plain" } } ] }, "type": "Nested" } }, { "name": "author", "value": { "content": "Author", "type": "Plain" } }, { "name": "ratingValue", "value": { "content": "1", "type": "Plain" } }, { "name": "name", "value": { "content": "Product Name", "type": "Plain" } }, { "name": "name", "value": { "content": "Name", "type": "Plain" } }, { "name": "description", "value": { "content": "Desc", "type": "Plain" } }, { "name": "reviewRating", "value": { "content": { "type": "http://schema.org/Rating", "properties": [ { "name": "bestRating", "value": { "content": "5", "type": "Plain" } }, { "name": "ratingValue", "value": { "content": "1", "type": "Plain" } }, { "name": "worstRating", "value": { "content": "1", "type": "Plain" } } ] }, "type": "Nested" } }, { "name": "worstRating", "value": { "content": "1", "type": "Plain" } } ] }
Attachments
Issue Links
- duplicates
-
ANY23-167 Microdata itemscope properties incorrectly attached
- Resolved