1

The schema.org/Product type has a material property for “[the] material that something is made from.” I'd like to describe the materials that each part of a product is made from.

For example, suppose I have a carbon fiber bike with wood handles and an aluminium fork (putting aside whether or not such a beast makes any sense!). I can describe the base material of the bike like so.

{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "A Bike",
  "material": "Carbon Fiber"
}

But, how should I describe the material of the handles and fork? The material property expects Product or Text or URL as values, so I don't think I can say that the bike in general is carbon fiber, but the fork is aluminum. Right now, I'm placing the extra data under additionalProperty.

{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": "A Bike",
  "material": "Carbon Fiber",
  "additionalProperty": [
    {
      "@type": "PropertyValue",
      "name": "fork-material",
      "value": "Aluminum"
    },
    {
      "@type": "PropertyValue",
      "name": "handle-material",
      "value": "Wood"
    }
  ]
}

Is there a better way to describe the materials of parts of a product?

King Chung Huang
  • 5,026
  • 28
  • 24
  • Let's imagine: you are manufacturing more than one bike. Further, each bike shares some components with other bikes; each component is made from material used by other components. Each material is `@Thing` (using broadest possible term here) and has a unique ID. Each component has unique ID and `hasPart` identifier for a material. Alternatively, material `@id` isConsumableFor the component `@id`. Essential idea: aggregations are combinations of aggregations. Each `@Thing` is in "inventory" and used/reused when specifying the largest aggregation - a specific `@Product` (a bike). – Jay Gray Nov 18 '21 at 12:08
  • If I were to create nodes for each component, can I use the [hasPart](https://schema.org/hasPart) property to associate them with a [Product](https://schema.org/Product), even though it's not declared as a property for `Product`? I'm unclear on how to bring them together. – King Chung Huang Nov 18 '21 at 15:10
  • I was wrong - cannot use `hasPart` for `@Product`. For material, use `isConsumableFor` component. For component, use `isAccessoryOrSparePartFor` bike. Neither `property` has an inverse relationship, so you have to work "bottom up". Reuse comes by assigning each items an `@id`. – Jay Gray Nov 19 '21 at 08:07
  • Also, when describing a material, component, or bike use `@CreativeWork` which links to `@Product` using the property `subjectOf`. You can link an `image` to a specific `@Product` (material, component, bike). – Jay Gray Nov 19 '21 at 08:12
  • Just stumbled on this, for your amusement: https://codepen.io/mrtrimble/pen/GRqgNZZ – Jay Gray Nov 20 '21 at 11:23
  • Thanks for the tips! I've decided to keep using [PropertyValue](https://schema.org/PropertyValue) with [additionalProperty](https://schema.org/additionalProperty) for now. The lack of "has" inverses for [isConsumableFor](https://schema.org/isConsumableFor) and [isAccessoryOrSparePartFor](https://schema.org/isAccessoryOrSparePartFor) is a bit inconvenient for my immediate implementation, but I suspect I can make use of that later with some framing to help. – King Chung Huang Nov 22 '21 at 18:01

0 Answers0