zazuko/rdf-validate-shacl

SHACL SPARQL constraints support

MuhammadShafaatKhan13 opened this issue ยท 9 comments

Is adding SHACL SPARQL constraints support into this library, currently on the roadmap of the development?

Hello @MuhammadShafaatKhan13. SHACL SPARQL is definitely something that we would like to have.

The biggest blocker right now is an in-memory implementation of SPARQL queries. The only working option that I know of is Comunica, but that would be very heavy, especially for the browser. We have hopes for Callidon/sparql-engine but it is not yet compatible with the RDF/JS model.

Another consideration is extensibility. Additional functionality, such as custom targets and constraints, should be supported in some form of plugins. That would likely require refactoring.

I'm also highly interested in this. Unfortunately I don't find that mentioned fork. Would also be willing to actively work on this. Though I can't estimate the effort right now.

It may be of interest to the group to know that there is a ruby library called shacl.rb with support for SHACL SPARQL. https://github.com/ruby-rdf/shacl/releases/tag/0.3.0. Perhaps there are some common patterns and solutions that could cross over.

ktk commented

@tpluscode Oxigraph JS might be a way forward for this one as well.

I am also very interested in SHACL-SPARQL constraints with your library.
Or is there another JS library for SHACL validation you know about that supports this?

ktk commented

There is https://github.com/rdf-ext/shacl-engine but it doesn't do SPARQL either.

๐Ÿ‘‹ Just came across this issue.

The only working option that I know of is Comunica, but that would be very heavy, especially for the browser.

Regarding this, the default query-sparql engine of Comunica contains many modules, which indeed becomes quite big in the browser. However, it's possible to create your own Comunica engine, in which you can include only those modules you want. For instance, @jacoscaz has followed this approach in Quadstore to ship a very small build of Comunica for the browser.

Just found this issue myself. For reference, I've recently been working on updating quadstore-comunica to the newly-released V3 of Comunica and the non-minified bundle for both server-side and browser-side usage sits at roughly 1.2 MB. A complete browser-side bundle that includes quadstore, quadstore-comunica, browser-level and rdf-data-factory sits at roughly 750 kB (minified). Happy to help if anyone would like to follow a similar path.

FYI, our new @comunica/query-sparql-rdfjs-lite package might be relevant here.