README in rack-linkeddata-0.1.0 vs README in rack-linkeddata-0.1.1

- old
+ new

@@ -16,12 +16,33 @@ * Compatible with any Rack application and any Rack-based framework. Examples -------- -### Adding Linked Data content negotiation to a Rack application +### Adding Linked Data content negotiation to a Rails 3.x application + # config/application.rb + class Application < Rails::Application + config.middleware.use Rack::LinkedData::ContentNegotiation + end + +### Adding Linked Data content negotiation to a Sinatra application + + #!/usr/bin/env ruby -rubygems + require 'sinatra' + require 'rack/linkeddata' + + use Rack::LinkedData::ContentNegotiation + + get '/hello' do + RDF::Graph.new do + self << [RDF::Node.new, RDF::DC.title, "Hello, world!"] + end + end + +### Adding Linked Data content negotiation to a Rackup application + #!/usr/bin/env rackup require 'rack/linkeddata' rdf = RDF::Graph.new do self << [RDF::Node.new, RDF::DC.title, "Hello, world!"] @@ -50,16 +71,16 @@ `Rack::LinkedData` implements content negotiation for any [Rack][] response object that implements the `RDF::Enumerable` mixin. You would typically return an instance of `RDF::Graph` or `RDF::Repository` from your Rack application, and let the `Rack::LinkedData::ContentNegotiation` middleware -take care serializing your response into whatever RDF format the HTTP client -requested and understands. +take care of serializing your response into whatever RDF format the HTTP +client requested and understands. -The middleware works by querying [RDF.rb][] for the MIME content types of -known RDF serialization formats, so it will work with whatever serialization -plugins that are currently available for RDF.rb. (At present, this includes -support for N-Triples, Turtle, RDF/XML, RDF/JSON and TriX.) +The middleware queries [RDF.rb][] for the MIME content types of known RDF +serialization formats, so it will work with whatever serialization plugins +that are currently available for RDF.rb. (At present, this includes support +for N-Triples, Turtle, RDF/XML, RDF/JSON and TriX.) Documentation ------------- <http://datagraph.rubyforge.org/rack-linkeddata/>