[OSM-dev] Schema for v0.6 OSM files?

Stefan Keller sfkeller at gmail.com
Wed Mar 28 19:14:58 BST 2012


Hi Frederik

2012/3/28 Frederik Ramm <frederik at remote.org> wrote:
> It is easy to write an XML schema but it would never be binding for anyone.

I think there's some misunderstandng aroun, because I would say: Yes,
exactly, an XML Schema of OSM version 0.6 should be binding for
anyone! We already have a flexible data model. Sticking to a schema
would enable automatisation and would make life easier to write OSM
software.

> The problem is that people would still assume that the schema was somehow
> the gold standard and every OSM XML file that they ever see would comply to
> that "standard", and that is simply not the case.

Being able to validate OSM XML files against an XML Schema with one of
the many XML tools around would be an advantage for the whole project.

> For example, JOSM writes almost-compatible OSM XML but has an additional
> "action" attribute. Of course someone only looking at the API code would not
> know that there are files with such an attribute. So would it be included in
> the "standard" or not? And if not, it's not going to be long until someone
> pops up on the JOSM list and complains that JOSM was writing "invalid" files
> (because they don't comply with the "standard").

There's no problem having "additional" attributes: XML Schema knows
optional XML attributes.

> I think the better way is to think of our XML as a general, weakly formatted
> exchange format, instead of something that conforms to a given schema. Think
> of our XML as if it were JSON.

Nice hint: I also like JSON Schema for the above mentioned reasons :->
See http://en.wikipedia.org/wiki/JSON#Schema

- Stefan

2012/3/28 Frederik Ramm <frederik at remote.org>:
> Hi,
>
> On 03/28/12 17:08, Stefan Keller wrote:
>>
>> We're speaking of about three pages of XML and that is not that big thing.
>> Of course I could do it but who - if not the developers - would know
>> better than they themselves?
>> I think that it would be a sign of maturity of the OSM project if an
>> XML schema would exist!
>
> It is easy to write an XML schema but it would never be binding for anyone.
> The problem is that people would still assume that the schema was somehow
> the gold standard and every OSM XML file that they ever see would comply to
> that "standard", and that is simply not the case.
>
> For example, JOSM writes almost-compatible OSM XML but has an additional
> "action" attribute. Of course someone only looking at the API code would not
> know that there are files with such an attribute. So would it be included in
> the "standard" or not? And if not, it's not going to be long until someone
> pops up on the JOSM list and complains that JOSM was writing "invalid" files
> (because they don't comply with the "standard").
>
> There are other tools that do similar things.
>
> I think the better way is to think of our XML as a general, weakly formatted
> exchange format, instead of something that conforms to a given schema. Think
> of our XML as if it were JSON.
>
> Bye
> Frederik
>
> --
> Frederik Ramm  ##  eMail frederik at remote.org  ##  N49°00'09" E008°23'33"
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev



More information about the dev mailing list