W3C home > Mailing lists > Public > public-schemaorg@w3.org > May 2016

Re: SearchAction vs FindAction, and OpenSearch totalResults equivalent

From: Jarno van Driel <jarnovandriel@gmail.com>
Date: Tue, 31 May 2016 16:38:19 +0200
Message-ID: <CADK2AU2QNkpVDBNJe-80-OjvKpBR7hKUeefXQOWn1HDnDJjGLQ@mail.gmail.com>
To: Tim Strehle <tim@strehle.de>
Cc: "schema.org Mailing List" <public-schemaorg@w3.org>
>
> *"I don’t think I fully understand why you went with a top-level ItemList"*


I guess that's just a habit. I normally markup web pages and on things like
product listing pages it's the schema.org/ItemList that's the main entity
of the page. Something that wasn't possible to express until some months
ago because there wasn't a 'mainEntityOfPage' property. Meaning the only
way one could make it clear to search engines which entity they should
consider being the 'main entity' was to model the graph so that the 'main
entity' also was the top level entity.

Now that 'mainEntity' and 'mainEntityOfPage' exist it doesn't really matter
which entity is the top level entity, so the markup could have been
expressed in a different order as well, eg:

<script type="application/ld+json">
{
  "@context":"http://schema.org",
  "@id":"#MainEntity",
  "@type":"SearchAction",
  "actionStatus":"CompletedActionStatus",
  "query":"john doe",
  "result":
  {
    "@type":"ItemList",
    "numberOfItems":35,
    "itemListOrder":"ItemListOrderDescending",
    "mainEntityOfPage":
    {
      "@type":"SearchResultsPage",
      "url":"http://example.com/search?page=2",
      "potentialAction":
      [
      {
        "@type":"SearchAction",
        "name":"Did you mean 'jane doe'?",
        "target":
        {
          "@type":"EntryPoint",
          "urlTemplate":"http://example.com/?q=jane+doe"
        }
      },
      {
        "@type":"SearchAction",
        "name":"See also: 'dole'",
        "target":
        {
          "@type":"EntryPoint",
          "urlTemplate":"http://example.com/?q=dole"
        }
      }
      ]
    },
    "itemListElement":
    [
    {
      "@type":"ListItem",
      "@id":"#FirstSearchResult",
      "previousItem":"http://example.com/search?page=1#LastSearchResult",
      "position":1,
      "item":
      {
       "@type":"ImageObject",
        "name":"Photo of Jane Doe"
      }
    },
    {
      "@type":"ListItem",
      "position":2,
      "item":
      {
        "@type":"ImageObject",
        "name":"Photo of John Doe"
      }
    },
    {
      "@type":"ListItem",
      "@id":"#LastSearchResult",
      "nextItem":"http://example.com/search?page=3#FirstSearchResult",
      "position":3,
      "item":
      {
        "@type":"ImageObject",
        "name":"Photo of John Doe"
      }
    }
    ]
  }
}
</script>



2016-05-31 16:20 GMT+02:00 Tim Strehle <tim@strehle.de>:

> Hi Jarno,
>
> thanks a lot for taking the time to work out a solution!
>
> So you’re using an ItemList which allows you to use the numberOfItems
> property. Makes sense to me.
>
> I don’t think I fully understand why you went with a top-level ItemList
> (linked to a SearchResultsPage via mainEntityOfPage) instead of a top-level
> SearchAction with an ItemList in its result property. What was your
> reasoning behind that? (I’m a schema.org newbie, so I’m probably missing
> something obvious.)
>
> Thanks again,
> Tim
>
> Am 31.05.2016 um 13:00 schrieb Jarno van Driel <jarnovandriel@gmail.com>:
>
> Hi Tim,
>
> I just read your blog post:
> https://www.strehle.de/tim/weblog/archives/2016/05/30/1593 and had a go
> at it. Does the following work for you?
>
> <script type="application/ld+json">
> {
>   "@context":"http://schema.org",
>   "@id":"#MainEntity",
>   "@type":"ItemList",
>   "mainEntityOfPage":
>   {
>     "@type":"SearchResultsPage",
>     "url":"http://example.com/search?page=2",
>     "potentialAction":
>     [
>     {
>       "@type":"SearchAction",
>       "actionStatus":"CompletedActionStatus",
>       "query":"john doe",
>       "result":
>       {
>         "@id":"#MainEntity"
>       }
>     },
>     {
>       "@type":"SearchAction",
>       "name":"Did you mean 'jane doe'?",
>       "target":
>       {
>         "@type":"EntryPoint",
>         "urlTemplate":"http://example.com/?q=jane+doe"
>       }
>     },
>     {
>       "@type":"SearchAction",
>       "name":"See also: 'dole'",
>       "target":
>       {
>         "@type":"EntryPoint",
>         "urlTemplate":"http://example.com/?q=dole"
>       }
>     }
>     ]
>   },
>   "numberOfItems":35,
>   "itemListOrder":"ItemListOrderDescending",
>   "itemListElement":
>   [
>   {
>     "@type":"ListItem",
>     "@id":"#FirstSearchResult",
>     "previousItem":"http://example.com/search?page=1#LastSearchResult",
>     "position":1,
>     "item":
>     {
>       "@type":"ImageObject",
>       "name":"Photo of Jane Doe"
>     }
>   },
>   {
>     "@type":"ListItem",
>     "position":2,
>     "item":
>     {
>       "@type":"ImageObject",
>       "name":"Photo of John Doe"
>     }
>   },
>   {
>     "@type":"ListItem",
>     "@id":"#LastSearchResult",
>     "nextItem":"http://example.com/search?page=3#FirstSearchResult",
>     "position":3,
>     "item":
>     {
>       "@type":"ImageObject",
>       "name":"Photo of John Doe"
>     }
>   }
>   ]
> }
> </script>
>
>
>
Received on Tuesday, 31 May 2016 14:38:48 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:12:25 UTC