Sha256: 6af1650c11ad21fdcb5f14d074e9d34a962ae92d73b43977eb1f78f1cbc5c887

Contents?: true

Size: 1.77 KB

Versions: 3

Compression:

Stored size: 1.77 KB

Contents

# Gutenberg RDF

Gutenberg RDF is a Ruby wrapper for the Project Gutenberg RDF catalog book files,
providing an API to all the metadata contained within.

The official RDF catalog can be found here: http://www.gutenberg.org/wiki/Gutenberg:Feeds


## Requirements

* Ruby 2.0 - this is so we get UTF-8 by default

NOTE: In around April 2014 PG changed the XML format in their RDF files
considerably, so this GEM will no longer work on files from before that date.
Please make sure to download the latest catalog using the link above.


## Installation

Add this line to your application's Gemfile:

    gem 'gutenberg_rdf'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install gutenberg_rdf

## Usage

    require 'gutenberg_rdf'

    book = GutenbergRdf.parse('/path/to/pg2746.rdf')

    puts book.id
    #=> "2746"

    puts book.type
    #=> "Text"

    puts book.title
    #=> "Urbain Grandier"

    puts book.subtitle
    #=> "Celebrated Crimes"

    puts book.authors.first.fullname
    #=> "Alexandre Dumas"

    puts book.subjects.first
    #=> "Crime"

    puts book.published
    #=> "2004-09-22"

    puts book.publisher
    #=> "Project Gutenberg"

    puts book.rights
    #=> "Public domain in the USA."

    puts book.language
    #=> "en"

    puts book.covers.first
    #=> "http://www.gutenberg.org/ebooks/2746.cover.medium"

    puts book.ebooks[1].uri
    #=> "http://www.gutenberg.org/files/2746/2746-h/2746-h.htm"

    puts book.ebooks[1].media_type
    #=> "text/html"

    puts book.ebooks[1].encoding
    #=> "us-ascii"

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gutenberg_rdf-1.0.1 README.md
gutenberg_rdf-1.0.0 README.md
gutenberg_rdf-0.4.0 README.md