## 3 Data Integrity Ontology in SPuMoNI
### Spumoni System Description  
The main goal of the SPuMoNI information system is to evaluate data integrity and facilitate data quality assessment of significant amounts of raw data, from various heterogeneous manufacturing line data sources, along with their embedded systems, which control the various processes within the pharma production lines.  
Hence, the SPuMoNI pharmaceutical manufacturing process data are mainly raw data, generated directly by heterogeneous manufacturing line data sources, which are further  
Figure 1: SPuMoNI’s RegTech architecture.  
pre-processed along the batch production processes that occur in the manufacturing plant. The system generates a comprehensive batch record, with plenty of details about product, materials, procedures, and equipment. Furthermore, authorized users can certify and sign any field of batch record, across the production process. There are two basic types of raw data that flow into the SPuMoNI information system. The first is relevant to product type and related recipe data information, while the second is relevant to machinery and equipment type control information. Raw data are represented either as numerical data with single values, as time series numerical measurements, or as non-numerical, categorical data (e.g., chemical/physical properties of material/substances).  
The Manufacturing Execution System (MES), is responsible for the automated and integrated management and execution of the recipes for each product, together with SCADA and the PLCs, for monitoring and controlling the machinery equipment (Figure 1). Specifically, these systems provide data for each batch record that is associated with an order recipe. Each recipe consists of sub-recipes, for the various manufacturing process phases, which are specified by specific plant instructions. Hence, a processing phase is uniquely identified and fully described by a recipe and its sub-recipe instructions.  
At a next step, all these raw data types that are retrieved from various heterogeneous data sources are further pre-processed by SWRL rules and refined into a more qualitative information by SQWRL queries, before entering into the ALCOA assessment module (Figure 1). In particular, the most important module within the SPuMoNI's RegTech architecture is the ALCOA assessment module, which is responsible for the ALCOA principle rule interpretation and related compliance evaluation. The functionality of this assessment module involves the retrieval and evaluation of a batch record, consisting of production plant manufacturing information and raw data from various heterogeneous data sources, such as sensors, PLCs, production devices, operator staff, or equipment alarms, so as to decide whether the batch record is ALCOA compliant or not. All this information has been structured as a data model, by means of the data integrity ontology (DIOnt), and preserved in proper knowledge graph databases. Moreover, the ontology data model, and the ontology rules database, have been enriched with a proper ALCOA principle (constraints) knowledge base, as specified by 21 CFR Part 11, and cGMP Annex 11, in order to produce the appropriate rules (in our case, a combination of SWRL rules and SQWRL queries), that would support the ALCOA assessment module to take the final compliance decision. Actually, the SWRL rules are used to preprocess the initial knowledge base in order to infer a renewed knowledge base, for filtering the batch ALCOA compliance, via the use of SQWRL queries, as will be explained in the next subsection of the paper. Furthermore, at the top of the system architecture (Figure 1), there is also a blockchain module. This assures data validity by running data integrity checks on batch order data via hash transaction values, and will be included in our future work extension.