W3C home > Mailing lists > Public > public-rdf-ruby@w3.org > April 2010

Re: RDF-raptor FFI benchmarks

From: Arto Bendiken <arto.bendiken@gmail.com>
Date: Mon, 5 Apr 2010 21:18:09 +0200
Message-ID: <u2z47fe11b71004051218w310cccf4la897b11bc67792f5@mail.gmail.com>
To: carmen <_@whats-your.name>
Cc: public-rdf-ruby@w3.org
On Mon, Apr 5, 2010 at 11:15 AM, carmen <_@whats-your.name> wrote:
>> PS. RDF::Raptor 0.2.0, released yesterday, included an initial set of
>> FFI bindings to Raptor, as well as RDF::Reader implementations based
>
> cool!
>
> my tools use tripleStreams :: URIString,URIString,(Resource URIString,Graph)|URIString so ive got unwrappers [1] and [2]
>
> parsing all the ttl files in git clone git://git.librdf.org/repositories/{bindings,librdf,raptor,rasqal}.git
>
> [...]
>
> looking good.. worked out of the box too :)

Those are pretty nice initial results, thanks for benchmarking that.

> [1]
>  def raptor
>    ::RDF::Raptor::Turtle::Reader.open(d){|r|r.each_triple{|t|
>        yield t[0].to_s,
>        t[1].to_s,
>        ((t[2].class==::RDF::Node||t[2].class==::RDF::URI) ?
>         (E t[2].to_s) :
>         t[2].value)
>      }}; self
>  end

Note that instead of "t[2].class == RDF::Node || t[2].class ==
RDF::URI" you can use the briefer test "t[2].is_a?(RDF::Resource)",
or, as of RDF.rb 0.1.5 (to be released tonight), just simply
"t[2].resource?".

-- 
Arto Bendiken | @bendiken
Received on Monday, 5 April 2010 19:18:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 April 2010 19:18:46 GMT