rdf-raptor icon indicating copy to clipboard operation
rdf-raptor copied to clipboard

CLI/Rapper hanging on (apparently) OK RDF/XML input

Open CountCulture opened this issue 14 years ago • 4 comments

This is generally working OK for me, but I'm getting it hanging with no apparent errors on the following RDF/XML output produce by w3c Distiller at the following URL: http://www.w3.org/2007/08/pyRdfa/extract?uri=http%3A%2F%2Fwww.scambs.gov.uk%2FCouncilAndDemocracy%2FElections%2F2010results.htm

Running it from the console, it just hangs: RDF::Reader.for(:rdfxml).new(open("http://www.w3.org/2007/08/pyRdfa/extract?uri=http%3A%2F%2Fwww.scambs.gov.uk%2FCouncilAndDemocracy%2FElections%2F2010results.htm"))

interrupting it gives:

CIRB::Abort: abort then interrupt!! from /opt/local/lib/ruby/1.8/irb.rb:81:in irb_abort' from /opt/local/lib/ruby/1.8/irb.rb:247:insignal_handle' from /opt/local/lib/ruby/1.8/irb.rb:66:in start' from /opt/local/lib/ruby/gems/1.8/gems/rdf-raptor-0.3.0/lib/rdf/raptor/cli.rb:31:incall' from /opt/local/lib/ruby/gems/1.8/gems/rdf-raptor-0.3.0/lib/rdf/raptor/cli.rb:31:in write' from /opt/local/lib/ruby/gems/1.8/gems/rdf-raptor-0.3.0/lib/rdf/raptor/cli.rb:31:ininitialize' from (irb):104:in `new'

Any ideas? Mac OS X 10.5.8, rdf-raptor 0.3.0, rapper 1.4.21

CountCulture avatar May 12 '10 09:05 CountCulture

I had very similar issues with the same OS setup. I never quite figured it out, but for whatever reason, a reboot fixed it. It had something to do with the OS not sending EOF's properly. I hurled myself at this for hours before I realized it was below both Ruby and Raptor.

See http://github.com/bendiken/rdf-raptor/issues/closed#issue/3

bhuga avatar May 12 '10 09:05 bhuga

There are reader/writer deadlocks in the cli implementation which I've made a stab at addressing in http://github.com/jfieber/rdf-raptor.

The output of rapper goes into a pipe, and pipes are finite. If there is no reader consuming the pipe data, rapper will eventually block when writing to the pipe. My fix is simply to read for any rapper output to ensure the rapper's output pipe is clear before shoving something in the input pipe.

Having got those working, I've shifted to implementing an ffi writer, which ought to be quite a bit more efficient.

jfieber avatar May 12 '10 20:05 jfieber

Chris, could you try again with John's fork of RDF::Raptor. When Ben had this problem earlier, I suspected the very reason that John outlines, and since John's solution looks good to me, hopefully that should fix the problem you are experiencing.

artob avatar May 20 '10 18:05 artob

FYI, I've now merged John's work into the mainline, and will release a new major version of the gem after I've had a chance to do some testing (which might not be for a few days yet).

artob avatar May 20 '10 18:05 artob