[redland-dev] About redland storage in sqlite

Dave Beckett dave at dajobe.org
Tue Sep 22 18:44:58 CEST 2009


zy zy wrote:
> Hi:
>     It's my first time to send mail in this list and ask for help. So
> please tell me if I make some mistake in using this mail list :D
>     I recently had a problem in using redland. I want to store the data
> via sqlite storage module. And according to the API on the librdf.org
> <http://librdf.org>, I used the following
>     world=librdf_new_world();
>     librdf_world_open(world);
>     storage=librdf_new_storage(world,"sqlite","new='yes'");
>     But I got NULL value of storage. I had installed sqlite3 in my
> ubuntu 8.04 and I the sqlite3 worked well. Can you help me with this
> problem. Thanks a lot.

The API isn't quite what you have above - so I don't see how it could have
compiled.

It has parameters:
  librdf_new_storage(world, storage_name, name, options_string)
and you are missing 'name' which for sqlite, turns into the sqlite3 filename

see http://librdf.org/docs/api/redland-storage.html#librdf-new-storage

Alternatively, are you sure sqlite is compiled into redland?  Use
  rdfproc -h
to see what it thinks are available.  The output should be something like:
...
  -s, --storage TYPE      Set the graph storage type
    hashes                  Indexed hashes (default)
    trees                   Balanced trees
    memory                  In memory lists
    file                    Local file based store
    uri                     URI store (read-only)
    sqlite                  SQLite
...

It may vary depending on how your redland was compiled.

Dave



More information about the redland-dev mailing list