🛠 improved SQLite RDF triple store for Redland librdf http://purl.mro.name/librdf.sqlite/

Marcus Rohrmoser 0bd4c75d5d add git mirrors 2 years ago
sql 75d421fcf8 fix compiler warnings and stricter compilations (-Wall -Werror) 7 years ago
test a5515c8442 compare with vanilla sqlite store. 4 years ago
tools 46f79ca9b0 💄 refs #13 7 years ago
.gitignore b40e671d71 less indexes. saves 50% space but has low impact on runtime. refs #2 8 years ago
.travis.yml d74dd7ef31 🌀. 5 years ago
CHANGELOG.md 487dfb3fd0 Release 0.0.1 8 years ago
LICENSE 6b53ca31de copyright year 7 years ago
README.md 565289c4d1 'README.md' ändern 4 years ago
VERSION 48d4ded329 give cocoapods another try. 6 years ago
doap.rdf 0bd4c75d5d add git mirrors 2 years ago
librdf.sqlite.podspec f40450aa25 brush up podfile. 6 years ago
package.json 3a21a87c1d add a package description for https://github.com/clibs/clib 6 years ago
rdf_storage_sqlite_mro.c 75cec9d59a fix copy-paste error that caused -DDEBUG build to fail 3 years ago
rdf_storage_sqlite_mro.h a7080b1b05 Update rdf_storage_sqlite_mro.h 6 years ago


Build Status

Improved SQLite RDF triple storage module for librdf.

Cross platform, plain C source file. Comes with a Version for those targeting iOS.

Inspired by the official sqlite store.


#include "rdf_storage_sqlite_mro.h"
librdf_world *world = librdf_new_world();
librdf_init_storage_sqlite_mro(world);  // register storage factory
const char* options = "new='yes', contexts='no'";
librdf_storage *newStorage = librdf_new_storage(world, LIBRDF_STORAGE_SQLITE_MRO, file_path, options);

See e.g. in (my) http://purl.mro.name/ios/librdf.objc.


Design Goals

Quality very good good normal  irrelevant
Functionality ×
Reliability ×
Usability ×
Efficiency ×
Changeability ×
Portability ×

Currently 50% code and 99% runtime saving (for 100k triples).

  • intense use of SQLite prepared statements and bound values:
    • no stringbuffers
    • no strcpy/memcpy,
    • no SQL escaping,
  • re-use compiled statements where possible (at the cost of thread safety),
  • as few SQL statements as possible (at the cost of some non-trivial ones),
  • SQLite indexes (at the cost of larger DB files).