Skip to content

nicola/rdf-store-multi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published