Re: SearchAction vs FindAction, and OpenSearch totalResults equivalent

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>

2016-05-17 11:58 GMT+02:00 Tim Strehle <tim@strehle.de>:

> Hi,
>
> I’m a schema.org newbie struggling with describing image searches and
> search results. I.e. there should be several endpoints to which one can
> send a query (and pagination info like search result page size and number),
> and get back a list of matching ImageObject items, along with some result
> metadata (number of total results, page size and number).
>
> For some background, see my “RDF and schema.org for DAM interoperability”
> blog post:
>
>  https://www.strehle.de/tim/weblog/archives/2015/05/08/1762
>
> I think I understand how to use input properties (as described in
> http://schema.org/docs/actions.html ) to describe the required and
> optional query (search form) fields.
>
> But how would I best return search results? Should I use
> https://schema.org/SearchAction or https://schema.org/FindAction (both
> with CompletedActionStatus)? What’s the difference?
>
> Would I return an array of ImageObject items directly within the result
> property?
>
> If so, where would I put result metadata like the total number of results?
>
> And is it true that there’s no schema.org equivalent for the OpenSearch
> elements “totalResults”, “startIndex” and “itemsPerPage”? See:
>
>  http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_5#Elements
>
> For pagination, I guess I could somehow link to potential “next page” and
> “previous page” actions. Where would I put them in my search results?
>
> Sorry for so many questions in one post. Any input is appreciated :)
>
> Thanks,
> Tim Strehle
>
>

Received on Tuesday, 31 May 2016 11:00:50 UTC