Dotted JSON namespaces

2010-01-18T09:28:34Z in standards, web, data

JSON quacks a lot like a Python dict, so then why not Python (or Java) style dotted namespaces? An arbitrary bit of JSON might be safely extended with GeoJSON geometry like:

{
  ...
  "org.geojson.type": "Point",
  "org.geojson.coordinates": [0.0, 0.0]
}

Or with a feature:

{
  ...
  "org.geojson.geometry": {
    "org.geojson.type": "Point",
    "org.geojson.coordinates": [0.0, 0.0]
  }
}

The GeoJSON working group rejected XML namespaces (such as in JDIL) for 1.0. I recall that I had the most strongly expressed opinion: that GeoJSON should be distinctly JSON and not XML without angle brackets. JSON is less abstracted than XML, closer to code, and dotted namespaces seem like a win to me.

Comments

1Re: Dotted JSON namespaces

Tom Kralidis, 2010-01-19T18:05:43Z

Wouldn't this result in a bulkier encoding? At least with JDIL, the URIs are defined once (at the top/header) and the prefixes are shorthand refs to them.

I do agree that your proposal above is closer to code.

2Re: Dotted JSON namespaces

Sean, 2010-01-20T09:50:55Z

A little bulkier, yes, but it's not going to add up to a lot of extra bytes relative to the accompanying coordinates. Flatter namespaces will certainly be easier on the eyes.

Comments are closed after 13 days.

about archive feed search

Some rights reserved by Sean Gillies.