Abstract
With the finalization of RDF 1.2 and SPARQL 1.2, the new triple-term construct brings native reification to RDF. Native support, however, does not imply uniform adoption: existing datasets continue to model statement-level metadata through established reification patterns, so federated queries must mediate between these patterns and the new syntax. We address this by rewriting queries written against triple terms into queries over the reification pattern actually used by each source, expressing the relationship as a SPARQL CONSTRUCT query that is unfolded into the user’s query. This paper demonstrates the approach through a web interface in which users author their own mappings, select sources, and observe how their queries are rewritten and executed across federated endpoints. Reification translation is one application of a more general framework for SPARQL query answering under declarative RDF-to-RDF mappings, which we plan to formalize and optimize. The language gaps it exposes also give us concrete input for the upcoming SPARQL maintenance-mode standardization. 3 4 5
Keywords
SPARQL 1.2,
RDF 1.2,
Reification,
Metadata,
Data Integration,
Query Rewriting
Canonical version: https://2026-semantics-rewriting.jitsedesmet.be/
Demonstration: https://2026-query-rewriting.demo.jitsedesmet.be/
Introduction
With the finalization of the recent RDF 1.2 [1] and SPARQL 1.2 [2] specifications, data publishers and consumers gain access to a newly introduced extension of the RDF data model: the triple term. This extension explicitly addresses the need to have a uniform way of modelling statement-level metadata, which previously was done with reification patterns. Triple terms enable arbitrary nesting of triples, bringing native reification to RDF and narrowing the gap between RDF and Property Graphs [3]. The construct directly descends from RDF-star and SPARQL-star [4], proposed over a decade ago.
However, standardization does not imply uniform adoption. Existing, and even new, datasets might choose to continue modelling statement-level metadata using established reification patterns (e.g., rdf-reification [5], -ary relations, or potentially the vocabulary proposed in the draft RDF 1.2 interoperability note [6]). As a result, querying RDF means handling all of these patterns, even though triple terms now provide a single standard. The problem worsens in federated settings, where sources may use different patterns, and the query engine must mediate between them.
We address this gap with two contributions. First, we propose query rewriting as a practical route to interoperability: SPARQL 1.2 queries written against triple terms are rewritten into queries over the reification pattern actually used by each source, with per-source mappings handling federated heterogeneity. Second, we express these mappings declaratively as standard SPARQL CONSTRUCT queries, keeping the entire solution within the RDF ecosystem and requiring no new mapping language. The rewriting algorithm itself builds on classic unfolding techniques, applied to RDF 1.2.
The next section reviews related work on mapping and rewriting for RDF. Section 3 describes our rewriting approach and its limitations. Section 4 presents the demonstration, and Section 5 concludes our paper.
Query rewriting
Fig. 1: A SPARQL 1.2 query enters the Federation Mediator, which rewrites it through user-authored mappings. The red box highlights the reification interoperability use-case: mapping rewrites the query into against a single legacy source that uses an established reification pattern. The full figure depicts the general setting: is a GAV mapping spanning multiple sources , , , producing a federated query . Each mapping is itself a SPARQL CONSTRUCT query; the mediator unfolds them into and the rewritten query runs on any standards-compliant SPARQL 1.2 federation engine.
Fig. 1 gives an overview of our approach: a user query is
sent to a federation mediator, which rewrites it through one or more
user-authored mappings into queries against the sources. We express
each mapping as a SPARQL CONSTRUCT query: the template (mapping head)
states what the mapping asserts about the global, and the WHERE
clause (mapping body) queries the source.
When several mappings target the same global, their outputs are implicitly unioned,
in line with RDF’s dataset merge operation [14].
Fig. 2 shows two such mappings: one constructs triple terms from
rdf-reification statements in the source, the other passes source
triples through unchanged. When a CONSTRUCT template contains
multiple triple patterns, we split it into one rule per triple pattern
and combine them through a UNION in the WHERE clause;
Fig. 3 shows the equivalent single-headed form.
Algorithm. The rewriting algorithm unfolds each triple pattern in
the user query against any mapping whose template (mapping head)
matches it, pushing additional constraints from the pattern into the
WHERE clause of the matching mapping.
Consider the user query in Fig. 4, which asks for triple terms whose inner predicate is
rdf:type together with a confidence score above 0.8.
The first triple pattern fixes the predicate to rdf:reifies and the inner
predicate of the triple term to rdf:type; these constants flow into
the unfolded body, replacing ?p by rdf:type in Fig. 5.
Mappings whose template cannot match a pattern – for instance because the predicates are incompatible – contribute a
FILTER(FALSE) branch, which a downstream optimizer can prune.
# Create a mapping from rdf reification to triple terms
CONSTRUCT { ?t rdf:reifies <<( ?s ?p ?o )>> }
WHERE {
?t a rdf:Statement ; rdf:Subject ?s ;
rdf:Predicate ?p ; rdf:Object ?o ;
} # and copy all triples
CONSTRUCT { ?s ?p ?o } WHERE {
?s ?p ?o .
}
Fig. 2: Two mappings: one constructs triple terms in the global, the other passes source triples through unchanged.
CONSTRUCT { ?s ?p ?o } WHERE {
{ ?m_t a rdf:Statement ;
rdf:Subject ?m_s ;
rdf:Predicate ?m_p ;
rdf:Object ?m_o .
BIND(?m_t as ?s) .
BIND(rdf:reifies as ?p) .
BIND(triple(?m_s, ?m_p, ?m_o) as ?o). }
UNION
{ ?s ?p ?o }
}
Fig. 3: The same global as Fig. 2, expressed as a single CONSTRUCT in accordance with .
SELECT * WHERE {
?t rdf:reifies <<( ?s rdf:type ?o )>> ;
ex:confidence ?score .
FILTER(?score > 0.8)
}
Fig. 4: Example user query: triple terms asserting rdf:type with a confidence score above 0.8.
SELECT ?score ?o ?s ?t WHERE {
{ ?t rdf:type rdf:Statement ; rdf:Subject ?s ;
rdf:Predicate rdf:type ; rdf:Object ?o . }
UNION { # Assume 1.1 sources -> no triple terms
FILTER ( FALSE ) }
{ # Predicate rdf:reifies does not match ex:confidence
FILTER ( FALSE ) }
UNION { ?t ex:confidence ?score }
FILTER ( ?score > 0.8 )
}
Fig. 5: Cleaned-up version (for readability) of the query in Fig. 4 rewritten against the mapping in Fig. 3. The rewritten query no longer asks the source for triple terms; instead it expresses the same intent through the reification scheme used by the source.
Scope.
Although this paper focuses on RDF 1.2 interoperability,
the rewriting framework is more general: we envision it as a broader
approach to SPARQL query answering under mappings, of which
reification-pattern translation is one application.
Because the rewritten query is itself a federated SPARQL query, the
approach inherits the boundaries of federated SPARQL. Blank nodes
have limited support on both sides of a mapping: CONSTRUCT templates
and the BNODE expression introduce fresh blank nodes scoped to a
single query solution, and blank nodes returned by a source cannot be
matched across invocations of the same endpoint, since blank nodes
are scoped to the document or result set in which they are
serialized [2]. Skolemization is the classical
solution. Recursive property paths (* and +) are likewise not
handled, pending a recursive extension to SPARQL.
Demonstration
The demo’s main scenario is RDF 1.2 interoperability: the user writes a SPARQL 1.2 query using triple terms, points it at one or more sources that model statement-level metadata through legacy reification patterns, and sees the query rewritten so that it runs against the sources as-is. The rewritten query is shown next to the original, so users can inspect how it was transformed using Traqula [15], and then executed using Comunica [16]. Alongside this main scenario, the demo ships with several preset scenarios that exercise different facets of the framework: 1. wikidata reification, 2. exhaustive source selection, 3. uniprot reification, and 4. paper filter Verborgh.
In the Wikidata reification example, we construct the global by copying all existing triples and adding triple terms to statements following Wikidata’s -ary reification approach; we then query the instance of property of Belgium. The exhaustive source selection example runs over the RDF profiles of Bryan, Ruben, and Jitse, querying the names of all scholarly articles on their profiles. The UniProt example again copies all existing triples and adds triple terms, this time following the standard RDF reification that UniProt uses; we then query the annotations of a given protein. Finally, the set-theoretic example shows how these combinations work in practice: we construct the global as every triple in Jitse’s and Ruben T’s profiles, except those related to articles that Ruben V also describes. Querying the scholarly articles and their names in this global, we see that Jitse’s vision paper is missing, for instance, because Ruben V co-authored it.
The query rewriting mechanism is not limited to reification translation. Any
mapping the user writes becomes part of the global schema, and the
rewriting handles it identically. Federation across sources is itself
a special case: selecting a set of endpoints is equivalent to a second
layer of GAV rewriting in which every mapping has the form
CONSTRUCT { ?s ?p ?o } WHERE { SERVICE <s> { ?s ?p ?o } }, which the engine
performs as exhaustive source selection [17]. The demo thus stands in for a broader claim
from Section 3: that mapping-driven query rewriting is a general
way to query RDF under user-defined schemas, with reification
interoperability as one application.
The interface exposes this through four panels. The mappings panel (top left) is where the user writes CONSTRUCT queries that together define the global schema. The query panel (top right) is where the user selects sources and writes the user query against that schema. The rewritten query panel (bottom left) is read-only and shows the user query unfolded against the mappings after execution. The results panel (bottom right) reports elapsed execution time, the result count, and the streaming bindings as they arrive.
Fig. 6: Screenshot of the web interface: a user query is rewritten against user-defined mappings and executed over the chosen sources.
Conclusion
We have presented a preliminary implementation of query rewriting for RDF 1.2 interoperability, addressing the gap between the new triple-term construct and the reification patterns that datasets continue to use in practice. This use-case is one instantiation of a more general vision: SPARQL query answering over declarative RDF-to-RDF mappings, of which reification translation is one application among many.
The mappings are GAV rules expressed as SPARQL CONSTRUCT queries, and rewriting proceeds by unfolding those rules into the user’s query. This declarative approach buys three things over a handwritten algorithm: 1. extensibility to reification schemes not foreseen at design time; 2. interpretable transformations that users can read directly; and 3. reuse of existing SPARQL skills, since mappings are written in the same language as the queries they rewrite. Because both the rules and the rewriting live within SPARQL, the rewritten query runs on any standards-compliant SPARQL 1.2 federation engine, with no engine modification required.
This is ongoing work. Immediate next steps include performance
optimization, and broader applications beyond reification translation.
A separate thread is concrete input to the upcoming maintenance-mode
standardization of SPARQL: when a desired mapping cannot be expressed
in standard SPARQL, the missing feature becomes a candidate language
extension. We have already encountered a handful: a CONSTRUCT GRAPH
form, syntactic sugar for triple-term templates, and recursive view
definitions. Our aim with this demonstration is to draw attention to
GAV-style SPARQL mappings, to showcase their use for RDF 1.2
interoperability, and to open discussion on the language features the
community needs to make the broader vision practical.
Acknowledgements
This publication is based upon work from COST Action CA23147 GOBLIN—Global Network on Large-Scale, Cross-domain and Multilingual Open Knowledge Graphs, supported by COST (European Cooperation in Science and Technology). Jitse De Smet is a predoctoral fellow of the Research Foundation - Flanders (FWO) (1SB8525N).
Declaration on Generative AI
During the preparation of this work, the author(s) used Claude Opus 4.7 in order to: Paraphrase and reword, improve writing style, perform grammar and spelling checks, and critically review the text written by the authors to highlight essential information. After using these tool(s)/service(s), the author(s) reviewed and edited the content as needed and take(s)full responsibility for the publication’s content.