GithubHelp home page GithubHelp logo

mayaeh / rdf-canonize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from digitalbazaar/rdf-canonize

0.0 2.0 0.0 232 KB

An implementation of the RDF Dataset Normalization Algorithm in JavaScript.

License: Other

JavaScript 100.00%

rdf-canonize's Introduction

rdf-canonize

Build status Dependency Status

An implementation of the RDF Dataset Normalization Algorithm in JavaScript.

Introduction

...

Installation

node.js + npm

npm install rdf-canonize
const canonize = require('rdf-canonize');

node.js + npm + native bindings

This package has support for rdf-canonize-native. This package can be useful if your application requires doing many canonizing operations asyncronously in parallel or in the background. It is highly recommended that you understand your requirements and benchmark using JavaScript vs native bindings. The native bindings add overhead and the JavaScript implementation may be faster with modern runtimes.

The native bindings are not installed by default and must be explicitly installed.

npm install rdf-canonize
npm install rdf-canonize-native

Note that the native code is not automatically used. To use the native bindings you must have them installed and set the useNative option to true.

const canonize = require('rdf-canonize');

Browser (AMD) + npm

npm install rdf-canonize

Use your favorite technology to load node_modules/dist/rdf-canonize.min.js.

HTML

Various NPM proxy CDN sites offer direct access to NPM files.

Examples

const dataset = {
  // ...
};

// canonize a data set with a particular algorithm with callback
canonize.canonize(dataset, {algorithm: 'URDNA2015'}, function(err, canonical) {
  // ...
});

// canonize a data set with a particular algorithm with async/await
const canonical = await canonize.canonize(dataset, {algorithm: 'URDNA2015'});

// canonize a data set with a particular algorithm with callback
// force use of the native implementation
canonize.canonize(dataset, {
    algorithm: 'URDNA2015',
    useNative: true
  }, function(err, canonical) {
  // ...
});

Related Modules

Tests

This library includes a sample testing utility which may be used to verify that changes to the processor maintain the correct output.

The test suite is included in an external repository:

https://github.com/json-ld/normalization

This should be a sibling directory of the rdf-canonize directory or in a test-suites dir. To clone shallow copies into the test-suites dir you can use the following:

npm run fetch-test-suite

Node.js tests can be run with a simple command:

npm test

If you installed the test suites elsewhere, or wish to run other tests, use the TEST_DIR environment var:

TEST_DIR="/tmp/tests" npm test

To generate earl reports:

# generate the earl report for node.js
EARL=earl-node.jsonld npm test

Benchmark

See docs in the benchmark README.

Source

The source code for this library is available at:

https://github.com/digitalbazaar/rdf-canonize

Commercial Support

Commercial support for this library is available upon request from Digital Bazaar: [email protected]

rdf-canonize's People

Watchers

 avatar  avatar

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.