zazuko / rdf-validate-shacl

Validate RDF data purely in JavaScript. An implementation of the W3C SHACL specification on top of the RDFJS stack.
MIT License
99 stars 13 forks source link

SHACL SPARQL constraints support #104

Open MuhammadShafaatKhan13 opened 1 year ago

MuhammadShafaatKhan13 commented 1 year ago

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

tpluscode commented 1 year ago

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.

sroertgen commented 1 year ago

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.

saumier commented 1 year ago

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 1 year ago

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

benjaminaaron commented 1 year ago

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 1 year ago

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

rubensworks commented 11 months ago

👋 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.

jacoscaz commented 8 months ago

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.

rubensworks commented 6 months ago

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