What is the proper way to identify the main content of a web page for linked data purposes?

171 views Asked by At

I'm working on a website and I want to follow all of the best practices for linked data.

I'm using JSON-LD and Schema.org to provide semantic metadata about the content of the page, but there doesn't appear to be any way to specify the tag on the page that contains the main content (rather than the nav bar, footer, etc.).

The site has multiple content types (articles, videos, recipes, etc.) and I'd like to make it easy for computers to be able to parse out the content. What is the right way to do this?

1

There are 1 answers

3
unor On BEST ANSWER

Instead of saying "the main content is in that HTML element"¹, you could provide the entities that are the main content.

With the mainEntity property, you convey which are the primary entities on the WebPage. And within these entities, you provide their content in suitable properties (depending on the type). For example:


¹ Something similar would be possible with the mainContentOfPage property, which takes WebPageElement entities as value. But WebPageElement doesn’t allow you to point to an HTML element, you would still have to provide the actual content via suitable properties. Anyway, I recommend not to use mainContentOfPage (see my issue).