Structured-Data-JSON-LD icon indicating copy to clipboard operation
Structured-Data-JSON-LD copied to clipboard

Why are WebPage and WebSite in an array, vs WebSite.hasPart: [WebPage, ...]?

Open ThomasDotCodes opened this issue 5 years ago • 1 comments

To state practically, why this: https://github.com/JayHoltslander/Structured-Data-JSON-LD/blob/master/WebSite.json#L3-L13

	{
		"@context": "http://schema.org",
		"@type": "Webpage",
		"specialty": "CNBC homepage, stock markets, business news, financial news",
		"mainContentOfPage": {
			"@context": "http://schema.org/",
			"@type": "WebPageElement",
			"cssSelector": ".body-content"
		},
		"primaryImageOfPage": "https://placehold.it/640x480"
	},

Instead of

@context": "http://schema.org",
"@type": "WebSite",
"hasPart": [
   webpageDefFromExampleAbove,
  ...footerSidebarAndHeaderElements,
]

ThomasDotCodes avatar Dec 17 '19 23:12 ThomasDotCodes

The reason I ask is a more complicated example, say you had this chain of items:

a Character (person) featured on a VisualArtwork (comic page) within a ComicStory, within a ComicIssue, within a Book, within a BookSeries, within a WebPage, within a WebSite...

Would you just define all of these types as first level items within a 1D array (as the Webpage/WebSite example cited in original post)? Or would it be better to nest everything into a single WebSite object?

ThomasDotCodes avatar Dec 17 '19 23:12 ThomasDotCodes