mirror of
https://code.mro.name/mro/librdf.sqlite
synced 2026-01-14 14:22:34 +01:00
🛠 improved SQLite RDF triple store for Redland librdf
http://purl.mro.name/librdf.sqlite/
- Turtle 97.2%
- C 2.1%
- TSQL 0.5%
- Shell 0.2%
| sql | ||
| test | ||
| tools | ||
| .gitignore | ||
| .travis.yml | ||
| CHANGELOG.md | ||
| doap.rdf | ||
| librdf.sqlite.podspec | ||
| LICENSE | ||
| package.json | ||
| rdf_storage_sqlite_mro.c | ||
| rdf_storage_sqlite_mro.h | ||
| README.md | ||
| VERSION | ||
Improved SQLite RDF triple storage module for librdf.
Cross platform, plain C source file. Comes with a for those targeting iOS.
Inspired by the official sqlite store.
Usage
#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.
License
test/minunit.h, Copyright (C) 2002 John Brewer, NO WARRANTY,- all others, Copyright (C) 2014-2015 Marcus Rohrmoser mobile Software, Human Rights License
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).