On the interplay between validation and inference in SHACL - an investigation on the Time Ontology

Tracking #: 3959-5173

Authors: 
Livio Robaldo
Sotiris Batsakis1

Responsible editor: 
Stefano Borgo

Submission type: 
Full Paper
Abstract: 
This paper presents a novel SHACL-based framework for validating the Time Ontology (https://www.w3.org/TR/owl-time). The Time Ontology, currently a W3C Candidate Recommendation, is widely recognized as the “de facto” standard for representing temporal data in the Semantic Web. However, its current OWL axiomatization cannot enforce several validation constraints on temporal knowledge that can be expressed using the Time Ontology vocabulary. These constraints are instead captured by the SHACL formalization proposed in this paper. Nevertheless, we show that SHACL shapes alone are insufficient to validate even relatively simple knowledge graphs that can be encoded using this vocabulary. This limitation arises because validation must be performed on the inferred knowledge graph, which SHACL shapes alone cannot derive internally. To address this, our framework first computes the inferred knowledge graph using SHACL-SPARQL rules and then validates it through SHACL shapes. In the second part of the paper, we argue that our findings extend beyond the Time Ontology and have broader implications for SHACL and knowledge graph reasoning. We therefore view our work as a call to action for the Semantic Web community to systematically investigate the interplay between validation and inference. Specifically, there is a need to study the representational requirements of different use cases to identify the minimal set of SHACL shapes and inference rules necessary for data validation in each context. These research efforts could ultimately lead to the definition of distinct SHACL dialects, analogous to how OWL Lite, OWL DL, and other profiles were defined for OWL. The SHACL shapes and SHACL-SPARQL rules that define the proposed framework are freely available in the GitHub repository https://github.com/liviorobaldo/TimeOntologyInSHACL, together with Java programs and detailed instructions for execution.
Full PDF Version: 
Tags: 
Reviewed

Decision/Status: 
Accept

Solicited Reviews:
Click to Expand/Collapse
Review #1
By Francesco Compagno submitted on 10/Nov/2025
Suggestion:
Accept
Review Comment:

In my first review, I had highlighted various aspect of the paper, which were, in my view, problematic. All of them have been answered. In particular, the one I considered the most important one (unclarity of what is the "gold standard ontology" the authors refer to) has been addressed by the authors through a substantial revision of their work.
Indeed, the work has been radically transformed for the better: not only it is shorter and easier to read, it is more well-structured. In particular, a FOL axiomatization is now present, which functions as the gold-standard mentioned above. This in turn has much simplified the previously-existing evaluation sections.
The separation between validation and consistency checking is also clearer now.

In regarding to the questions that the authors ask me in their rebuttal:
"We apologize, but we are having some difficulty understanding your comments here. This is not
due to any lack of clarity on your part, but rather because your claims are based on our previous
SHACL axiomatization, which was incorrect." -> All my comments are indeed based on your previous version, basically I found some Aboxes that the SHACL engine would not find as invalid, but see all of them were considered and now are treated as intended, so we are on the same page

"We do not fully understand your statement that “there is a ‘focus’ on some part of the rule
body, determined by the SHACL targeting system”, and we would appreciate it if you could clarify
further." -> I was referring to the focus nodes (https://www.w3.org/TR/shacl/#dfn-focus-node). They are indicated by e.g. the use of sh:targetSubjectsOf or sh:targetClass. So, your SHACLE-SPARQL rules have three parts: the focus, the consequent, the antecedent. In classic inference systems the focus in inglobated in the antecedent, e.g. instead of

sh:targetClass :SomeClass
CONSTRUCT {...}
WHERE {$this ...}

you would have

CONSTRUCT {...}
WHERE {$this a :SomeClass . $this ...}

and so on, but this becomes actually important only when considering the inner workings of a validation engine, I suppose.

". If either you or Reviewer #1 could show us how such an axiomatization could be
represented in OWL, [...]. Nevertheless [...]" I do not consider a necessity doing so, and I agree the effort may be problematic. So I do not spend time in such an effort. Cursory reflection, however, suggests that a translation that captures most axioms may be possible (altough it may sacrifice feasability of application of reasoning algorithms).

Consider e.g. on of the most complex axioms:

∀T1,T2,tb1,te1,tb2,te2[(intervalFinishes(T1, T2)∧ hasBeginning(T1, tb1)∧
hasEnd(T1, te1)∧ hasBeginning(T2, tb2)∧ hasEnd(T2, te2))→
(ProperInterval(T1)∧ ProperInterval(T2)∧
equals(te1, te2)∧ before(tb2, tb1))]

Define various appropriate inverse relations, and then split the above axiom into

∀T1,T2(intervalFinishes(T1, T2)→
(ProperInterval(T1)∧ ProperInterval(T2))

∀T1,T2,te1,te2[(endOf(te1, T1) /\ intervalFinishes(T1, T2)∧ hasEnd(T2, te2))→
equals(te1, te2)

∀T1,T2,tb1,tb2[(
hasEnd(T1, te1)∧ beginnningOf(tb2, T2)∧ intervalFinishedBy(T2, T1) ∧ hasBeginning(T1, tb1))→
(before(tb2, tb1))]

then the previous three axioms can be rended either with domain/range axioms (the first one) or with property chains. Similar things can be done for other FOL axioms that I've cursorily checked. However, I remark again that this is likely going to break reasoning capabilities, in addition to requiring a vocabulary extension.

Review #2
Anonymous submitted on 16/Feb/2026
Suggestion:
Minor Revision
Review Comment:

The paper was significantly rewritten, and the new version is without a doubt much better than the previous one. The paper now includes a first-order logic formalisation of the ontology they consider, which makes the intended contribution and the correctness of their results much clearer.

The paper still lacks formal proofs. For the first main contribution of validating knowledge graphs against the (axiomatization of the) time of ontology, this is probably fine, as the FO formalisation and the characterisation in terms of standard orders are clear enough. But there are a few places where a little more theory would go a long way, and an adequate formal framework would spare the authors from ad hoc discussions and arguments by example. Two concrete aspects are the expressiveness limitations of SHACL, and the uniqueness of completions, as discussed below.

But overall, I think the first contribution of validating KGs against the time ontology is now clear and valuable enough.

I am a bit less convinced about the way the second contribution is presented. I could not sympathise more enthusiastically with the cause of making inference a first-class city of any validation process. The very foundation of KGs is knowledge and semantics, and implicit tuples are thus a fundamental part of KGs that cannot be ignored during validation.
The authors advocate distinct SHACL dialects analogous to OWL profiles, which is certainly a good idea. But SHACL is for validation, and OWL for inference. Why not create OWL profiles that provide additional expressive power? After all, the goal of OWL is precisely to infer implicit facts, and SHACL was defined for validation, not for inference. If one takes the syntax of SHACL and uses it as a language for inference, is it OWL or SHACL? I am not against using SHACL-like languages for inference, but more in favour of separating the intended use from specific syntactic choices.

I already complained in the first review about the very procedural way that inference is viewed and defined. Unfortunately, this is still present in the paper. While it is not necessarily a reason for rejection, it is a pity that the authors do not provide a definition of completion or its intended consequences. They talk about adding facts and about repeated rule application, but they do not refine declaratively what an implied fact is or what a completion is. They equate the semantics with the procedure. They also seem to rule out the existence of other procedures, once the semantics are in place. Materialisation is the most straightforward, but not the only way to take inferred facts into account.

Overall, the paper in its current form makes an interesting and valuable contribution. It still falls somewhat short of rigour, but the key contributions are now clear enough to be useful to the community.

Some specific aspects:

- The arguments on the expressive limitations of SHACL-Core seem right, but they lack proof. You say, "Such cross-node value comparisons fall outside the expressive power of SHACL Core". Do you have a reference for this? Or a proof?
Similarly, "it is not possible to define a SHACL-SPARQL shape that detects this invalid pattern for an arbitrary number of nodes using SPARQL 1.1 Property Path operators". Has this been proved, here or elsewhere?
I understand what you mean, and I believe the examples you give are not expressible in SHACL, but I would have liked to see a more accurate argument, possibly relying on properties of SHACL that emerge from the logical characterisations; there is quite a bit of work on the expressive power of the logics that underlie SHACL (e.g., simulation invariance, expressiveness of classes regular paths, etc). While the current argument is probably fine for the paper, I encourage you to look into this in the future.

- While I fully agree with their discussion of validity being a "broader concern" than consistency, at times the authors seem to equate logical reasoning with consistency testing. Detecting satisfiability/inconsistency is one of the most common uses of logical axioms, but logical inference is much more than that, and it is a very powerful tool capable of capturing many forms of validity and correctness.

- By the "robust logic framework" for studying when completions terminate and when they are unique. etc., I meant the literature on the chase for (disjunctive) existential rules (and in description logics). There are dozens of papers on *chase termination*, universal models, cores, etc., which basically are about understanding in which cases one can build a unique finite representative completion.

- You say that "It is the responsibility of the knowledge engineer to determine, when such rules are included in the axiomatization, whether they might generate infinite loops and, if so, to include conditions in their WHERE clauses to break the loop."
Well, here I respectfully disagree: a much more robust approach is to properly define the logical framework one is working on, and rely on the vast knowledge we have on ensuring that the chase terminates for the logical fragment, rather than manually proving that we can "break" specific rule applications.

- Finally, the authors seem to identify non-deterministic outcomes with non-monotonic constructs. While non-monotonicity is a prominent culprit, it is not the only one. Note that some OWL fragments (in fact, all the non-Horn ones) can express disjunctive information: union, counting, all-values-from restrictions, etc. The temporal setting is intrinsically disjunctive, eg, if a rule has that overlaps(i1,i2) in the head, one needs case distinctions of whether, e.g., the beginning of i1 is before, equal, or after the beginning of i2.