Skip to content

A library making it easier to work with different triplestores by providing a unified interface for common admin and user actions.

Notifications You must be signed in to change notification settings

zazuko/store-api

Repository files navigation

store-api

CI status Coverage Status npm version

A library making it easier to work with different triplestores by providing a unified interface for common admin and user actions.

Supported stores:

Documentation

Common Interface

Usage

import { Fuseki, GraphDB, Stardog } from 'store-api'

const dbname = 'test'

const db = new Fuseki({ user: '…', password: '…', endpoint: 'http://…' }) // or GraphDB or Stardog
await db.createDb(dbname)

await db.import(dbname, fs.readFileSync('./triples.nt'))

const count = await db.select(dbname, 'select (count(*) as ?tot) where { ?s ?p ?o. }')
const inserted = Number(count.results.bindings[0].tot.value)
console.log({ inserted })

await db.clearDb(dbname)
await db.dropDb(dbname)

The tests create, drop, clear DBs, import data and query data, they can also be used as usage reference.

Store Specific

User Management & Permissions

Fuseki

Not supported

GraphDB

Documentation: https://ontotext-ad.github.io/graphdb.js/GraphDBServerClient.html

import { GraphDB } from 'store-api'

const db = new GraphDB({ user: '…', password: '…', endpoint: 'http://…' })

db.conn.getUser(username)

Stardog

Documentation: https://github.com/stardog-union/stardog.js/tree/065edf84d92f50dc6ad9a6548d0bc9b16325cd3d#user

import { Stardog } from 'store-api'
import stardogLib from 'stardog'
const { user } = stardogLib

const db = new Stardog({ user: '…', password: '…', endpoint: 'http://…' })

user.get(db.conn, username, params)

About

A library making it easier to work with different triplestores by providing a unified interface for common admin and user actions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published