Schema.org isConsumableFor Недвижимость в JSON - PullRequest
2 голосов
/ 27 октября 2019

Попытка разобраться, как использовать свойство schema.org isConsumableFor с JSON. Я установил основной продукт как " Raspberry Pi 4 ", а продукт isConsumableFor " Блок питания ".

Фрагмент JSON создан для " Raspberry Pi4":

{
    "@context":"http://schema.org/",
    "@type":"Product",
    "name":"Raspberry Pi 4",
    "image":[
        "raspberry-pi-4-model-b.jpg",
        "raspberry-pi-4-model-b-2.jpg",
    ],
    "description":"Raspberry Pi 4 ...",
    "offers":{
        "@type":"AggregateOffer",
        "offerCount":1,
        "highPrice":"40.00 ",
        "lowPrice":"40.00 ",
        "priceCurrency":"EUR",
        "offers":[
            {
                "@type":"Offer",
                "priceCurrency":"EUR",
                "priceValidUntil":"2019-11-09T21:50:32+01:00",
                "url":"Raspberry-Pi-4-Model-B",
                "price":"40.00 ",
                "itemCondition":"http://schema.org/New",
                "availability":"http://schema.org/InStock",
            }
        ]
    }
}

На странице Raspberry Pi 4, где я должен указать свойство" isConsumableFor"? Для Raspberry Pi 4 или для блока питания?

{
    "@context": "http://schema.org/",
    "@type": "Product",
    "isConsumableFor":{ 
        "@context":"http://schema.org/",
        "@type":"Product",
        "name":"Raspberry Pi 4",
        "url":"example.com",
    },
}

или другим способом, но если для Raspberry Pi 4 доступно больше расходных материалов, чем Raspberry Pi 4, он будет повторяться все время, когда для всех аксессуаров будет достаточно одного раза:

{
    "@context":"http://schema.org/",
    "@type":"Product",
    "name":"Power Supply",
    "image":[
        "psu.jpg",
        "psu-2.jpg",
    ],
    "description":"Power Supply ...",
    "offers":{
        "@type":"AggregateOffer",
        "offerCount":1,
        "highPrice":"8.00 ",
        "lowPrice":"8.00 ",
        "priceCurrency":"EUR",
        "offers":[
            {
                "@type":"Offer",
                "priceCurrency":"EUR",
                "priceValidUntil":"2019-11-09T21:50:32+01:00",
                "url":"powersupply",
                "price":"8.00 ",
                "itemCondition":"http://schema.org/New",
                "availability":"http://schema.org/InStock",
            }
        ]
    },
    "isConsumableFor":{ 
        "@context":"http://schema.org/",
        "@type":"Product",
        "name":"Raspberry Pi 4",
    }
}
...