How to model opening hours in RDF
Asked Answered
T

3

7

What is the most pragmatic way to model opening hours of a service, so that SPARQL queries would be able to query things that are open at a certain timestamp/during a certain time interval?

Answers to this question should contain:

  1. example of an ontology
  2. data sample which uses this ontology
  3. a SPARQL query* which returns everything from this sample that is open at a certain timestamp

( * extra points for simplicity and performance)

Tacky answered 3/10, 2013 at 8:12 Comment(0)
T
2

There are various ways to describe calendars online. Amongst others, iCal (or the rdf-ized RDFCal), http://schema.org/OpeningHoursSpecification or the Time ontology (for e.g., describing the time interval of an event).

Opening Hours can be seen as a combination of calendars. Using an rdf:list we can stack calendars and indicate whether each of these calendars indicate closing hours or opening hours. For example, for a simple business I would add 2 calendars: * Opening Hours: open from 9 to 5 from Monday to Sunday * Closing Hours: official holidays

I've published a paper about this and I've created a concise ontology to create opening hours at http://openinghours.io.

Tacky answered 17/6, 2014 at 11:51 Comment(0)
P
9

I suggest that you look at schema.org. It provides a model for opening hours: http://schema.org/OpeningHoursSpecification. You can see an example applied to businesses: http://schema.org/LocalBusiness

You can build your RDF graph accordingly, and it should be straightforward to query later on. Plus, in case you generate web pages from it, major search engines will be able to exploit better your information and use it their own way.

Presumption answered 3/10, 2013 at 10:12 Comment(1)
It is indeed surprisingly easy to query. An interesting approach would be to use a reasoner to transform opening hours hidden in data linked to more complicated vocabularies like rdfcal to the schema.org/OpenHoursSpecification description.Tacky
T
2

There are various ways to describe calendars online. Amongst others, iCal (or the rdf-ized RDFCal), http://schema.org/OpeningHoursSpecification or the Time ontology (for e.g., describing the time interval of an event).

Opening Hours can be seen as a combination of calendars. Using an rdf:list we can stack calendars and indicate whether each of these calendars indicate closing hours or opening hours. For example, for a simple business I would add 2 calendars: * Opening Hours: open from 9 to 5 from Monday to Sunday * Closing Hours: official holidays

I've published a paper about this and I've created a concise ontology to create opening hours at http://openinghours.io.

Tacky answered 17/6, 2014 at 11:51 Comment(0)
P
1

The few temporal-query triple stores like Parliament use the time vocabulary. They should be able to answer queries like "events between X and Y" I'm sure an inferred time model from schema.org could be helpful to see wether something is open or not.

Preen answered 3/10, 2013 at 16:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.