Search code examples
htmljsonschemagoogle-rich-snippetsstructured-data

Schema: Is it necessary (or even advisable) to repeat structured data when listing nested objects?


We are working on the JSON structured data for a 1-page website. This single page gives a lot of data about a local business (incl. address, pricing, reviews, services, etc.). We have this as the json for the structured data for the business itself:

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "LocalBusiness",
  "name": "Example Business",
  "url": "https://www.example.com/",
  "logo": "https://www.example.com/logo.jpg",
  "areaServed": {
    "@type": "City",
    "name": "New York"
  },
  "image": "https://www.example.com/image.jpg",
  "description": "Good description of example business",
  "telephone": "+123456789",
  "priceRange": "$$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "101 Main Road",
    "addressLocality": "Hereabouts",
    "addressRegion": "New York",
    "postalCode": "AB123456",
    "addressCountry": "US"
  },
  "aggregateRating": {
   "@type": "AggregateRating",
     "ratingValue": "4.95",
     "reviewCount": "100"
  },
  "openingHoursSpecification": [
  {
    "@type": "OpeningHoursSpecification",
    "dayOfWeek": [
      "Monday",
      "Tuesday",
      "Wednesday",
      "Thursday",
      "Friday"
    ],
    "opens": "09:00",
    "closes": "17:00"
  }
  ],
  "contactPoint": {
    "@type": "ContactPoint",
    "telephone": "+123456789",
    "contactType": "Sales"
  }
}
</script>

We also want to add structured data for the services offered and listed on the page:

<script type='application/ld+json'> 
  {
  "@context": "https://www.schema.org",
  "@type": "Service",
  "serviceType": "The Main Services",
  "provider": {
  "@type": "LocalBusiness",
  "name": "Example Business",
  "url": "https://www.example.com/",
  "logo": "https://www.example.com/logo.jpg",
  "areaServed": {
    "@type": "City",
    "name": "New York"
  },
  "image": "https://www.example.com/image.jpg",
  "description": "Good description of example business",
  "telephone": "+123456789",
  "priceRange": "$$$",
  "address": {
    "@type": "PostalAddress",
    "streetAddress": "101 Main Road",
    "addressLocality": "Hereabouts",
    "addressRegion": "New York",
    "postalCode": "AB123456",
    "addressCountry": "US"
  },
  "hasOfferCatalog": {
    "@type": "OfferCatalog",
    "name": "The Main Services",
    "itemListElement": [
      {
        "@type": "OfferCatalog",
        "name": "First Main Services",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1A",
			  "url": "https://www.example.com/service1A"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1B",
			  "url": "https://www.example.com/service1B"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 1C",
			  "url": "https://www.example.com/service1C"
            }
          }
        ]
	},
    {
        "@type": "OfferCatalog",
        "name": "Second Main Services",
        "itemListElement": [
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 2A",
			  "url": "https://www.example.com/service2A"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": "Service 2B",
			  "url": "https://www.example.com/service2B"
            }
          },
          {
            "@type": "Offer",
            "itemOffered": {
              "@type": "Service",
              "name": " 2C",
			  "url": "https://www.example.com/service2C"
            }
          }
        ]}
    ]
  }
}
}
 </script>

My question is about the service "provider" section. In this section I am having to repeat a lot of the data from the "localbusiness" @type from the 1st script.

Is it necessary to have both the "localbusiness" (first script) if I am then repeating the data in the "service" script (as far as Google is concerned)?

Can I instead remove the 1st script and just put all that info into the services one? Will Google be able to pick up and use the localbusiness data from there when they are looking for structured data about the business itself?

Additionally, when I start adding reviews data I will need to include the localbusiness again as the "itemreviewed" property, meaning I will be repeating everything again! I will basically be repeating the "localbusiness" data for each and every review. That really starts to look a bit spammy.

Could anyone help shed some light on how Google views this data and how much data should be there or repeated?


Solution

  • You can detail an entity once and include an @id.

    Then you can reference that @id in places that refer to the same entity. This saves you having to repeat all the data, saves space, and helps clarify that all places are talking about the same thing.

    e.g.

    "provider": {
      "@type": "LocalBusiness",
      "@id": "https://example.com/#LocalBusiness"
    }