cs.AIJul 30, 2026

Shapes from Examples: Foundations of Shape Learning in Recursive SHACL

Authors: Bente GortworstCem OkulmusMagdalena OrtizAnni-Yasmin Turhan

Organizations: TU Wien, Vienna, Austria · Paderborn University, Paderborn, Germany

Abstract

SHACL shapes enable data graph validation, making automatic shape learning essential for knowledge graph applications. We investigate the well-known fitting approach to this task: given sets P and N of positive and negative example nodes from an input graph, compute a shape expression C, possibly using shape names defined in a recursive shape catalogue, that validates at every node in P and none in N. We focus on the case where C is written in a core fragment of SHACL corresponding to the Description Logic ELI. For the catalogue, we consider the well-founded, stable, and supported semantics. We address fitting existence and most specific fitting computation, establish tight exponential-time upper bounds for both problems, and obtain polynomial bounds for relevant special cases.

Explore similar work

CardsList
  1. Static Analysis of Recursive SHACL

    May 4, 2026Anouk Oudshoorn, Magdalena Ortiz, Mantas SimkusModal LogicLabel Constraint Modeling

  2. Bounded Fitting for Expressive Description Logics

    May 8, 2026Maurice Funk, Jean Christoph Jung, Tom VoellmerSatisfiabilityNew Bounds