It looks like there are several proposals how to publish opening hours in RDF. Are there any real world applications with actual opening hours? I've read that the GoodRelation ontology should fit but only if your opening hours are very simple. I've also seen some artificial toy examples and discussions (for instance at Code4Lib).

The opening hours should allow for day ranges and multiple time ranges per day, for instance:

Tu-Th: 09:00-12:00, 13:00-18:00; Fr: 09:00-14:00

And it should allow for multiple opening times for different seasons, for instance:

normal: Tu-Th: 09:00-12:00, 13:00-18:00; Fr: 09:00-14:00; Sa: 10:00-15:00

holidays: Tu-We: 09:00-13:00; Th: 09:00-12:00, 13:00-18:00

The seasons could also have date ranges, but a label should also be fine to start with. I also though about Timezone information, but if the opening hour is bound to a physical location, the timezone should better be derived from this location.

asked 30 Aug '11, 08:23

Jakob's gravatar image

Jakob
1.9k211
accept rate: 10%


As for day ranges and multiple time ranges per day, this is supported by GoodRelations. You can link multiple gr:OpeningHourSpecification to a gr:Location, and a single gr:OpeningHourSpecification can be classified as valid only on specific days. It is also possible to make a gr:OpeningHourSpecification valid only within a certain date range (gr:validFrom and gr:validThrough), but these need to be concrete dates, not abstract notions such as "normal" and "holidays", e.g.:

_:somePlace
    a gr:Location ;
    gr:hasOpeningHourSpecification _:oas1, _:oas2 .

_:oas1
    a gr:OpeningHourSpecification ;
    gr:opens "09:00:00"^^xsd:time ;
    gr:closes "12:00:00"^^xsd:time ;
    gr:validFrom "2011-08-30T00:00:00Z"^^xsd:dateTime ;
    gr:validThrough "2011-10-30T00:00:00Z"^^xsd:dateTime ;
    gr:hasOpeningHoursDayOfWeek gr:Tuesday, gr:Wednesday, gr:Thursday .

_:oas2
    a gr:OpeningHourSpecification ;
    gr:opens "09:00:00"^^xsd:time ;
    gr:closes "13:00:00"^^xsd:time ;
    gr:validFrom "2011-10-30T00:00:00Z"^^xsd:dateTime ;
    gr:validThrough "2011-12-30T00:00:00Z"^^xsd:dateTime ;
    gr:hasOpeningHoursDayOfWeek gr:Tuesday, gr:Wednesday .

It seems that GoodRelations would only need a minor modification to support "named" date ranges and thus to comply to the needs you stated above, perhaps some sort of gr:valid property. Or maybe one could even mix in the time property from the event ontology to link to an Interval from the time ontology...

permanent link

answered 30 Aug '11, 09:47

literary_machine's gravatar image

literary_mac...
761
accept rate: 50%

1

If you decide to use the time ontology, consider to use URI for timeInstant or timeIntervals as proposed by Ian Davis (http://placetime.com/). Once I create the instant or interval (e.g. http://placetime.com/instant/gregorian/1995-01-01T00:00:01+01:00) I attach to it the time:inTimeInstant property with value xsd:dateTime

(30 Aug '11, 11:04) papaleo papaleo's gravatar image
1

Cool, I only need an algorithm to reshuffle the triples for a display like in my example - this could be a very complex SPARQL query, or I better use another method. It's only annoying that the range of gr:validFrom and gr:validThrough is not xs:date, because opening times normally are connected to days and not to seconds. I'll update my question with an idea how to support named ranges. @papaleo: do you actually use this solution with real data or is it just a proposal?

(30 Aug '11, 12:42) Jakob Jakob's gravatar image

I use it with real data when creating RDF dataset. In my opinion every datatype property is a dead end for linked data, so I use URIs as much as possible. In this case I also provide an alternative/traditional description to time by the xsd:dateTime. I model the start year and end year for a country to be member of a commission. I use the time information in my queries.

(30 Aug '11, 13:05) papaleo papaleo's gravatar image

@papaleo: is it available as Linked Data to have a look at and to test clients against?

(30 Aug '11, 13:49) Jakob Jakob's gravatar image

@literary_machine provided a good answer that can be used for unnamed date ranges. To name a date range, you could create a resource that has the same date range. I found that only the Timeline Ontology can specify date ranges in a natural way (with a start day and an end day):

@prefix time: <http://www.w3.org/2006/time#> .
@prefix tl: <http://purl.org/NET/c4dm/timeline.owl#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .

[
    # Intervals should be concepts if you identify them by label
    skos:prefLabel "holidays"@en ;

    # Time Onotology (invalid because expects other range)
    time:hasBeginning "2011-10-30"^^xsd:date ;
    time:hasEnd "2011-12-30"^^xsd:date ;

    # GoodRelations (invalid because expects other domain and range)
    gr:validFrom "2011-10-30"^^xsd:date ;
    gr:validThrough "2011-12-30"^^xsd:date ;

    # Timeline Ontology: can do it!
    a tl:Interval, time:Interval ;
    tl:start "2011-10-30"^^xsd:date ;
    tl:end   "2011-12-30"^^xsd:date
] .

The client could then look up matching intervals in its terminology (skos:ConceptScheme) of named intervals.

permanent link

answered 30 Aug '11, 13:48

Jakob's gravatar image

Jakob
1.9k211
accept rate: 10%

Wouldn't the tl:Interval have to be a separate ressource, because gr:validFrom and gr:validThrough are direct properties of the gr:OpeningHourSpecification?

[
    a gr:OpeningHourSpecification ;
        gr:validFrom "2011-10-30T00:00:00Z"^^xsd:dateTime ;
        gr:validThrough "2011-12-30T00:00:00Z"^^xsd:dateTime ;
        event:time [
            a tl:Interval, time:Interval ;
            skos:prefLabel "holidays"@en ;
            tl:start "2011-10-30"^^xsd:date ;
            tl:end   "2011-12-30"^^xsd:date
        ] ;
] .
(02 Sep '11, 05:39) literary_mac... literary_machine's gravatar image

http://openinghours.io is an ontology to maintain opening hours. Using that ontology you can link to existing files (e.g. iCal), include RDF structures (schema.org or RDFcal) or describe events using the Time ontology as layers to form the right opening hours, indicating whether the calendar layer is describing are closing hours or opening hours.

permanent link

answered 17 Jun, 07:36

pietercolpaert's gravatar image

pietercolpaert
312
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×101
×17

question asked: 30 Aug '11, 08:23

question was seen: 2,928 times

last updated: 17 Jun, 07:36