Свойство schema.org ?
Содержание: Описание, Обратное свойство, Какие должны быть типы, В каких типах используется, Примеры использования.
Свойство mainEntity в Schema.org используется для указания основной сущности, о которой идет речь на веб-странице или в другом творческом произведении. Это свойство помогает структурировать данные и улучшает понимание содержания страницы как для поисковых систем, так и для пользователей.
Основная цель использования mainEntity заключается в том, чтобы четко обозначить, какой объект или тема является центральной для представленного контента. Это может быть особенно полезно в контексте страниц, где представлено множество информации, например, на страницах с новостями, статьями или описаниями продуктов. Указывая mainEntity, разработчики могут помочь системам обработки данных (таким как поисковые системы) лучше интерпретировать и индексировать содержание страницы.
Свойство mainEntity обычно используется в контексте других свойств Schema.org, чтобы создать более полное и связное описание сущности. Например, если страница содержит информацию о конкретной книге, mainEntity будет указывать на эту книгу, а другие свойства могут предоставлять дополнительные детали, такие как автор, дата публикации и жанр.
В итоге, использование mainEntity способствует более ясному и структурированному представлению информации, что может улучшить видимость и понимание контента в интернете.
Обратное свойство: mainEntityOfPage
Пример заметки или HTML разметки.
<a href="category/books.html">Books</a> >
<a href="category/books-literature.html">Literature & Fiction</a> >
<a href="category/books-classics">Classics</a>
<img src="catcher-in-the-rye-book-cover.jpg"
alt="cover art: red horse, city in background"/>
The Catcher in the Rye - Mass Market Paperback
by <a href="/author/jd_salinger.html">J.D. Salinger</a>
4 stars - 3077 reviews
Price: $6.99
In Stock
Product details
224 pages
Publisher: Little, Brown, and Company - May 1, 1991
Language: English
ISBN-10: 0316769487
Reviews:
5 stars - <b>"A masterpiece of literature" </b>
by John Doe. Written on May 4, 2006
I really enjoyed this book. It captures the essential challenge people face
as they try make sense of their lives and grow to adulthood.
4 stars - <b>"love it LOLOL111!" </b>
by Bob Smith, Written on June 15, 2006
Catcher in the Rye is a fun book. It's a good book to read.
Пример, закодированный в формате Microdata, встроенный в HTML.
<body itemscope itemtype="https://schema.org/WebPage">
...
<div itemprop="breadcrumb">
<a href="category/books.html">Books</a> >
<a href="category/books-literature.html">Literature & Fiction</a> >
<a href="category/books-classics">Classics</a>
</div>
<div itemprop="mainEntity" itemscope itemtype="https://schema.org/Book">
<img itemprop="image" src="catcher-in-the-rye-book-cover.jpg"
alt="cover art: red horse, city in background"/>
<span itemprop="name">The Catcher in the Rye</span> -
<link itemprop="bookFormat" href="https://schema.org/Paperback">Mass Market Paperback
by <a itemprop="author" href="/author/jd_salinger.html">J.D. Salinger</a>
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<span itemprop="ratingValue">4</span> stars -
<span itemprop="reviewCount">3077</span> reviews
</div>
<div itemprop="offers" itemscope itemtype="https://schema.org/Offer">
Price: $<span itemprop="price">6.99</span>
<meta itemprop="priceCurrency" content="USD" />
<link itemprop="availability" href="https://schema.org/InStock">In Stock
</div>
Product details
<span itemprop="numberOfPages">224</span> pages
Publisher: <span itemprop="publisher">Little, Brown, and Company</span> -
<meta itemprop="datePublished" content="1991-05-01">May 1, 1991
Language: <span itemprop="inLanguage">English</span>
ISBN-10: <span itemprop="isbn">0316769487</span>
Reviews:
<div itemprop="review" itemscope itemtype="https://schema.org/Review">
<span itemprop="reviewRating">5</span> stars -
<b>"<span itemprop="name">A masterpiece of literature</span>"</b>
by <span itemprop="author">John Doe</span>,
Written on <meta itemprop="datePublished" content="2006-05-04">May 4, 2006
<span itemprop="reviewBody">I really enjoyed this book. It captures the essential
challenge people face as they try make sense of their lives and grow to adulthood.</span>
</div>
<div itemprop="review" itemscope itemtype="https://schema.org/Review">
<span itemprop="reviewRating">4</span> stars -
<b>"<span itemprop="name">A good read.</span>" </b>
by <span itemprop="author">Bob Smith</span>,
Written on <meta itemprop="datePublished" content="2006-06-15">June 15, 2006
<span itemprop="reviewBody">Catcher in the Rye is a fun book. It's a good book to read.</span>
</div>
</div>
...
</body>
Пример, закодированный в формате RDFa, встроенный в HTML.
<body vocab="https://schema.org/" typeof="WebPage">
...
<div property="breadcrumb">
<a href="category/books.html">Books</a> >
<a href="category/books-literature.html">Literature & Fiction</a> >
<a href="category/books-classics">Classics</a>
</div>
<div property="mainEntity" typeof="Book">
<img property="image" src="catcher-in-the-rye-book-cover.jpg"
alt="cover art: red horse, city in background"/>
<span property="name">The Catcher in the Rye</span> -
<link property="bookFormat" href="https://schema.org/Paperback">Mass Market Paperback
by <a property="author" href="/author/jd_salinger.html">J.D. Salinger</a>
<div property="aggregateRating" typeof="AggregateRating">
<span property="ratingValue">4</span> stars -
<span property="reviewCount">3077</span> reviews
</div>
<div property="offers" typeof="Offer">
Price: $<span property="price">6.99</span>
<meta property="priceCurrency" content="USD" />
<link property="availability" href="https://schema.org/InStock">In Stock
</div>
Product details
<span property="numberOfPages">224</span> pages
Publisher: <span property="publisher">Little, Brown, and Company</span> -
<meta property="datePublished" content="1991-05-01">May 1, 1991
Language: <span property="inLanguage">English</span>
ISBN-10: <span property="isbn">0316769487</span>
Reviews:
<div property="review" typeof="Review">
<span property="reviewRating">5</span> stars -
<b>"<span property="name">A masterpiece of literature</span>"</b>
by <span property="author">John Doe</span>,
Written on <meta property="datePublished" content="2006-05-04">May 4, 2006
<span property="reviewBody">I really enjoyed this book. It captures the essential
challenge people face as they try make sense of their lives and grow to adulthood.</span>
</div>
<div property="review" typeof="Review">
<span property="reviewRating">4</span> stars -
<b>"<span property="name">A good read.</span>" </b>
by <span property="author">Bob Smith</span>,
Written on <meta property="datePublished" content="2006-06-15">June 15, 2006
<span property="reviewBody">Catcher in the Rye is a fun book. It's a good book to read.</span>
</div>
</div>
...
</body>
Пример, закодированный в формате JSON-LD в теге <script> HTML.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"breadcrumb": "Books > Literature & Fiction > Classics",
"mainEntity":{
"@type": "Book",
"author": "/author/jd_salinger.html",
"bookFormat": "https://schema.org/Paperback",
"datePublished": "1991-05-01",
"image": "catcher-in-the-rye-book-cover.jpg",
"inLanguage": "English",
"isbn": "0316769487",
"name": "The Catcher in the Rye",
"numberOfPages": "224",
"offers": {
"@type": "Offer",
"availability": "https://schema.org/InStock",
"price": "6.99",
"priceCurrency": "USD"
},
"publisher": "Little, Brown, and Company",
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "4",
"reviewCount": "3077"
},
"review": [
{
"@type": "Review",
"author": "John Doe",
"datePublished": "2006-05-04",
"name": "A masterpiece of literature",
"reviewBody": "I really enjoyed this book. It captures the essential challenge people face as they try make sense of their lives and grow to adulthood.",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5"
}
},
{
"@type": "Review",
"author": "Bob Smith",
"datePublished": "2006-06-15",
"name": "A good read.",
"reviewBody": "Catcher in the Rye is a fun book. It's a good book to read.",
"reviewRating": "4"
}
]
}
}
</script>
Структурированное представление примера JSON-LD.
Пример заметки или HTML разметки.
<div>
<h1>Cath's Cafe</h1>
<p>Open: Daily from 11:00am till 8pm</p>
<p>Phone: 555-0100-3344</p>
<p>View <a href="/menu">our menu</a>.</p>
</div>
Пример, закодированный в формате Microdata, встроенный в HTML.
<div itemid="http://cathscafe.example.com/" itemscope itemtype="https://schema.org/WebPage">
<div itemprop="mainEntity" itemscope itemtype="https://schema.org/Restaurant" itemid="#thecafe">
<h1 itemprop="name">Cath's Cafe</h1>
<p>Open: <span itemprop="openingHours" content="Mo,Tu,We,Th,Fr,Sa,Su 11:00-20:00">Daily from 11:00am till 8pm</span></p>
<p>Phone: <span itemprop="telephone" content="+155501003344">555-0100-3344</span></p>
<p>View <a itemprop="hasMenu" href="/menu">our menu</a>.</p>
</div>
</div>
Пример, закодированный в формате JSON-LD в теге <script> HTML.
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "WebPage",
"@id": "http://cathscafe.example.com/",
"mainEntity": {
"@type": "Restaurant",
"name": "Cath's Cafe",
"openingHours": "Mo,Tu,We,Th,Fr,Sa,Su 11:00-20:00",
"telephone": "+155501003344",
"hasMenu": "/menu"
}
}
</script>
Структурированное представление примера JSON-LD.