Project

rdf-lmdb

0.0
Low commit activity in last 3 years
This module implements RDF::Repository on top of LMDB, a fast and robust key-value store.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 13
~> 3

Runtime

~> 0.6.1
~> 3
~> 0.1
 Project Readme

RDF::LMDB - Lightweight, persistent, transactional RDF store

This library implements RDF::Repository using the Symas Lightning MDB key-value database. It is intended to be a basic, durable, locally-attached quad store, that avails itself of the properties of LMDB.

RDF::LMDB is also intended to provide a reference implementation of an architecture for storing RDF in any key-value database, such that this adapter could be ported, or indeed the data imported, to other back-ends (e.g. Berkeley DB, LevelDB, Kyoto Cabinet…) without having to significantly change the design. The only real requirement for the back-end is some kind of cursor functionality, and the handling of multi-valued keys.

Architecture

The system uses binary SHA-256 digests of N-Triples representations of terms and statements. Terms are normalized first before being hashed. The hashes themselves are stored in their binary representation.

Triples

The main content of the store is keyed on the hash of a normalized N-Triples statement (including the terminating .). Its values are the concatenated hashes of the individual terms:

sha256(s <sp> p <sp> o " .") => sha256(s) sha256(p) sha256(o)

GSPO

There are four indices that resolve terms to statements, graph, subject, predicate, object, respectively:

sha256(term) => sha256(s <sp> p <sp> o " .")

Node Resolution

Finally, there is an index that maps the digests of the terms back to their normalized N-Triples representations:

sha256(term) => term

API Documentation

Generated and deposited in the usual place.

Installation

Come on, you know how to do this:

$ gem install rdf-lmdb

Or, download it off rubygems.org.

Contributing

Bug reports and pull requests are welcome at the GitHub repository.

Copyright & License

©2019 Dorian Taylor

This software is provided under the Apache License, 2.0.