Git Product home page Git Product logo

shacl-js's Introduction

SHACL.js Build Status

Usage

Create a new SHACL validator and load shapes and data to trigger the validation. The validation function returns a ValidationReport object that can be used to inspect conformance rand results.

var validator = new SHACLValidator();
validator.validate(data, "text/turtle", shapes, "text/turtle", function (e, report) {
    console.log("Conforms? " + report.conforms());
    if (report.conforms() === false) {
        report.results().forEach(function(result) {
            console.log(" - Severity: " + result.severity() + " for " + result.sourceConstraintComponent());
        });
    }
});

Building for the web

A browser version of the library will be built in the dist directory using the gulp browserify task.

Running the tests

Tests can be run using the test gulp task.

Running the web tests

Tests can be run for the browser version running the test-web gulp task. This task will generate the test cases from the node version and start a server in port 3000. The browser version of the library must have been built before running this task.

Regenerating vocabularies and libraries

The vocabularies for SHACL and DASH are located in the vocabularies directory. After modifying these files, they must be transformed into library code using the generate-vocabularies gulp task. The JS libraries referenced in the DASH vocabulary can be found in the shared directory. They can be bundled into the library build using the generate-libraries gulp command. If they are not bundled, the library will try to de-reference them using HTTP.

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.