Abstract
The advantages offered by the presence of a schema are numerous. However, many XML documents in practice are not accompanied by a (valid) schema, making schema inference an attractive research problem. The fundamental task in XML schema learning is inferring restricted subclasses of regular expressions. Most previous work either lacks support for interleaving or only has limited support for interleaving. In this paper, we first propose a new subclass Single Occurrence Regular Expressions with Interleaving (SOIRE), which has unrestricted support for interleaving. Then, based on single occurrence automaton and maximum independent set, we propose an algorithm iSOIRE to infer SOIREs. Finally, we further conduct a series of experiments on real datasets to evaluate the effectiveness of our work, comparing with both ongoing learning algorithms in academia and industrial tools in real-world. The results reveal the practicability of SOIRE and the effectiveness of iSOIRE, showing the high preciseness and conciseness of our work.
Introduction
XML remains a cornerstone of data exchange, yet the absence of formal schemas often hinders efficient query optimization and data integration. Inferring these schemas from existing documents is a complex challenge. According to Gold’s theorem, it is impossible to perfectly identify a regular language from positive examples alone. Consequently, research has shifted toward identifying learnable subclasses of regular expressions (REs).
A prominent subclass is the Single Occurrence Regular Expression (SORE), where each symbol appears at most once. However, traditional SORE inference often neglects the interleaving operator (&), which allows elements to appear in any order. This is particularly problematic for data-centric XML, where strict sequencing is rare. Without interleaving support, inferred schemas become either overly complex or excessively "loose."
The SOIRE Subclass and Hierarchy
To address these limitations, the authors introduce SOIRE (Single Occurrence Regular Expressions with Interleaving). SOIRE provides unrestricted support for the & operator, making it more expressive than previous models like DME (Deterministic Monomial Expressions) or ESIRE (Extended SIRE).
As shown in the figure above, the relationships between these subclasses are hierarchical. The authors' analysis of over 4,500 real-world Relax NG schemas found that 93.24% of regular expressions fit within the SOIRE subclass, a significant improvement over DME (50.62%) and ESIRE (87.56%). This high coverage demonstrates that SOIRE is a practical and powerful target for schema inference.
The iSOIRE Algorithm
The proposed iSOIRE algorithm learns these expressions through a two-stage process:
- Automaton Construction: The algorithm builds a Single Occurrence Automaton (SOA) from input samples using the 2T-INF method. This automaton captures the transitions between elements observed in the data.
- Interleaving Inference: To detect interleaving, iSOIRE analyzes the partial order relations between tags. If tags appear in varying orders without a fixed sequence, they are candidates for interleaving. The algorithm models this as a Maximum Independent Set (MIS) problem on a constraint graph. While MIS is NP-hard, iSOIRE employs an efficient clique-removal approximation to maintain scalability for large datasets.
Experimental Evaluation
The researchers evaluated iSOIRE against industrial tools (IntelliJ IDEA, Liquid Studio, Trang) and academic algorithms (conMiner) using real-world datasets like DBLP.
- Precision: On the DBLP
wwwdataset (over 2 million samples), iSOIRE achieved a "Language Size" of $1.84 \times 10^{11}$, whereas Liquid Studio produced a much looser schema with a language size of $1.11 \times 10^{21}$. This indicates that iSOIRE produces much tighter, more accurate schemas. - Conciseness: iSOIRE consistently generated shorter expressions with lower nesting depths, avoiding the structural "bloat" common in tools that lack native interleaving support.
- Scalability: The algorithm successfully processed millions of samples, proving its viability for large-scale industrial applications.
Conclusion
The introduction of SOIRE and the iSOIRE algorithm represents a significant step forward in XML schema inference. By providing robust support for interleaving, iSOIRE bridges the gap between theoretical expressiveness and practical utility. Future work aims to extend this framework to $k$-occurrence regular expressions ($k$-OIREs), further enhancing the ability to model complex, real-world data structures.
Summary updated