-
-
Save fumi/459459 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby | |
require 'rdf' | |
require 'rdf/raptor' | |
repo = RDF::Repository.new | |
count = 0 | |
while true | |
repo.load("test.ttl") | |
count += 1 | |
puts count | |
end |
@prefix rdfs: <http://www.w3.org/2000/01/01/rdf-schema#> . | |
<http://example.org/1> rdfs:label "Test" . |
It works great and makes faster after setting RDF_RAPTOR_LIBPATH=/opt/local/lib/libraptor.dylib. Thanks! I should add the /opt/local/lib directory into the library path anyway...
Please do file a bug against rdf-raptor for the cli implementation though, referencing this and the issue filed against rdf. Thanks.
will do
I suppose we could also consider improving rdf-raptor's CLI/FFI mode autodetection to look for the FFI library in some well-known locations such as this one. For instance, most Mac OS X users would benefit from it trying the MacPorts location of /opt/local/lib
, yet that path will rarely be in the system's library path since that is known to cause conflicts and general weirdness (hence the numerous DYLD_FALLBACK_LIBRARY_PATH
hacks out there, and so on). Something I'll try and keep in mind for the next point release (please feel free to open a ticket if you'd like to see this feature).
From the trace in http://github.com/bendiken/rdf/issues/#issue/33/comment/294533 it looks like rdf/raptor is falling back to the cli implementation, which happens if it cannot locate the libraptor library. Try setting the RDF_RAPTOR_LIBPATH environment variable to the full path of your libraptor library and see if that solves the problem. That doesn't fix what appears to be a bug in the cli implementation, but the ffi implementation is faster.