Proposal:Value separator
Value separator | |
---|---|
Proposal status: | Abandoned (inactive) |
Proposed by: | * |
Tagging: | any=<value_1> <separator> <value_2>... |
Statistics: |
|
Rendered as: | various |
Draft started: | 2006-12-30 |
While this proposal never officially reached RFC status, the proposed approach has become widely accepted by the mapping community. See Semi-colon value separator. |
The possibility of having multiple values for a single key requires a single separator that is standardized. Up to now, there is no such separator at all. This is a proposal for a standardized separator ';'. This is a proposal tagging approach rather than a normal tag proposal.
Example
- Road which should have nat_ref=B 10 and nat_ref=B 300 - how to tag this?
Possible separators
- ;
- |
- ,
- #
Comment
I support having a standard separator. Whether or not general usage of separators is good or not is a separate issue. For me, I support "," as it is widely used in CSV, comma separated value files and is directly readable. For example the renderer does not HAVE to break out B10 and B300 and display them as two labels, it can just display B10, B300. I also propose that B10, B300 and B10,B300 be functionally equivalent, i.e. renderers that do break out multiple values must eat any whitespace immediately after the separator. MikeCollinson 03:42, 26 January 2007 (UTC)
I think having multiple values on a tag is an ugly hack which will lead to problems later, because we limit the characters we can use in tags and it makes queries for certain tags much more difficult ("show me all roads with tag 'B10'" would suddenly be a substring search and would find 'B100' too. Which can be fixed, but makes every access much more annoying). Why can't we have several instances of the same tag key? This would mostly solve the problem. There is a difference between this proposal, which implies ordered lists and multiple tags with same key, which are unordered. This might matter in some cases. That beeing said, if we want to go down this route, we have to standardise on the character, but it is hard to choose. The comma (,) can't be used, because we might want to have names like "White, Black & Partners" or so. And the number sign (#) is sometimes uses in addresses like "Flat #14" or so. Joto 08:07, 26 January 2007 (UTC)
- I agree that it is an ugly hack. Are there any disadvantages to the alternative of allowing multiple tags? It would be much more in keeping with XML methodologies. What I really want to do is just say things like name=The Big Hotel, tourism=hotel, amenity=restaurant, amenity=pub, amenity=atm. MikeCollinson 10:31, 11 June 2007 (BST)
- Otherwise, I'd be quite happy to go with a ; separator on the grounds that it would least likely to be used in natural names in tags. MikeCollinson 10:31, 11 June 2007 (BST)
- +1 for multiple tags. All points already mentioned, so no reasoning here :) --Bkr 14:56, 3 June 2008 (UTC)
- AFAIUI, the 0.6 API does *not* allow mutiple tags with the same key, so all this discussion is useless -- EddyP 09 Sep 2009 13:55:54 +0000
I have been using the ; character as a separator for some ncn routes around Edinburgh. It give the best of both worlds. I agree that whitespace should be trimmed. Having multiple tags of the same key would be a possiblilty, but will be a bigger change. Smsm1 14:48, 5 May 2007 (BST)
I also thought using the ; char would be common sense in OSM. It's at least described exactly for your example (multiple refs) on Roads#Global. In addition Map Features suggests amenity=bank;atm. I'm also quite sure I once read this in an introduction about using tags, but I'm not able to find it any more... --Gernot 06:15, 14 March 2008 (UTC)
I am pro ";" as well. I agree that it is dirty from a computational point of view, and we might just switch to several instances of the same key. In the meantime, a standard separator is much better than arbitrary separators. This allows easy migration to another schema by a very simple script. --Chrischan 08:11, 14 March 2008 (UTC)
The above is an old discussion. I'll moved the more recent discussion to Talk:Semi-colon value separator "multiple values for tags that are somehow connected to each other" (started by Candid Dauth 00:41, 21 March 2009) That's a more subtle variation on the theme, but in general the whole ';' thing is old news. -- Harry Wood 18:50, 4 December 2010 (UTC)
The proposed approach is accepted by the mapping community, although various aspects of it are still under discussion.
';' has been documented as the accepted approach on the FAQ for several years now
';' is also supported by both JOSM and Potlatch (inserted automatically when performing element merging)
See the new Semi-colon value separator page for documentation, more specific recommendations and quirks/issues, and further discussion