Does SRL Pave the Road to Explainable Reasoning? Lessons Learned from an Implementer's Perspective

summary

The gist

The Shape Rules Language (SRL) Working Draft introduces user-defined production rules for deriving new RDF triples from an RDF graph using inference rules…

In short

The Shape Rules Language (SRL) Working Draft introduces user-defined production rules for deriving new RDF triples from existing data using inference. The paper compares two engine implementations, finding that a dedicated engine (Eyeleng) is significantly faster. Key takeaways include the need to define how query operations work and how to track rule provenance for explainability.

Key concepts

SRL
A language for creating custom rules to infer new RDF triples from existing data graphs. It uses production rules with a body (data pattern) and a head (triple templates). This aims to provide a standardized way for rule-based reasoning in RDF.
Stratification
A method used in SRL to prevent non-determinism when rules fire. Stratification orders the set of rules into distinct layers or strata, ensuring that conclusions from one layer are only visible to subsequent layers, creating an ordered sequence of inference.
Infer vs. Query
SRL defines two main operations: 'infer,' which materializes the entire graph based on rules until a fixpoint is reached, and 'query,' which checks if a specific goal pattern is derivable. The paper notes that while 'infer' has an evaluation procedure, 'query' lacks one, impacting explainability.
Provenance
The origin or history of data or triples within the reasoning process. The paper highlights that because the query operation lacks a defined evaluation procedure, bottom-up materialization in some setups does not inherently track which rules led to a specific conclusion, making provenance difficult to establish.

Terminology used across episodes

This episode discusses

The paper

Does SRL Pave the Road to Explainable Reasoning? Lessons Learned from an Implementer's Perspective · Read on arXiv

Ghent University – imec, Belgium

The Shape Rules Language (SRL) Working Draft defines how to derive new RDF triples from an RDF graph using inference rules. Each rule matches graph patterns and instantiates triple templates whose output feeds into validation pipelines, SPARQL queries, or further inference. RDF reasoning has traditionally relied on fixed entailment regimes (RDFS, OWL), rule-based ad-hoc languages such as N3, or other implementation-specific solutions without a shared standard. SRL introduces user-defined production rules with a defined grammar, dependency analysis, execution ordering, and termination guarantees. However, no authoritative implementation exists, leaving practitioners with little guidance on how to build a conformant engine or on what problems the language can solve. We implemented two SRL engines and evaluated both on classical RDF reasoning tasks for soundness, completeness, and speed. The first reuses an existing SPARQL query engine and its query parser; the second is a dedicated engine. The SPARQL-based engine reused an existing modular parser for query construction and SPARQL CONSTRUCT for triple production, reducing engine-specific work. The dedicated engine was two to six times faster, the gap widening as rule sets grow. Both engines were validated against the SRL conformance test suite, supplemented by additional use-case-driven tests. A usable SRL engine can be built inexpensively on top of a SPARQL engine, with a moderate speed trade-off that a dedicated implementation recovers. Despite the specification's immaturity, the language already supports practically useful reasoning tasks.

Transcript

Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.

Tom: I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: We're looking at the paper: "Does SRL Pave the Road to Explainable Reasoning? Lessons Learned from an Implementer's Perspective".

Jane: Here's the gist of the paper. The Shape Rules Language (SRL) Working Draft introduces user-defined production rules for deriving new RDF triples from an RDF graph using inference rules, which addresses the lack of a shared standard in rule-based reasoning systems.

Tom: RDF reasoning has traditionally relied on fixed entailment regimes such as RDFS and OWL, which are rigidly tied to built-in W3C vocabularies and suffer from high computational complexity.

Jane: Rule-based alternatives appeared early but without a shared standard, adoption fragmented into engine-specific dialects.

Tom: The proposed SRL specification in the W3C Data Shapes Working Group brings user-defined production rules into the SHACL family.

Paper summary: Tom: To recap where we are, this paper by Lander Maes and colleagues looks at the Shape Rules Language or SRL, which is a draft defining how you can use user-defined production rules to create new RDF triples from existing data.

Jane: The core thesis is that unlike fixed systems like OWL or RDFS, which have rigid rules tied to specific vocabularies, SRL gives practitioners user-defined production rules with a defined grammar and execution ordering.

Lu: The paper focuses on the fact that while they built two different implementations—one using an existing SPARQL engine and one written in JavaScript—they found key architectural trade-offs between those approaches.

Meng: They compared how fast these engines were, finding that the dedicated engine was up to six times faster than the one reusing SPARQL infrastructure for certain tasks.

Tom: The paper highlights specific concepts like stratification, which they use to prevent non-determinism in rule firing order by partitioning the rules into ordered layers or strata.

Jane: They also explored two main operations: inferring the full inference graph and querying whether a goal pattern is derivable, but only the infer operation had a defined evaluation procedure for how it runs.

Lu: One major finding they bring up is that because of this structure, you get an immediate conclusion once rules fire, which makes it easier to see the chain of reasoning happening.

Jane: This leads directly into the part about explainability, as they discuss how a top-down goal-directed query operation could naturally produce a proof tree showing exactly how the rules fired to get that result.

Tom: They also pointed out some implementation specifics, like issues with blank node syntax in WHERE clauses when comparing their algebra builder to Comunica’s path consumer.

Meng: For someone trying to deploy this at scale, those kinds of implementation details matter because they can cause unexpected breaks in the system when you try to run it on massive datasets.

Lu: Ultimately, the paper concludes that SRL has the necessary bones for a practical rule language with its stratification and fixpoint semantics handled well.

Conclusion: Jane: So, looking at this paper, "Does SRL Pave the Road to Explainable Reasoning? Lessons Learned from an Implementer's Perspective," it really hammers home that the structure of SRL is promising for creating a rule-based reasoning system.

Tom: It lays out a concrete framework for defining rules—the body and the head—and gives us these ideas about how to manage execution order through stratification, which is a big step away from those fragmented, engine-specific dialects we see today.

Lu: The implication is that if you can get the grammar and the firing order right, you're building something that doesn't just run fixed entailment but can actually derive new knowledge dynamically based on user rules.

Meng: But the paper makes it clear that this isn't a solved problem yet because they left major questions unanswered about how provenance is tracked and how to properly query the system for an explanation.

Jane: Exactly, so while the language has the scaffolding, implementers still have to figure out those crucial details about tracking where every single piece of information comes from and how to get a clear proof tree.

Tom: The authors themselves flag that these are questions implementers must answer for themselves right now regarding what provenance looks like and how query operations should work in this new language.

Lu: It’s an invitation to build, but with the understanding that you have to define the parts—like output handling and explanation mechanisms—that make it truly practical for real-world reasoning tasks.

More episodes

← Home