5

The schema.org docs refer sometimes to "pointers". E.g. Product schema has the property isSimilarTo.

I do understand, that I could use a Productor a Service directly. E.g.:

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "BMW",
  "isSimilarTo": {
    "@type": "Product",
    "name": "Mercedes Benz"
  },
  "offers": {
    "@type": "Offer",
    "priceCurrency": "EUR",
    "price": "100000.00"
  }
}
</script>

Is this the only and the correct way using and interpreting the term 'pointer' in this context? For a pointer, I would rather expect some value (an ID or an URL or similar) just pointing to another product or service.

unor
  • 92,415
  • 26
  • 211
  • 360
Stefan
  • 576
  • 7
  • 27
  • 1
    I removed your last question, as it’s not directly related to the primary question. If you want to provide multiple `Product` items for the `isSimilarTo` property, you can use an array ([see example in my answer to another question](http://stackoverflow.com/a/30506476/1591669)). – unor Jan 17 '17 at 13:30

1 Answers1

6

Your example is correct, and it follows Schema.org’s recommendation for the expected value of the isSimilarTo property. But Schema.org allows URI values for each property, even for those that don’t explicitly list URL as expected value.

So you could also use:

  "isSimilarTo": {
    "@id": "https://example.com/products/mercedes-benz#this"
  },

Note that consumers (like Google) don’t necessarily follow these references. You could also use both ways: provide the data (or some of it) on the current page, and refer to the item’s URI:

   "isSimilarTo": {
    "@id": "https://example.com/products/mercedes-benz#this",
    "@type": "Product",
    "name": "Mercedes Benz",
    "url": "https://example.com/products/mercedes-benz"
  },
unor
  • 92,415
  • 26
  • 211
  • 360
  • Thanks @unor. Does the fragment identifier `#this` has any special meaning? – Stefan Jan 17 '17 at 17:33
  • Again @unor: Could you point me to the part of the docs, where I can find this kind of information. I have difficulties to find the right documentation. – Stefan Jan 17 '17 at 17:37
  • 1
    @Stefan: See "Expected types vs text." under [Expected types, text, and URLs](http://schema.org/docs/gs.html#schemaorg_expected). // About `#this`: it’s a way to differentiate between the thing itself and the page about this thing. "this" has no special meaning, it’s just a convention (could also be "product" or whatever). To read more about this, see [my answer to the question *@id vs. URL for linking JSON-LD nodes*](http://stackoverflow.com/a/41099116/1591669). – unor Jan 17 '17 at 17:51