Ember-Socrata
An adapter and serializer for interacting with Socrata open data services.
Currently, Ember-Socrata only handles Socrata's Consumer API, ie. retrieving data.
Installation
Ember-Socrata relies on Soda-JS to communicate with Socrata data repositories, as well as Ember-Browserify to make Soda-JS available to the Ember application.
ember install ember-socrataember install ember-browserifynpm install soda-js
Configuration
In your project's config/environment.js
:
module { var ENV = socrata: dataRepo: 'some.data-repository.com' // ... ; // ...};
Usage
For each Socrata dataset you want to retrieve you must create a model and an adapter:
ember generate model somethingember generate adapter something
Models
In the model you should define attributes as normal, using camelCasedAttributes where the dataset uses underscored_attributes.
Example:
Socrata object
something_id: 123 some_attribute: 'some value' related_object_id: 456
Ember model
// app/models/something.js ;;; ;
Adapters
You must add a dataset
property with the value of the Socrata dataset to the
model's adapter:
// app/adapters/something.js ; ;