ruby-rdf / rdf-ldp

A suite of LDP software and middleware for RDF.rb & Rack
The Unlicense
13 stars 2 forks source link

parse_graph does not support strings. #60

Closed muratseyhan closed 8 years ago

muratseyhan commented 8 years ago

59 seems to fix #56, but makes RDF::LDP::RDFSource.parse_graph, and therefore RDF::LDP::RDFSource.create, no longer support strings as the first parameter. This seems to be intentional, but not reflected in the documentation of the mentioned methods and the example rack config in README.md.

$ rackup
.../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/rdf_source.rb:247:in `parse_graph': undefined method `rewind' for "":String (NoMethodError)
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/rdf_source.rb:101:in `block in create'
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/resource.rb:225:in `block in create'
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-2.0.1/lib/rdf/mixin/transactable.rb:56:in `transaction'
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/resource.rb:223:in `create'
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/rdf_source.rb:100:in `create'
  from .../.rvm/gems/ruby-2.3.0/gems/rdf-ldp-0.7.0/lib/rdf/ldp/container.rb:43:in `create'
  from .../sandbox/ruby/rdf-ldp/config.ru:19:in `block in <main>'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `instance_eval'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:55:in `initialize'
  from .../sandbox/ruby/rdf-ldp/config.ru:in `new'
  from .../sandbox/ruby/rdf-ldp/config.ru:in `<main>'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `eval'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:49:in `new_from_string'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/builder.rb:40:in `parse_file'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:299:in `build_app_and_options_from_config'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:208:in `app'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:336:in `wrapped_app'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:272:in `start'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/lib/rack/server.rb:147:in `start'
  from .../.rvm/gems/ruby-2.3.0/gems/rack-1.6.4/bin/rackup:4:in `<top (required)>'
  from .../.rvm/gems/ruby-2.3.0/bin/rackup:22:in `load'
  from .../.rvm/gems/ruby-2.3.0/bin/rackup:22:in `<main>'
  from .../.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `eval'
  from .../.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
no-reply commented 8 years ago

Yes, this is reflected in the changelog. Updates to the relevant documentation would be welcome.