问题
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