Papers
Topics
Authors
Recent
Search
2000 character limit reached

SHACL-Based Update Language

Updated 3 July 2026
  • SHACL-based Update Language is a formal system for precisely modifying RDF graphs while maintaining compatibility with SHACL constraints.
  • It uses a structured syntax with basic and complex update actions—including conditional operations and regression techniques—to translate updates into constraint satisfiability problems.
  • The language features static validation with rigorous complexity classifications and is supported by prototype tools that demonstrate its practical feasibility on synthetic benchmarks.

A SHACL-based update language is a formal system for specifying and reasoning over modifications to RDF graphs while ensuring compatibility with SHACL (SHApe Constraint Language) constraints. It enables precise characterization of class and property insertions/deletions through a structured, recursively defined syntax, and supports analysis of how updates affect SHACL validation in evolving knowledge graphs. The framework also provides techniques for static, data-independent validation of updates by means of translation (“regression”) into SHACL constraint satisfiability, accompanied by thorough complexity analysis and prototype tool support (Ahmetaj et al., 31 Jul 2025).

1. Formal Syntax for SHACL-Based Updates

The SHACL-based update language is grounded in disjoint infinite sets: nodes (NnN_n), class names (NcN_c), property names (NpN_p), shape names (NsN_s), and variables (NvN_v). Path expressions (EE) and shape formulas (φ\varphi) are drawn from SHACL+^+, extending ordinary SHACL with operations such as difference (EFE \setminus F) and “Cartesian” shape-property pairs (φ1,φ2)(\varphi_1,\varphi_2).

Basic update actions (NcN_c0) are:

  • NcN_c1 inserts class NcN_c2 for objects satisfying shape NcN_c3,
  • NcN_c4 removes class NcN_c5,
  • NcN_c6 inserts property NcN_c7 for pairs in path NcN_c8,
  • NcN_c9 removes property NpN_p0 according to path NpN_p1, with NpN_p2, NpN_p3, NpN_p4 and NpN_p5 variable-free.

Complex actions (NpN_p6) are constructed as:

  • NpN_p7, where NpN_p8 is a (possibly conditional) SHACLNpN_p9 shapes-graph formula; NsN_s0 is shorthand for NsN_s1. The structure permits sequential composition and conditionals on graph validation.

2. Operational Semantics on RDF Graphs

