Using Ruby on Rails Models with Mathematica

Reuse the Work You Have Done in Your ActiveRecord Models

Gustavo Delfino

GD Solutions C.A.
gdelfino@gmail.com

Abstract

Last year, I talked about how I used Mathematica in order to do my research in regards to the Venezuela elections, but I had very little time to talk about some of the techniques that I have developed while doing it. 

Mathematica lets you connect to databases using DatabaseLink. When this feature was introduced it was a very exciting feature. You no longer depended on text files to get you data into Mathematica. In recent years, a new web development framework called Ruby on Rails has been gaining popularity very fast. Rails includes a component called ActiveRecord which allows you to get access to your data and define relationships without need to write SQL.

When you want to do complex analysis of your data using Mathematica you may benefit by accessing your data from your ActiveRecord models instead of the bare database. This way you don't have to re-code any of your ActiveRecord methods and, if you are saving to the database, you can have the peace of mind of knowing that your data was validated by your ActiveRecord models before it was saved to the database.

In this talk several examples will be explained in order to show how to establish the connection using XML.