Re: Starting with SHACL-JS

On 15/02/2020 02:35, Angelo Frozza wrote:
> > Just clarify, SHACL-JS usually refers to https://www.w3.org/TR/shacl-js/
> > which is the ability to define and execute constraints in JavaScript. 
> Yes, that's right!
> > SHACL-JS is not about JavaScript-based implementations of a SHACL 
> > engine, in case these topics get mixed.
> Yes, that's right!
> I was using Apache JENA to validate shapes with SHACL-SPARQL.
> Now I want to make the same shapes, but using SHACL-JS.
> It is easier for me to create JavaScript functions than SPARQL.
>
> > SHACL-JS is fully implemented by https://github.com/TopQuadrant/shacl
>  From the address indicated, I installed the shacl on my mac book.
>
> > There is also a partial implementation of SHACL-JS in JavaScript itself, see
> > https://shacl.org/playground/
> As I understand it. SHACL Playground does not read JavaScript files?
> To test, I copied example 6.1 from the SHACL JavaScript Extensions website (https://www.w3.org/TR/shacl-js/).
> Three files were created (file with JavaScript function; Data graph and Shape Graph).
>
> The file with the Javascript function I put in a folder underhttp://localhost/.
>
> And I run the following command line:
>
> sh shaclvalidate.sh -datafile SHACL-JS-W3C-DataGraph.ttl -shapesfile SHACL-JS-W3C-ShapeGraph.ttl
>
> Apparently, SHACL is running the validation, but in the end, the report appears without errors.
> However, there is an instance of the Data Graph with an error, which is not reported.
> I am not able to identify where the problem may be or if the JavaScript function is actually being executed.

The SHACL playground states at the bottom: "No dynamic loading of 
JavaScript libraries and sh:js". The Playground was mostly a 
demonstrator and seemed to have been useful for several people to get 
started. It was not my intention to make it a full implementation, and 
unfortunately I don't have the time to properly maintain it. You could 
take a copy of its code base and evolve it to your needs, or use the 
Java-based SHACL API.

HTH
Holger

Received on Monday, 17 February 2020 00:31:18 UTC