Including “siesta” in Schema.org OpeningHoursSpecification in JSON-LD

拈花ヽ惹草 提交于 2021-02-10 05:49:31

问题


I'm using Schema.org OpeningHoursSpecification in JSON-LD in such a way:

[{"@type":"OpeningHoursSpecification","dayOfWeek": ["Monday","Tuesday","Wednesday","Thursday","Friday"],"open":"08:00","closes":"20:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":["Saturday"],"open":"08:00","closes":"14:00"},{"@type":"OpeningHoursSpecification","dayOfWeek":["Sunday"],"open":"00:00","closes":"00:00"}]

I couldn't find any example for adapting this specification to include "siesta" - a situation when a place operates e.g. from 8AM to 1PM and from 3PM to 8PM.


回答1:


EDITED PER @UNOR

This might get you started:

<script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "Service",
    "url": "http://www.example.com/",
    "hoursAvailable": [{
        "@type": "OpeningHoursSpecification",
        "opens": "08:00",
        "closes": "13:00",
        "dayOfWeek": [{
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Monday",
            "name": "Monday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Tuesday",
            "name": "Tuesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Wednesday",
            "name": "Wednesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Thursday",
            "name": "Thursday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Friday",
            "name": "Friday"
        }]
    },
    {
        "@type": "OpeningHoursSpecification",
        "opens": "15:00",
        "closes": "20:00",
        "dayOfWeek": [{
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Monday",
            "name": "Monday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Tuesday",
            "name": "Tuesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Wednesday",
            "name": "Wednesday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Thursday",
            "name": "Thursday"
        },
        {
            "@type": "DayOfWeek",
            "@id": "http://schema.org/Friday",
            "name": "Friday"
        }]
    }]
}
</script>

You can embellish with a more precise type of @Service and add time zone information.



来源:https://stackoverflow.com/questions/38870645/including-siesta-in-schema-org-openinghoursspecification-in-json-ld

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!