[Tagging] Opening hours specification

Robin Schneider ypid at riseup.net
Fri Aug 21 11:57:29 UTC 2015

On 21.08.2015 13:29, Simon Poole wrote:
> BTW while it is still work in progress (now mainly because the android
> UI isn't finished yet)  
> https://github.com/simonpoole/OpeningHoursParser is a JavaCC based
> parser which attempts to implement the full spec, undoubtedly I've
> probably missed one or two special cases, but it is fairly complete.
> It currently successfully parses 108'455 of 122'100 test strings (with
> some relaxation of rules) of those that fail 10'569 seem to be valid
> lexical errors and a large part of the remaining errors seem to have
> other issues. The test strings were extracted from the OSM database
> (nodes only).

Nice. Was not aware of this. I also tried to get an opening_hours parser
"ported" to Android. Still alpha. https://github.com/ypid/ComplexAlarm

> As you say the specification itself is overly complicated (the
> "optional" colon is not really a problem, except that it is not really
> clear where it is allowed, there is some further similar fuzziness wrt
> comments) and definitely shouldn't have more stuff added to it (with
> perhaps the exceptions of adding further variable dates and similar things).
> Simon
> Am 21.08.2015 um 12:36 schrieb Ruben Maes:
>> Friday 21 August 2015 11:48:49, panieravide at riseup.net:
>>> Hello,
>>> I recently released a new version of YoHours, a website which allows
>>> everyone to create and view opening hours in the OSM syntax. It now
>>> supports seasons-dependent hours (month, week, day, holiday selectors). 
>>> It's available here:
>>> http://github.pavie.info/yohours/ 
>>> The code is available on GitHub: 
>>> https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours
>>> [1] 
>>> If you have any suggestions, let me know :) 
>>> Cordially, 
>>> PanierAvide. 
>>> Links:
>>> ------
>>> [1]
>>> https://github.com/PanierAvide/panieravide.github.io/tree/master/yohours
>> I opened an issue[1] on this GitHub project, because it puts a colon after week, month and monthday selectors.
>> PanierAvide replied that the specification allows an "optional separator for readability"[2]. Indeed, when you read the overly complicated and totally not mapper-focused specification, you can see
>> [ <year_selector> ] [ <month_or_monthday_selector> ] [ <week_selector> ] [ <separator_for_readability> ]
>> Whose idea was this? It's already complicated enough that you don't have to add *optional* separators for supposed readability.
>> IMO it's just fine without them.
>> PS: I always follow the time domains proposal[3]. It's clear and it's compatible with the other specification AFAIK.
>> [1] https://github.com/PanierAvide/panieravide.github.io/issues/1
>> [2] https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification#separator_for_readability
>> [3] https://wiki.openstreetmap.org/wiki/Proposed_features/Time_domains

https://wiki.openstreetmap.org/wiki/Proposed_features/Time_domains is just an
proposal. It is nice and compact but also partly outdated and not approved.

The optional colon is a trade-off. It was made optional by me because I forked
opening_hours.js from AMDmi3 and added support for all opening_hours features to
it. AMDmi3 did not accept an colon. The other implementation from Netzwolf did
not accept opening_hours values without colon …


Live long and prosper
Robin `ypid` Schneider

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/tagging/attachments/20150821/69bc8728/attachment.sig>

More information about the Tagging mailing list