Let NsN_s2 be an RDF graph. The graph transformation induced by an action sequence NsN_s3 is defined recursively:

  • NsN_s4
  • NsN_s5
  • NsN_s6
  • NsN_s7
  • NsN_s8
  • NsN_s9
  • up(G,(S?α1[α2])α)={up(G,α1α),amp;if GS up(G,α2α),amp;otherwiseup(G,(S?\alpha_1[\alpha_2])\cdot\alpha) = \begin{cases} up(G,\alpha_1\cdot\alpha), & \text{if } G\models S \ up(G,\alpha_2\cdot\alpha), & \text{otherwise} \end{cases}

NvN_v0 denotes SHACLNvN_v1 conformity, and NvN_v2 denotes shape evaluation.

3. Regression: Eliminating Updates via Constraint Rewriting

The regression technique rewrites shape graphs NvN_v3 to simulate the effect of applying updates, reducing validation after updates to constraint satisfaction prior to the update. Given NvN_v4, the translation satisfies

NvN_v5

For NvN_v6 (without Boolean connectives), translation is as follows:

  • NvN_v7
  • NvN_v8
  • NvN_v9
  • EE0
  • EE1

For conditionals:

EE2

Inductive correctness is established (Theorem 3.2) (Ahmetaj et al., 31 Jul 2025).

4. Static Validation and Reduction to Satisfiability

The static validation problem asks whether a sequence EE3 preserves EE4 on all EE5 satisfying EE6. Non-preservation is captured by the existence of EE7 and some grounding EE8 such that EE9 but φ\varphi0. By regression, this is equivalent to φ\varphi1 and φ\varphi2, i.e., the joint satisfiability of φ\varphi3. It suffices to consider only groundings where variables in φ\varphi4 are instantiated by constants appearing in φ\varphi5 or a fresh constant (Theorem 4.2).

Summary:

Problem Reduction Key Result/Condition
Is φ\varphi6 S-preserving? φ\varphi7 sat? Finitely many groundings

5. Complexity Classifications for Static Validation

  • For unrestricted SHACLφ\varphi8 (“SHACLφ\varphi9”), static validation is undecidable, as is SHACL satisfiability.
  • Restricting to the fragment SHACLᶠ (excluding path star (+^+0), concatenation (+^+1), +^+2, disj(+^+3), closed(+^+4)), where shapes are expressible in +^+5 (a description logic), static validation is coNExpTime-complete.
  • With further restrictions—only existential number restrictions (+^+6), singleton shape-properties in paths—complexity drops to ExpTime-complete.

In both cases, the “co” reflects that non-preservation reduces to satisfiability of +^+7 in a description logic whose finite satisfiability is in NExpTime or ExpTime (Theorem 4.3) (Ahmetaj et al., 31 Jul 2025).

6. Example: Discharging and Physician Handling in a Clinical RDF Graph

Given:

  • Initial data graph +^+8 with patients, patient status, physicians, and treatsPatient relations.
  • Shapes graph +^+9:
    • EFE \setminus F0PatientShape EFE \setminus F1 ActivePatient EFE \setminus F2 DischargedPatient, PhysicianShape EFE \setminus F3 Physician EFE \setminus F4 EFE \setminus F5trEFE \setminus F6.ActivePatientEFE \setminus F7
    • EFE \setminus F8(Patient,PatientShape), (EFE \setminus F9tr(φ1,φ2)(\varphi_1,\varphi_2)0,PhysicianShape)(φ1,φ2)(\varphi_1,\varphi_2)1

Action (φ1,φ2)(\varphi_1,\varphi_2)2:

  • (φ1,φ2)(\varphi_1,\varphi_2)3

Operationally:

  1. Remove ActivePatient((φ1,φ2)(\varphi_1,\varphi_2)4); add DischargedPatient((φ1,φ2)(\varphi_1,\varphi_2)5); update physicians who only treat (φ1,φ2)(\varphi_1,\varphi_2)6.
  2. (φ1,φ2)(\varphi_1,\varphi_2)7 because Tom treats (φ1,φ2)(\varphi_1,\varphi_2)8 but is neither Physician nor treats active patient.
  3. Compute (φ1,φ2)(\varphi_1,\varphi_2)9 via regression:
    • Replace ActivePatient by ActivePatientNcN_c00,
    • DischargedPatient by DischargedPatientNcN_c01,
    • Physician by PhysicianNcN_c02trNcN_c03,
    • NcN_c04trNcN_c05.ActivePatient by NcN_c06trNcN_c07(ActivePatientNcN_c08).
  4. NcN_c09, consistent with NcN_c10.
  5. Modify update to safely remove Tom’s edge, and the new regression NcN_c11 is satisfiable.

7. Implementation and Experimental Evaluation

The SHACL2FOL tool (Pareti et al.) was extended to:

  • Parse SHACLNcN_c12 shapes-graphs and ground action lists,
  • Emit TPTP files for FOL axiomatization of NcN_c13 and NcN_c14.

Vampire (finite-model mode) is used for satisfiability checking of NcN_c15. Empirical results on synthetic SHACL benchmarks:

  • With 10 shapes and up to 200 actions, wall-clock time grows roughly linearly in the number of actions.
  • With 20 actions and number of shapes scaled from 10 to 70, time grows exponentially (in accord with coNExpTime hardness).
  • Vampire times out (fails to decide) on approximately 8–16% of cases, but typical examples up to 50 shapes and 100 actions are solved within seconds.

In sum, the SHACL-based update language provides a rigorous, modular framework for the controlled modification of RDF graphs under SHACL constraints, links update validation to SHACL constraint satisfiability through regression, characterizes the precise computational complexity of static validation for key language fragments, and offers practical implementation and evaluation—demonstrating both theoretical completeness and practical feasibility (Ahmetaj et al., 31 Jul 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SHACL-based Update Language.