Tim
Tim

Reputation: 424

How to specify multiple options (Car) in schema.org Json-LD?

I'm trying to describe a Car object that has multiple options regarding the engine or gearbox, that is referenced by an aggregateOffer as the itemOffered.

I want to indicate that the said Car can have either a manual or automatic gearbox, can be new or used, accept diesel or other fuels etc. The two options I see are the following :

1) Make a list with possible gearboxes and other options

"itemOffered" : {

    "vehicleTransmission": ["Automatic","Manual"],
    "fuelType": ["Diesel", "Essence"]

}

Would this be interpreted as follows : the car has either a manual OR an automatic gearbox ? I'm affraid the semantic behind this would suggest that the said car has both.

2) Make a list of cars with all possibilities

"itemOffered": [

{
        "@type": "Car1",
        "fuelType": "Essence",
        "vehicleTransmission": "Automatic" },
{
        "@type": "Car2",
        "fuelType": "Essence",
        "vehicleTransmission": "Manual" }
]

But this would be potentially very big, as I have multiple car offers with several different options, I would end up listing my entire database. To clarify, the point of this Car object is to be attached to an aggregateOffer on a page where only the aggregateOffer is displayed and not every single offer available.

Upvotes: 1

Views: 830

Answers (1)

unor
unor

Reputation: 96607

The second interpretation is correct. If you have one Car with multiple fuelType values, all of these values apply to this Car; they don’t represent alternatives.

Anyway, the AggregateOffer doesn’t seem to be suitable for your case. This type is intended for multiple offers of the same product, not for multiple offers of different (albeit similar) products:

When a single product is associated with multiple offers (for example, the same pair of shoes is offered by different merchants), then AggregateOffer can be used.

If you don’t want to list/repeat so many properties for each Car, you could make use of the ProductModel type. You can link ProductModel items with the isVariantOf property. Each variant model will inherit the features from its base product model, unless you "overwrite" them in the variant model. Each Car would then use the model property to refer to its product model.
However, if you have a specific structured data consumer in mind, they might not support this more complex structure.

Upvotes: 1

Related Questions