0.0
Repository is archived
No release in over a year
LinkedRails helps you create a Linked Data application in a matter of seconds.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

LinkedRails

LinkedRails is a gem for Ruby on Rails that helps you create a Linked Data application in a matter of seconds.

It includes among other things:

  • Linked data serialization to Turtle, JSON-LD, N-Triples and more using rdf-serializers
  • Controller abstraction using active_response
  • Serialization of forms
  • Serialization of collections using the Activity Streams spec
  • Serialization of menus
  • Communicating actions to be executed by the frontend using Exec Actions header
  • Rendering errors as RDF
  • Parsing linked data graphs as params

Work in progress

This gem is an extraction from an existing app. Tests are not yet sufficient but will be extended soon.

Installation

Add this line to your application's Gemfile:

gem 'linked_rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install linked_rails

Getting started

Add the following lines to application.rb to enable params parsing

module MyApp
  class Application < Rails::Application
    [...]
    config.middleware.use LinkedRails::Middleware::LinkedDataParams
    [...]
  end
end

Add the following line to your models

LinkedRails::Model

Add the following line to your controllers

LinkedRails::Controller

Add the following line to your serializers

LinkedRails::Serializer

Add the following line to your policies

LinkedRails::Policy