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

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