Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

seronet-project/blazegraph-js

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blazegraph JavaScript API

npm version PRs Welcome

Blazegraph JavaScript API.

Installation

npm install blazegraph --save

Usage

Many (undocumented yet) methods are available. Have a look at the source for more info.

preparation

const {prepareBlazeUrl} = require('blazegraph')
const db = prepareBlazeUrl({
  host: 'localhost',
  port: 9999,
  namespace: 'kb', // Those are the default values, passing no params yields the same result
});

sparql query - output written to the console

const {composeP} = require('ramda')
const {SELECT} = require('blazegraph')
composeP(
  console.log, // An array of objects of the shape { subject, predicate, object, graph }
  SELECT`select * { ?s ?p ?o } limit 10`,
)(db)

read quads - output written to the console

const {composeP} = require('ramda')
const {readQuads} = require('blazegraph')
composeP(
  console.log, // An array of objects of the shape { subject, predicate, object, graph }
  readQuads({
    predicate: '<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>',
    object: '<http://example.com/Person>',
  })
)(db)

single pipeline using default options

const {composeP} = require('ramda')
const {SELECT, prepareBlazeUrl} = require('blazegraph')

composeP(
  console.log,
  SELECT`select * { ?s ?p ?o } limit 10`,
  prepareBlazeUrl
)()

Note

Unstable, do not use in production! The current API is quite specific to Nelson, but feel free to PR breaking changes to make it universal.

Contributing

Yes, thank you. Please lint, update/write tests and add your name to the package.json file before you PR.

License

Blazegraph-js is released under the MIT license.

Blazegraph is freely available under the GPLv2 open-source license.

About

Blazegraph JavaScript API

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.