Contour Line

December 16, 2008

possibly inconsistent data

Filed under: couchdb, transportation — jmarca @ 5:12 pm

One of the things I am trying to figure out with couchdb is how to structure data so that it can’t be internally inconsistent, what is that, normalized, I guess.

So suppose I have Caltrans District, County, and City.  All of which are cleanly delimited, etc etc.  In a relational database, I’d enforce consistency by using foreign key constraints, so District 12 links to Orange County, and there can only be one link from a county to a district, etc.  But in couchdb you don’t get foreign keys.  So if I want to include data on the district, etc, I have to shove it into the document.  But that means I can make mistakes, and no one will stop me.

So I can have one document that says:

{
  'City' : 'Costa Mesa',
  'County': 'Orange',
  'District': 12
}

and another that says

{
  'City' : 'Newport Beach',
  'County': 'Orange',
  'District': 7
}

Even though the county of Orange should never be understood to be in District 7. Putting just the one-level-up doesn’t help either, because then I can’t sort on

[District,County,City]

And while I am  on the subject of sorting, I can’t yet figure out how to get a numerical sort of districts.  They are called 1, 2, 3, … , 12, but sorting them on District_id in the view and I get “1″, “10″, “11″, etc  alpha sorting, not numeric ordering.  I figure I’ll get that one sorted eventually.  I saw something that said to sort on dates, so I suppose it is a similar hack, or writing javascript to convert text to numbers in the view function before emitting the key.

December 10, 2008

Washed out gray is the new black

Filed under: code, couchdb, transportation — jmarca @ 1:33 pm

I was working on Sakai help yesterday and decided that using CouchDB might be the way to go if I ever got some time to try to replace Sakai’s default help system.  (more…)

November 18, 2008

couchdb

Filed under: code, transportation — jmarca @ 5:50 pm

Stumbled across couchdb thanks to the Sakai devel mailing list.  Looks cool, but I need to use it before I can get my head around what it might be able to do.  I think a good toy application that will also be useful is to code up Mike’s glossary using it.  That would be good because the limitation of a wiki is that when you want to add links to existing pages, you have to guess or whatnot, and anyway a wiki is not a glossary.  I just want a dynamic, editable, cross-linked glossary.  That isn’t hand-generated!

October 30, 2008

If you’re not a Socialist, you’re antisocial!

Filed under: bikes, research, transportation — jmarca @ 1:22 pm

My goodness maglev PRT is an astoundingly stupid idea.

September 24, 2008

Wacky Ideas

Filed under: bikes, research, transportation — jmarca @ 11:48 am

So I was writing an email and considering the different strengths of Transims/Matsim vs a microsimulator, and I wrote that Transims can help us analyze big policy questions like what if we replaced all of the freeways with bike lanes. (more…)

« Previous Page

Blog at WordPress.com.