Comments (9)
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.
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.
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.
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.
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.
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.
No, you can comment them back in. Even though there are errors, it's useful for finding regressions when running locally.
from sparql-client.
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.
Done! No problem. Thanks for maintaining the gem.
from sparql-client.
Related Issues (20)
- utf-8 characters raise errors in URI/common HOT 3
- Authorization fails - verbose option? HOT 1
- Update Repository to use SPARQL
- Blank Nodes in Graph Patterns HOT 7
- SPARQL Query => SPARQL::Client::Query API Interface HOT 5
- DSL support for `MINUS` HOT 2
- wrong parameter in HTTP headers? HOT 1
- Update requests parse the result for no purpose HOT 3
- Semantic Versioning & Import Fixes to Previous Versions HOT 5
- FILTER inside OPTIONAL Clause HOT 2
- EOF Error leading to segmentation fault for heavy construct queries. HOT 3
- Different results between sparql-client and linkeddata gems HOT 5
- UTF-8 characters raise an error on sparql insert HOT 7
- Unclosed connections with SPARQL::CLIENT HOT 10
- Infinite redirect error for unesco vocabulary sparql endpoint HOT 1
- malformed prefix example in docs HOT 6
- If you are using Wikidata, it requires User-Agent HOT 1
- SPARQL::Client::Query#values raises NameError
- Ruby warning in query_without_retry method HOT 4
- Feature request: support for SERVICE HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sparql-client.