Hi Gaspar,
No, not currently.
Are you asking for rerun all of the shapes on the database as
conditional to commit, or to run on the changes only?
There is a Fuseki validation service which applies shapes to a graph in
a dataset and returns a report. The code is SHACL_Validator.java. It is
not tied into transactions though.
https://github.com/apache/jena/tree/main/jena-fuseki2/jena-fuseki-core/src/main/java/org/apache/jena/fuseki/servlets/SHACL_Validation.java
Note it is a read operation and can happen in-parallel with other Fuseki
requests.
There is a java code for integrating in with transfor for use from Java:
Example Shacl02_validateTransaction
https://github.com/apache/jena/tree/main/jena-examples/src/main/java/shacl/examples/Shacl02_validateTransaction.java
SHACL constraints can be roughly be divided into ones that only consider
a single triple, (e.g. sh:datatype), those that look at an "entity", all
triples with same subject (sh:minCount), and those that need access to
the whole database (this includes SPARQL-based ones because it is hard
to look inside the SPARQL to know what it touches). Complicated cases
are changes to data multiple triples away from a target start point.
They have different performance characteristics.
Unconstrained SHACL can be expensive and holding up a write transaction
for an expensive validation is not going to be a good experience (TDB2 -
queries can continue, other updates will need to be held back). For
example, a large database that receives many small update.
But single triple constraints can be streamed. So one possible future
feature is a transaction step where basic validation is done, leaving
full validation to a report validator.
SHACL 1.2 makes analysis harder - targets can be expressions needing
evaluation.
jena-shacl is SHACL 1.0, core and sparql, but it does have SPARQL-based
targets from SHACL AF.
Andy
On 29/07/2026 13:35, Gaspar Bartalus wrote:
Hello,
I would be interested to know if there is any configuration option
available for Jena Fuseki to enable SHACL validation on every update
operation/query for a given dataset, i.e. a validation based on the shapes
existing in the dataset. The broader scope would be to block data updates
in case the constraints are not matched. Thanks in advance for the
suggestions!
Regards,
Gaspar