Giter VIP home page Giter VIP logo

quadstore-browser's Introduction

Using quadstore in browsers

This project serves as a reference for developers looking to use quadstore in web browsers.

The webpack.config.js file contains the reference configuration for Webpack 5.x that is used to transform dist/bundle.js (initially produced by the TypeScript compiler) into an actual bundle ready for use in browsers as an ES module.

The bundle contains quadstore, the quadstore-comunica SPARQL query engine, the browser-level backend for persistent storage via IndexedDB and rdf-data-factory, an implementation of the RDF/JS DataFactory interface.

package version
quadstore 13.1.0
quadstore-comunica 4.2.0
browser-level 1.0.1
rdf-data-factory 1.1.2

The static/index.html page and associated dist/main.js script provide a small demonstration of how to use all of the above.

The bundle file is also served at https://cdn.jsdelivr.net/gh/jacoscaz/quadstore-browser/dist/bundle.js and can be used in webpages as follows:

<script type="module">
    import {
        Quadstore,
        Engine,
        BrowserLevel,
        DataFactory,
    } from 'https://cdn.jsdelivr.net/gh/jacoscaz/quadstore-browser/dist/bundle.js';
    const backend = new BrowserLevel('quadstore');
    const dataFactory = new DataFactory();
    const store = new Quadstore({ backend, dataFactory });
    const engine = new Engine(store);
    await store.open();
    await store.clear();
    await store.put(dataFactory.quad(dataFactory.namedNode('ex://s'), dataFactory.namedNode('ex://p'), dataFactory.namedNode('ex://o')));
    const stream = await engine.queryBindings(`SELECT * WHERE { ?s ?p ?o }`);
    stream.on('data', console.log);
</script>

How to build

npm install
npm run build

Issues

Issues should be reported in quadstore's issue tracker.

quadstore-browser's People

Contributors

jacoscaz avatar

Stargazers

Benno Kruit avatar Kevin Nolan avatar Reto Gmür avatar

Watchers

James Cloos avatar Matteo Murgida avatar Antonio Rù avatar

Forkers

michaelcpuckett

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.