Package Exports
- rdf-store-multi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (rdf-store-multi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
rdf-store-multi
RDF Store that can run multiple RDF stores RDF-Ext Interface specification.
Install
npm install --save rdf-store-multi
Usage
You will have to specify a router
in the options
to route to which store should perform a method
var string = require('string')
var rdf = require('rdf-ext')()
var LdpStore = require('rdf-store-ldp')
var FileStore = require('rdf-store-fs')
var MultiStore = require('rdf-store-multi')
var ldp = new LdpStore(rdf)
var fs = new FileStore(rdf)
var multi = new MultiStore({
router: function (method, args, callback) {
var iri = args[0]
if (string(iri).startsWith('http://localhost')) {
callback(null, fs)
} else {
callback(null, ldp)
}
}
})
The above example is implemented in rdf-store-server
History
Originally written by Nicola Greco
Licence
MIT