- From: Gregg Kellogg <gregg@greggkellogg.net>
- Date: Tue, 11 Jun 2013 08:50:49 -0700
- To: Stéphane Corlosquet <scorlosquet@gmail.com>
- Cc: Jarno van Driel <jarno@quantumspork.nl>, public-vocabs@w3.org, Egor Antonov <elderos@yandex-team.ru>
- Message-Id: <5D8C20A4-D26E-45B9-B8C6-DEF2B390689F@greggkellogg.net>
On Jun 10, 2013, at 7:31 PM, Stéphane Corlosquet <scorlosquet@gmail.com> wrote:
> Hi Jarno and all.
>
> I quite like Jarno's nested example which is also the same as the proposal from Egor / Yandex at http://www.w3.org/wiki/WebSchemas/Breadcrumbs. The advantage of the current proposal is that it solves all the problems for (1) multiple breadcrumb chains and (2) can be encoded in both microdata and RDFa Lite in a very similar fashion (which is not the case for the ordered approach). Also, both syntaxes are parsed today by Google's parser (see below).
>
> Here is the example in microdata (copied straight from the proposal):
>
> <div itemscope itemtype="http://schema.org/WebPage">
> <!--First chain-->
> <div itemprop="breadcrumb" itemscope itemtype="http://schema.org/Breadcrumb">
> <a itemprop="url" href="/category/books">
> <span itemprop="name">Books</span>
> </a>
> <!--Second level of the first chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/Breadcrumb">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> </span>
> </div>
> <!--Second chain-->
> <div itemprop="breadcrumb" itemscope itemtype="http://schema.org/Breadcrumb">
> <a itemprop="url" href="/category/bicycles">
> <span itemprop="name">Bicycles</span>
> </a>
> <!--Second level of the second chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/Breadcrumb">
> <!--Last element is not a hyperlink in html-->
> <!--but it has a hyperlink in microdata markup-->
> <span itemprop="name">For kids</span>
> <link itemprop="url" href="/category/bicycles/three-wheeled"/>
> </span>
> </div>
> </div>
>
>
> and the same example translated into RDFa Lite by simply renaming the attributes and moving the http://schema.org/ piece into the vocab attribute:
>
> <div vocab="http://schema.org/" typeof="WebPage">
> <!--First chain-->
> <div property="breadcrumb" typeof="Breadcrumb">
> <a property="url" href="/category/books">
> <span property="name">Books</span>
> </a>
> <!--Second level of the first chain-->
> <span property="child" typeof="Breadcrumb">
> <a property="url" href="/category/books/classics">
> <span property="name">Boring classics</span>
> </a>
> </span>
> </div>
> <!--Second chain-->
> <div property="breadcrumb" typeof="Breadcrumb">
> <a property="url" href="/category/bicycles">
> <span property="name">Bicycles</span>
> </a>
> <!--Second level of the second chain-->
> <span property="child" typeof="Breadcrumb">
> <!--Last element is not a hyperlink in html-->
> <!--but it has a hyperlink in microdata markup-->
> <span property="name">For kids</span>
> <link property="url" href="/category/bicycles/three-wheeled"/>
> </span>
> </div>
> </div>
>
> Both snippets above work in the Google Rich Snippet testing tool [1], and you can try to paste the second snippet in the RDFa play tool [2] to view a nice diagram of the breadcrumbs structure.
The difference is that microdata creates an implicit order for multiple values of breadcrumb, where RDFa does not. This could be solved using the @inlist attribute from RDFa 1.1, which is not part of RDFa Lite 1.1. My processor interprets the above example as follows:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfa: <http://www.w3.org/ns/rdfa#> .
@prefix schema: <http://schema.org/> .
<> rdfa:usesVocabulary schema: .
[ a schema:WebPage;
schema:breadcrumb
[ a schema:Breadcrumb;
schema:child
[ a schema:Breadcrumb;
schema:name "Boring classics";
schema:url </category/books/classics>];
schema:name "Books";
schema:url </category/books>],
[ a schema:Breadcrumb;
schema:child
[ a schema:Breadcrumb;
schema:name "For kids";
schema:url </category/bicycles/three-wheeled>];
schema:name "Bicycles";
schema:url </category/bicycles>]
] .
Note that schema:breadcrumb has two values, which are unordered in JSON-LD. If I instead add @inlist, as follows:
<div vocab="http://schema.org/" typeof="WebPage">
<!--First chain-->
<div property="breadcrumb" typeof="Breadcrumb" inlist>
<a property="url" href="/category/books">
<span property="name">Books</span>
</a>
<!--Second level of the first chain-->
<span property="child" typeof="Breadcrumb" inlist>
<a property="url" href="/category/books/classics">
<span property="name">Boring classics</span>
</a>
</span>
</div>
<!--Second chain-->
<div property="breadcrumb" typeof="Breadcrumb" inlist>
<a property="url" href="/category/bicycles">
<span property="name">Bicycles</span>
</a>
<!--Second level of the second chain-->
<span property="child" typeof="Breadcrumb" inlist>
<!--Last element is not a hyperlink in html-->
<!--but it has a hyperlink in microdata markup-->
<span property="name">For kids</span>
<link property="url" href="/category/bicycles/three-wheeled"/>
</span>
</div>
</div>
I get ordered breadcrumbs:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfa: <http://www.w3.org/ns/rdfa#> .
@prefix schema: <http://schema.org/> .
<> rdfa:usesVocabulary schema: .
[ a schema:WebPage;
schema:breadcrumb (
[ a schema:Breadcrumb;
schema:child (
[ a schema:Breadcrumb;
schema:name "Boring classics";
schema:url </category/books/classics>]
);
schema:name "Books";
schema:url </category/books>]
[ a schema:Breadcrumb;
schema:child (
[ a schema:Breadcrumb;
schema:name "For kids";
schema:url </category/bicycles/three-wheeled>]);
schema:name "Bicycles";
schema:url </category/bicycles>]
)
] .
Gregg
> Steph.
>
> [1] http://www.google.com/webmasters/tools/richsnippets
> [2] http://rdfa.info/play/
>
>
> On Mon, Jun 10, 2013 at 7:51 PM, Jarno van Driel <jarno@quantumspork.nl> wrote:
> To be a bit more clear where my point is going. (My previous response
> was a bit incomplete).
>
> ------------------------------------------------------
>
> In case the proposal is taken as a base (Nested):
>
> <!--First level of the first chain-->
> <p itemprop="breadcrumb" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books">
> <span itemprop="name">Books</span>
> </a>
> <!--Second level of the first chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> <!--Third level of the first chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> </span>
> </span>
> </p>
>
> <!--First level of the second chain-->
> <p itemprop="breadcrumb" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books">
> <span itemprop="name">Books</span>
> </a>
> <!--Second level of the second chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> <!--Third level of the second chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> </span>
> </span>
> </p>
>
> ------------------------------------------------------
>
> And in case the data-vocabulary style is taken as a base (Ordered):
>
> <!--First level of the first chain-->
> <p itemprop="breadcrumb" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books">
> <span itemprop="name">Books</span>
> </a>
> <!--Second level of the first chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> <!--Third level of the first chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> </span>
> </p>
>
> <!--First level of the second chain-->
> <p itemprop="breadcrumb" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books">
> <span itemprop="name">Books</span>
> </a>
> <!--Second level of the second chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> <!--Third level of the second chain-->
> <span itemprop="child" itemscope itemtype="http://schema.org/WebPage">
> <a itemprop="url" href="/category/books/classics">
> <span itemprop="name">Boring classics</span>
> </a>
> </span>
> </p>
>
> ------------------------------------------------------
>
> The way I see it imho - either way doesn't need a new type. In both
> cases it's resolved by adding a new property to WebPage.
>
>
>
>
> --
> Steph.
>
>
>
>
>
Received on Tuesday, 11 June 2013 15:51:21 UTC