Assignment 3: Data Integration & Data Preparation
In this assignment, you may use AI tools such as ChatGPT and/or Claude for solving the assignment. However, you need to submit an AI disclosure statement in which you specify how you used the tools. Moreover, you need to provide the prompts that you sent to the LLM models. For more information, look at the UU-AI Policy where you can find the AI disclosure statement
Task 1: Record Matching
Use the DBLP-ACM dataset. Write Python code to compare every record in ACM.csv with every record in DBLP2.csv and identify candidate pairs that may describe the same publication. Retain the record IDs for evaluation, but do not use pub_id when calculating similarity.To compare two records, follow the steps:
Ignore the pub_id.
Change all alphabetical characters into lowercase.
Eliminate extra spaces by trimming leading and trailing spaces and replacing consecutive whitespaces with a single space.
Use Levenshtein similarity $\left(L_{sim}(S_1, S_2) = 1- \frac{MED(S_1, S_2)}{Max(|S_1|, |S_2|)}\right)$ for comparing the values in the title attribute and compute the score ($s_t$). MED refers to the minimum edit distance and $|S_i|$ is the number of characters in the string $S_i$.
Use Jaro similarity to compare the values in the authors field and compute ($s_a$).
Use the affine-gap similarity that is computed based on the affine-gap edit distance and scaled to the interval $[0, 1]$ for the venue attribute ($s_c$). A good implementation of the affine-gap edit distance can be found in the Biopython library. After computing the affine-gap edit distance $d_{aff}(S_1, S_2)$, you can compute a similarity metric as $sim_{aff}(S_1, S_2) = \frac{1}{1+\frac{d_{aff}(S_1, S_2)}{max(|S_1|, |S_2|)}}$. You can use the extend_gap_score = -0.1, the mismatch_score = -2, and the open_gap_score = -1.
.
Use Match (1) / Mismatch (0) for the year ($s_y$).
Use the formula $sim_{rec}(r_i, r_j) = \omega_1 s_t + \omega_2 s_a + \omega_3 s_c + \omega_4 s_y$ to combine the scores and compute the final score. You should choose $\omega_i, 1 \le i \le 4$ such that $\omega_i > 0$ and $\sum_{i=1}^4\omega_i = 1$. Here, $r_i$ represents a record in the ACM table and $r_j$ represents a record in the DBLP2 table.
Report the records $r_k$ and $r_l$ as duplicate records if their $sim_{rec}(r_k, r_l) > 0.7$ and store the ids of both records in a list.
In the file DBLP-ACM_perfectMapping.csv, you can find the actual mappings (the ids of the correct duplicate records). Compute the precision of this method as the ratio of duplicate records that you discovered correctly to the total number of duplicates that you reported. That is, among all the reported similar records by your method, how many pairs exist in the file DBLP-ACM_perfectMapping.csv.
Record the running time of the method. You can observe that the program takes a long time to get the results. What can you do to reduce the running time? (Just provide clear discussion – no need to implement the ideas.)
Task 2: Data Integration
Choose either a data warehouse or virtual integration approach. Create two SQLite databases and add a few sample records to every table. Implement your chosen approach and demonstrate it:
For a data warehouse: show how you copy and prepare data from the source databases in a central database, then query the warehouse.
For virtual integration: show a user query, the subqueries sent to the source databases, and how their results are combined.
Task 3: Data profiling and preparation
Preferably, use one CSV file from the road_safety_dataset. For this task, it is preferable to use one the CSV files from the road safety dataset.
Read the paper on profiling relational data. Select at least 10 distinct summary statistics, write Python code to compute them, and explain what each statistic reveals about the dataset. Calculating the same statistic for several columns counts as one statistic.
Compute the correlation between the numerical columns and ignore categorical attributes such as the collision_year. You can select a maximum of eight attributes from the table to compute the correlation.
Remove the disguised missing values from the eight attributes that you selected for computing the correlation. For example, if you are using the table dft-road-casualty-statistics-collision-2025.csv, you can see the value (-1) in the attribute lsoa_of_accident_location, which is a fake value that replaces the missing values. Remove the fake values but keep the records (i.e.) change each fake value into a null.
Use a data imputation technique to fill the cells with null values. You can use one of the techniques that we studied.
Compute the correlation between the columns after imputing the missing values.
Compare the values from this step with the values you computed earlier. Just mention the most important changes (if any) and comment on your findings.
Submission
Submit a ZIP file that contains:
A PDF file that reports and explains how you answered the questions.
A Python notebook that includes the code with markdown boxes to specify the question under consideration. Use comments to explain the important steps in your code. The explanation of the methods in general with discussion about the most important steps in the code should be included in the report (the PDF file).
Any additional files that you generated for creating the databases and their integration.
The AI disclosure statement in PDF format.
Submission should be done on BrightSpace and only one submission per group is needed. You can submit as many versions as you like but only the last submission before the deadline will be graded.
Deadline
as specified on the BrightSpace, the deadline is (1 November 2026 11:59PM).