Strontium_99
Strontium_99

Reputation: 1813

Structure Schema.org in JSON-LD format for multi branch multi departments

I'm pretty sure this is purely a syntax issue, but I'm trying to setup some Schema.org in JSON-LD format for a customer that has 2 branches and each branch has 2 main departments.

The problem I'm hitting is the opening hours for each department. This is my code:

{
  "@context": {
    "@vocab": "http://schema.org/"
  },
  "@graph": [{
      "@id": "http://example.com",
      "@type": "Organization",
      "name": "Group Name",
      "url": "http://example.com",
      "logo": "http://example.com/images/logo.png",
      "image": "http://example.com/images/logo.png",
      "description": "Some information about the customer",
      "currenciesAccepted": "GBP",
      "sameAs": ["https://www.facebook.com/[customers facebook page/"]
    },
    {
      "@type": "AutoDealer",
      "parentOrganization": {
        "name": "Group Name"
      },
      "name": "Banch 1",
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "street",
        "addressLocality": "locality",
        "addressRegion": "region",
        "postalCode": "post code",
        "telephone": "phone number"
      },
      "department": [{
          "name": "Sales Department",
          "openingHours": ["Mo-Fr 9:00 - 19:00", "Sa 9:00 - 17:00"]
        },
        {
          "name": "Service Department",
          "openingHours": ["Mo-Fr 7:30 - 18:00", "Sa 9:00 - 12:00"]
        }
      ],
      "hasmap": "google map url"
    },
    {
      "@type": "AutoDealer",
      "parentOrganization": {
        "name": "Group Name"
      },
      "name": "Branch 2",
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "street",
        "addressLocality": "locality",
        "addressRegion": "region",
        "postalCode": "post code",
        "telephone": "phone number"
      },
      "department": [{
          "name": "Sales Department",
          "openingHours": ["Mo-Fr 9:00 - 19:00", "Sa 9:00 - 17:00"]
        },
        {
          "name": "Service Department",
          "openingHours": ["Mo-Fr 7:30 - 18:00", "Sa 9:00 - 12:00"]
        }
      ],
      "hasmap": "Google map url"
    }
  ]
}

And when I test it on Google's structured data testing tool, I get the error:

The property openingHours is not recognized by Google for an object of type Organization.

Upvotes: 1

Views: 1681

Answers (1)

unor
unor

Reputation: 96697

The openingHours property can be used for CivicStructure and LocalBusiness types.

You don’t specify the type of the node you are providing this property for:

{
  "name": "Sales Department",
  "openingHours": ["Mo-Fr 9:00 - 19:00", "Sa 9:00 - 17:00"]
},

Google’s testing tool seems to assume that this node is of the type Organization, as it’s the value expected by the department property. Because openingHours can’t be used on Organization (but on its child type LocalBusiness), Google gives this error.

So to fix this, add the intended type, e.g. something like:

{
  "@type": "AutoDealer",
  "name": "Sales Department",
  "openingHours": ["Mo-Fr 9:00 - 19:00", "Sa 9:00 - 17:00"]
},

Upvotes: 1

Related Questions