Linked Data Platform client library for Ruby
Add this line to your application's Gemfile:
gem 'ldp'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ldp
host = 'http://localhost:8080'
client = Ldp::Client.new(host)
resource = Ldp::Resource.new(client, host + '/rest/node/to/update')
orm = Ldp::Orm.new(resource)
# view the current title(s)
orm.orm.value(RDF::DC11.title)
# update the title
orm.graph.delete([orm.resource.subject_uri, RDF::DC11.title, nil])
orm.graph.insert([orm.resource.subject_uri, RDF::DC11.title, 'a new title'])
# save changes
orm.save
Due to some discrepancies with alpha version of Fedora Commons, you may need to do some things differently:
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request