ruby-rdf / sparql

Ruby SPARQL library
http://rubygems.org/gems/sparql
The Unlicense
88 stars 14 forks source link

sparql server fails #36

Closed yayamamo closed 3 years ago

yayamamo commented 3 years ago

Hi, I use sparql 3.1.2 on ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]. When trying to launch sparql server rdfdata.nt, I got the following error.

Traceback (most recent call last):
    12: from /usr/local/lib/ruby/gems/2.7.0/bin/sparql:23:in `<main>'
    11: from /usr/local/lib/ruby/gems/2.7.0/bin/sparql:23:in `load'
    10: from /usr/local/lib/ruby/gems/2.7.0/gems/sparql-3.1.2/bin/sparql:162:in `<top (required)>'
     9: from /usr/local/lib/ruby/gems/2.7.0/gems/sparql-3.1.2/bin/sparql:56:in `server'
     8: from /usr/local/Cellar/ruby/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
     7: from /usr/local/Cellar/ruby/2.7.2/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
     6: from /usr/local/lib/ruby/gems/2.7.0/gems/sparql-3.1.2/lib/sinatra/sparql.rb:111:in `<top (required)>'
     5: from /usr/local/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:2008:in `register'
     4: from /usr/local/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1947:in `register'
     3: from /usr/local/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1453:in `register'
     2: from /usr/local/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1453:in `each'
     1: from /usr/local/lib/ruby/gems/2.7.0/gems/sinatra-2.1.0/lib/sinatra/base.rb:1455:in `block in register'
/usr/local/lib/ruby/gems/2.7.0/gems/sparql-3.1.2/lib/sinatra/sparql.rb:106:in `registered': uninitialized constant LinkedData (NameError)

Is there any way of fixing this issue?

Regards

gkellogg commented 3 years ago

The app.send(:include, ::LinkedData) should be conditional on the linkeddata gem being present. To get around this, and to work with serialization formats other than N-Triples, install the linkeddata gem.

I'll release an update that looks for the presence of the gem before going the include.

gkellogg commented 3 years ago

Released in 3.1.3.