Code Monkey home page Code Monkey logo

edmontonlibrarybranchesandschools's Introduction

INSTALLATION

  1. Clone this repository.
  2. Run bundle install
  3. Run rake db:migrate
  4. Run rake import_public_libraries, rake import_public_schools, rake import_catholic_schools
  5. Run rails s
  6. /branches will show you the leaflet.js map
  7. /branch/1 will show you the html representation of a library branch
  8. /branch/1.json will show you the json-ld representation.

Edmonton Library Branches and Schools

This project is my contribution to HackYeg's OpenData Hackathon. I was interested in exploring Leaflet.js, so I grabbed the following dataset from the City of Edmonton's Open Data Catalogue: Public Libraries, Edmonton Public Schools and Edmonton Catholic Schools

After creating data models for Branches, and Schools, I imported the data using Rake tasks. Then I created a single controller to access all the model data, and set up a view to call the leaflet.js library, construct a map of Edmonton and plot library branches and schools.

It turns out that I could just have loaded the JSON data straight into D3, and that would work fine.

====================================================================================================

Update for DHSI:

I'm taking the Linked Data/RDF class at the 2014 Digital Humanities Summer Institute. After playing around a little bit with some linked data representations (ntriples, turtle, json-ld), I decided to build json-ld support into this project. The idea is that, similar to the DPLA's implementation, when the URL for a library branch (e.g. /branch/1) will return html, and requesting json (e.g. /branch/1.json) will return json-ld.

Here's the algorithm.

  1. Download CSV data from the City of Edmonton Open Data site.
  2. Create a Rails model for the data and read the CSV data into the database.
  3. Create a controller, routes, and views for the HTML representation. ---------- This is where the HackYEG project ended ------------------------

To add JSON-LD support, 4. Add "respond_to json" in your controller. 5. Add the PragmaticContext gem to your Rails project. 6. In your model, contextualize your object fields. 7. Change your "respond to json" line to work on @object.jsonld instead of @object.

=====================================================================================================

edmontonlibrarybranchesandschools's People

Contributors

redlibrarian avatar jbfink avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.