Ruby, REST and YAML

Here's a good article by Charlie Savage: A Community for REST. I appreciate the work that the Rails community is doing to push back against WS-*. The other thing I think Rails does exactly right is use of YAML for configuration instead of XML.

Users of GDAL have a couple virtual formats at their service. The Python Cartographic Library is using these for configuration of filesystem-based data stores. The thing is, there are no schemas for these XML languages, there's no way to validate, there are no fancy tools for making virtual files other than your text editor. So why bother with XML? As I see it, here's a great use case for YAML. Instead of:

<OGRVRTDataSource>
  <OGRVRTLayer name="world_borders">
    <SrcDataSource relativeToVRT="0">world_borders.shp</SrcDataSource>
        <SrcLayer>world_borders</SrcLayer>
    <LayerSRS>EPSG:4269</LayerSRS>
  </OGRVRTLayer>
</OGRVRTDataSource>

we could have:

featuretype:
    - name  : world_borders
      path  : /data/world/world_borders.shp
      layer : world_borders
      srs   : EPSG:4326

Comments

Re: Ruby, REST and YAML

Author: Tom Kralidis

Good point. I posted about this a couple of months ago, and I agree. XML is not for everything, that's for sure. Some may argue that having this type of info in XML allows for easy parsing across a wide variety of languages, but then again there are many YAML parsers out there too. YAML wouldn't be a bad MapServer mapfile format, don't ya think? :)