Git Product home page Git Product logo

Comments (9)

ngottlieb avatar ngottlieb commented on July 17, 2024

I've been running into this with a number of queries. It's a Net::HTTP::Persistent bug. I'm trying upgrading Net::HTTP::Persistent in my own branch, thus far it seems good. Is there any reason to not use a newer version of the gem? (this gem is locked on using v. 1.4 of net-http-persistent, they're now at 2.9.4).

from sparql-client.

gkellogg avatar gkellogg commented on July 17, 2024

The only real reason to lock it there is to ensure we stick with 1.x which has been tested. If you test against 2.x, then changing the dependency to '~> 2.9' should do the trick.

I did try changing it, but specs fail due to WebMock issues (it is probably not patching around net-http-persistent properly now). Certainly, if you can get this working, please consider submitting a pull-request.

Note, I've been experimenting with using an HTTP library with pluggable backends for RDF.rb (rufus-jig). This also supports simple caching. This may be useful for sparql-client too, but I haven't had enough time to look spend on it myself lately.

from sparql-client.

ngottlieb avatar ngottlieb commented on July 17, 2024

Yeah, I tried running the test suite and saw that. I will see what I can do about fixing, because upgrading Net::HTTP::Persistent definitely solves the bug (at least in my application).

from sparql-client.

gkellogg avatar gkellogg commented on July 17, 2024

Commented out repository tests, which were testing against an actual endpoint (Dydra). Likely, something changed in net-http-persistent which retains a mock even when switching to a new describe block; perhaps some reset necessary. In any case, these specs should run against a local repository, which can be installed on Travis, to be of real use.

from sparql-client.

ngottlieb avatar ngottlieb commented on July 17, 2024

So I added a WebMock.disable! call in the before block of the RDF tests, as well as:

after :all do
  WebMock.enable!
end

to ensure it didn't screw anything else up. That solved the initial problem, but I ran the suite against the Dydra endpoint just for testing purposes and got 12 failures, all of which don't seem to be connection related. Here's the short version:

rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:190 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query when called with specific patterns from SPARQL data/r2/expr-equals graph-1 count should == 2
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:203 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query when called with specific patterns from SPARQL data/r2/expr-equals graph-2 count should == 1 
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:217 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query_execute defines a protected #query_execute method
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:241 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query_pattern defines a protected #query_pattern method
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:271 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query_pattern when called with specific patterns returns [#<RDF::Statement:0xd2305c(<http://example.org/xi1> <http://example.org/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>, #<RDF::Statement:0xd22cc4(<http://example.org/xi2> <http://example.org/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>] given #<RDF::Query::Pattern:0xd1e41c( <http://example.org/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:271 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query_pattern when called with specific patterns returns [#<RDF::Statement:0xd228b4(<http://example.org/xi1> <http://example.org/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>, #<RDF::Statement:0xd225bc(<http://example.org/xi2> <http://example.org/p> "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>] given #<RDF::Query::Pattern:0xd56948(  "1"^^<http://www.w3.org/2001/XMLSchema#integer> .)>
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:271 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#query_pattern when called with specific patterns returns [#<RDF::Statement:0xd21eb4(<http://example.org/xd1> <http://example.org/p> "1.0e0"^^<http://www.w3.org/2001/XMLSchema#double> .)>] given #<RDF::Query::Pattern:0xd5be20( <http://example.org/p> "1.0e0"^^<http://www.w3.org/2001/XMLSchema#double> .)>
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:338 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#first returns nil when the pattern fails to match anything
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:370 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#first_subject returns nil when the pattern fails to match anything
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:401 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#first_predicate returns nil when the pattern fails to match anything      
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/queryable.rb:431 # SPARQL::Client::Repository RDF::Repository when querying statements RDF::Queryable#first_object returns nil when the pattern fails to match anything
rspec /home/nickg/.rvm/gems/ruby-1.9.3-p545@sparql-client/bundler/gems/rdf-spec-10f50512bcac/lib/rdf/spec/writable.rb:65 # SPARQL::Client::Repository RDF::Repository when updating RDF::Mutable writability RDF::Writable#<< inserts an invalid statement

So I'm not sure we're out of the woods just yet...On an unrelated note, I get the same WebMock errors even without the upgrade -- I haven't been following this gem's development so I'm not sure when that started, but I don't think the upgrade to net-http-persistent caused it. I tried running the test suite from the prior commit and encountered the exact same errors.

from sparql-client.

gkellogg avatar gkellogg commented on July 17, 2024

There are some issues with the Dydra endpoint, due to differences in how literals are maintained (notably xsd:double). Another reason why I'd like to use a different local endpoint.

Note that Repo tests are disabled for Travis, so this doesn't affect the pass status.

Thanks for figuring this out! A pull request would be great.

from sparql-client.

gkellogg avatar gkellogg commented on July 17, 2024

No, you can comment them back in. Even though there are errors, it's useful for finding regressions when running locally.

from sparql-client.

gkellogg avatar gkellogg commented on July 17, 2024

Also, you should definitely add yourself to the CREDITS file and to the Contributors section of the README. Thanks for your contributions!

from sparql-client.

ngottlieb avatar ngottlieb commented on July 17, 2024

Done! No problem. Thanks for maintaining the gem.

from sparql-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.