Uploaded image for project: 'Apache Any23 (Retired)'
  1. Apache Any23 (Retired)
  2. ANY23-386

Item's properties are in the wrong item since the 2.2

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.2
    • 2.3
    • microdata
    • None

    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

          Activity

            People

              Unassigned Unassigned
              panthony Anthony Pessy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: