• No results found

Instance based Matching using Regular Expression

N/A
N/A
Protected

Academic year: 2021

Share "Instance based Matching using Regular Expression"

Copied!
8
0
0

Loading.... (view fulltext now)

Full text

(1)

Procedia Computer Science 10 ( 2012 ) 688 – 695

1877-0509 © 2012 Published by Elsevier Ltd. doi: 10.1016/j.procs.2012.06.088

The 9th International Conference on Mobile Web Information Systems (MobiWIS)

Instance based Matching using Regular Expression

Osama A. Mehdi

a∗

, Hamidah Ibrahim

a

and Lilly Suriani Affendey

a

aUniversiti Putra Malaysia, Serdang, Selangor 43400, Malaysia Abstract

Instance based matching is the process of comparing data from different heterogeneous data sources in determining the correspondence of schema elements. It is a useful alternative choice when schema information (element name, description, constraint) is unavailable or unable to determine the match between schema elements. Instance based matching is a non trivial problem and is applied in many application areas such as data integration, data cleaning, query mediations, and warehousing. Many instance based solutions to the schema matching problem have been proposed and most of them utilized similarity metrics. In this paper, we present a fully automatic approach that contributes to the solution of instance based matching in identifying the correspondences of attributes which is one of the elements in the schema by utilizing regular expression. Several experiments using real-world data set have been conducted to evaluate the performance of our proposed approach. The results showed that our proposed approach achieved better accuracy compared to previous approaches using similarity metrics.

© 2011 Published by Elsevier Ltd. Selection and/or peer-review under responsibility of [name organizer]

Keywords: Schema matching, Instance based matching, Similarity metric, Regular expression;

1. Introduction

Schema matching is the problem of finding correspondences between elements of two schemas that are heterogeneous in format and structure. This basic problem needs to be solved in many database application domains, such as data integration, E-business and data warehousing or even in mobile database community such as MobiSnap [1]. Performing schema matching from different sources is not trivial as these sources are developed independently by different developers and definitely have differences with respect to syntactic as well as semantic of the schema elements. Schema matching attempts to measure or compute similarities between schema elements by considering the schema information which includes the element name (schema name, attribute name), description, data type, schema structure, instance data, constraint, and auxiliary information (dictionaries or thesaurus). The

Corresponding author. Tel.: +6-017-336-3455; fax: +0-60-389466572.

E-mail address: osamacs86@hotmail.com Open access under CC BY-NC-ND license.

(2)

similarity between schema elements could be estimated syntactically by comparing the characters that make up the strings of the elements. For the comparison purpose, the most common metrics used are Edit-distance, Jaro, Jaccard, Jaro Winkler, Q-gram, and Cosine. Instance based matching could be an alternative choice for schema matching especially in cases where the schema information is unavailable or is unable to determine the correct match [2]. Furthermore, instance based matching is used to achieve better accuracy as in some cases despite the availability of the schema information; it is not helpful for instance when the element names are abbreviations. Thus, when schema matching fails, the next approach is to look at the values stored in the schemas and it is not surprising that recently, concern has been put on instance based matching [3].

Most instance based matching approaches employed similarity metrics to compare two heterogeneous data [4] while others used neural network and machine learning. Similarity function is a function that measures the similarity between two elements and detects if these two elements are match or not. Similarity function compares the atomic values and provides a score which represents the degree of similarity. For example, S1 and S2 represent two strings; V represents the score of similarity degree and is within the interval [0, 1]. When score V is more than 0, this means the two strings S1 and S2 are similar. We can represent similarity function as follows f (S1, S2) = V.

In identifying attribute correspondences, we developed a fully automatic matching process based on the regular expressions of the instances. To the best of our knowledge, none of the previous works in the area of instance based matching have used regular expression to identify attribute correspondences. Several experiments using real-world data set have been conducted to evaluate the performance of our proposed approach. The results showed that our proposed approach achieved better accuracy compared to previous approaches using similarity metrics.

This paper is organized as follows: related work in the area of instance based matching is discussed in section 2. Section 3 describes the proposed method which utilized regular expression. The evaluation results are presented and discussed in section 4. Finally, conclusion and future direction are presented in section 5.

2. Related Work

The idea of instance based matching was originally defined in 1959 by [5] and was formalized by [6] 10 years later. Most of the previous works and researchers have used instance based matching under different names in different research communities. For example, in database area instance identification [7], entity identification [8], merge purge [9], approximate record matching [10], record linkage or record matching [11], while in the artificial intelligent area, database hardening [12] and name matching [13] are used. Similarity metrics is the technique mostly used in the area of instance based matching to compute the similarity between instances that belong to different schemas [14][15] and it is categorized into two categories: character-based similarity measures and token based similarity measures.

Character-based similarity measure is more suitable for typographical errors. In this section, some of them are elaborated as follow: Edit distance: in this technique, given two strings S1 and S2 edit distance is the minimum number of edit operations i.e. inserting, deleting and replacing a character with another one, that needed to transform S1 into S2. Levenshtein distance is an edit distance metric [16]. Jaro distance: the Jaro distance metric considers the order and number of characters which are common in two strings [17]. Jaro Winkler is a variant of the Jaro distance metric and modifies the weights of matching pairs of Jaro metric. Q-gram: This metric compares string according to their set of n-grams, that is mean sequence

(3)

of N characters refers to different variants of this matcher. For example, Cust and Customer are similar as their trigram sets, cus, ust and cus, ust, sto, tom, ome, mer, respectively, share two trigrams cus and ust [18]. Although character-based similarity measure is more suitable for typographical errors, they fail to recognize the rearrangement of words like the strings “Schema Matching” and “Matching Schema”. Therefore, token-based similarity measure was suggested for this problem by breaking the strings into tokens of words. Some of these measures are reviewed here as follow: Jaccard: this technique was firstly proposed for computing the similarity between distributions of flora in various geographical areas by [19]. It gets word sets from the comparison strings to calculate similarity. Atomic strings: this technique was proposed by [20] for matching two atomic strings. An atomic string is considered as a sequence of alphanumeric characters which set the boundaries by punctuation character. Two atomic strings are regarded as match if they are equal, or one is the prefix of the other. Hence, the similarity of two fields or attributes are computed as the number of their matching atomic strings divided by their average number of atomic strings [21]. Cosine similarity: this technique is not sensitive to the location of word. So, the words ”Computer Science” and “Science Computer” are considered equivalent in this method. The limitation of this similarity measure is that it works weak in facing spelling errors. For instance, two strings like “Compter Science department” and “Deprtment of computer scence” will not have the same similarity under this measure, and the similarity value will be zero [21].

Neural network is another way to find the correct matching. Neural network can learn the similarities among data directly from its data and predict solutions from the data in improving the precision and recall of schema matching. Furthermore, one major concern of using neural networks is training time [22]. A novel Content Based Schema Matching Algorithm (CBSMA) [23] adopts neural network techniques to perform a content based matching task. This algorithm has two primary steps. First is the analysis of data pattern, which is done by training a set of neural networks, which is used for calculating the candidate matching pairs. Secondly, applying a rule-based algorithm to filter the candidate pairs and get the correct matching result. SMDD [24] method works based on neural network by analyzing the characteristics of the data contents. This method has a good feature which it can be used independently or as a supplement for the other schema matching methods.

Many approaches have been proposed by employing machine learning technique like decision-trees or support vector machines (SVMs) in order to provide training samples of data and then classify the data into two classes, namely match or non-match. ALIAS is a function designed by [25] that can resolve when a pair of records refers to the same entity in spite of various data inconsistencies. LSD system used machine learning technique to introduce the concept of mediated schema, or global schema [25]. A new data source is mapped against the determined schema beforehand by using machine-learning techniques on the data values obtained. Mutual information is an alternative way used in this area. The work presented in [26] is an instance based matching with the goal of exploring the characteristics of the data values stored in the schemas. In first step, this approach computes the mutual information of each pair of attributes in one schema. In the second step, schema matching is achieved by the execution of an efficient graduated assignment graph matching algorithm.

3. The Proposed Method 3.1. Motivation

To find matching between heterogeneous data sources, usually the direct approach is to compare the schema information such as attribute names, descriptions, schema structures, and constraints. But this is not always useful especially in cases where information is ambiguous or is presented as abbreviation.

(4)

When schema matching fails, the next approach is to analyse the instances stored in the schemas. Analysing the instances of the schemas is one of the important tasks in schema based matching. As mentioned in the previous section, a variety of instance based techniques have been introduced and utilized. One of the common tasks in these techniques is to measure the similarity between schemas. For instance, given two schemas A (A1, A2, …, Am) and B (B1, B2,…, Bn), the similarity between attributes Ai and Bj depends on the similarity metrics that is used. Using different similarity metrics may lead to different similarities, which will directly influence the quality of matching. Thus, the comparison of attributes across different schemas does not always provide good matching. Therefore, knowing the format of the values of an attribute could help identifying its correspondence attribute in the other schema. That is, what we intent to find out, the relationship between Ai and Bj using regular expression.

For example, Fig. 1 presents two schemas to be matched. In the example, we noticed that the names of attributes can be in the form of compound nouns, abbreviations or even containing special characters which make the schema matching process unable to directly find the correct correspondence attributes. We believed that considering the format of the instances, i.e. using regular expression, can solve the above issues. For instance, referring to the Fig. 1 the column HotelName in the table HOTEL is most probably match to the column NH in the table HTL because their instances exhibit similar data format. Similarly, the column Address of the table HOTEL is matched with the column ADD of the table HTL. The same goes for Phone Number and PH#.

Table: HOTEL

HotelName Address Phone Number

caef bizou 14016 ventura blvd 818-788-3536 fenix 8358 sunset blvd 310-482-5634 citrus 6703 melrose ave 357-958-9587 Table: HTL

NH ADD PH#

hotel bel air 701 stone canyon 310-427-1211 companile 324 la brea 259-147-2488 finx at the argyl 82 sunset blve 964-654-9524 Fig. 1: Two schemas to be matched.

3.2. Regular Expression

Regular expression (known as regexps or regex) is a way to describe text through pattern (format) matching and provide an easy way to identify strings. Regular expression is a language used for parsing and manipulating string. Furthermore, a regular expression is a string containing a combination of normal characters and special metacharacters or metasequences (*, + and?). Nearly, every programming language has its own way to deal with regular expressions such as Java, Perl, .NET, and PHP [27].

For example, referring to Fig. 1 the regex of the column HotelName of the table HOTEL is [a-z]+ which means any characters within the range of a-z while the + denotes an arbitrary number of any characters is the valid value for the attribute HotelName. More details about regular expression can be found in [27]. Table 1 shows the most common metacharacters and metasequences in regular expression that are used in our work. Regular expression provides several benefits, which are [28]:

• Relatively inexpensive and do not require training or learning as in learning-based or neural network techniques.

• Regular expression can provide a quick and concise method to capture valuable user knowledge about the domain.

(5)

Table 1: The most common metacharacters in the regular expressions. Metacharacter Name Matches

. Dot Matches any one character. […] Character class Matches any one character listed. [^…] Negated character class Matches any one character not listed.

? Question One allowed, but it is optional.

* Star Any number allowed, but all are optional. + Plus At least one required; additional are optional. | Alternation Matches either expression it separates. ^ Caret Matches the position at the start of the line. $ Dollar Matches the position at the end of the line. {X,Y} Specified range X required, max allowed

3.3. Using Regular Expressions to Describe Data Instances

The huge amount of data needs to be taken into account in matching different schemas. However, the growth in data increases the time complexity of matching process. Therefore, a scalable matching algorithm that offers reasonable time complexity for huge data is urgently needed. Currently, the most obvious approach is to compare the instances directly, but this approach needs a lot of time, memory space, and computing power [29]. We believed that it is possible to use regular expression as a formalism to characterize a set of values. In general, given a set of data instances, the regular expression of that set can be determined by analysing the pattern (format) of the data instances. Having this regular expression, the correspondence attribute is detected by matching the regular expression with the value of the attribute using the match function (Java built in function: java.util.regex). To the best of our knowledge, this is the first attempt which use regular expression in the area of instance based matching.

The proposed approach consists of two phases. The inputs to our proposed approach are: source schema and target schema – both consist of the name of the attributes as well as the instances. The first phase aims at generating the regular expression for each attribute of the source schema. It consists of several steps as explained below. In the first step, a value from each attribute is picked randomly and its data type is identified. The value might belong to the string, number or mix data type. In our work, special characters that appear in the value for instance @ are ignored. Then, regular expression is derived for each of these values. However, for the data type string, no regular expression is derived at this stage. For the attribute with the string data type, a string tokenizing process is performed. This process splits the string into a set of tokens. Only the first token of the set will be used in the second phase. The output of the first phase is a list of regular expressions for each attribute except for the attributes with the string data type.

The inputs to the second phase are the list of regular expressions derived from the previous phase and the target schema. For each regular expression, it will try to find a match by matching the regular expression against a value which is randomly picked from each attribute of the target schema. If a match occurs, then the attribute of the regular expression from the source schema is said to correspond to the attribute of the value from the target schema. For the attribute with the string data type, the token which is derived in the previous phase is matched against the values of each attribute of the target schema. This is due to the fact that two strings could be similar if they have the same token. Fig. 2 illustrates the two phases of instance based matching using our approach.

(6)

Phase 2

Require: target schema t, list of regextok l

1 For each component lil do

2 If (li not regex) then

3 For each attribute a t do

4 For each ai a do

5 If (li = ai) then 6 match = true 7 Break 8 End If 9 End For 10 End For 11 Else

12 For each attribute a t do

13 v = random (a) 14 If (match (li,v)) then 15 match = true 16 Break 17 End If 18 End For 19 End If 20 End For Phase 1 Require: source schema s, empty list of regextok l

1 For each attribute a s do

2 v = random (a) 3 t = type (v) 4 If (t String) then 5 k = GetFirstToken(v) 6 Add(l,k) 7 Else 8 Regex = Generate (v) 9 Add(l, Regex) 10 End If 11 End for 12 Return l

Fig. 2: The two phases of instance based matching using regular expression.

4. Evaluation 4.1. Dataset

To illustrate the performance of our approach, we conducted several experiments on the standard dataset: restaurant dataset which is published on the websites [30]. It was created by merging the information of some restaurants from two websites: Zagat and Fooder. There are 864 records and 5 attributes which are: Name, Address, City, Phone Number, and Type of food. We horizontally partition it into two parts to simulate two schemas from different sources. The experiment aims to find the one-to-one matching across two schemas.

4.2. Measurements

The evaluation metric considered in this work is accuracy (1). It is based on the notion of true positive, false positive, true negative, and false negative

.

• True positive (TP): The number of matches detected when it is really matches. • False positive (FP): The number of matches detected when it is really non-match. • True negative (TN): The number of non-matches detected when it is really non-match. • False negative (FN): The number of non-matches detected when it is really matches.

Accuracy= |TP| + |TN| (1)

In our work, we have carried out 10 experiments to evaluate the proposed approach. The random selection in both phases causes some variations in the results; the average of these experiments is then computed.

(7)

4.3. Result

Table 2 shows the accuracy of different string similarity measures performed with 1%, 5% and 10% of training based on the restaurant dataset which is taken from [31]. Experiments on the restaurant dataset have shown that our proposed approach achieved on average 98% accuracy.

Table 2: Comparison of accuracy of different string similarity measures on the restaurant dataset.

Similarity metric 1% 5% 10% Average

Jaro Winkler 79.23% 85.18% 86.68% 83.69% Jaro 80.63% 85.79% 87.84% 84.75% Cosine 97.60% 95.98% 95.50% 96.36% Q-gram 96.78% 96.65% 94.98% 96.13% Levenstein 96.08% 97.00% 94.85% 95.97% LCS 95.79% 96.04% 95.88% 95.90% Regex - - - 98.00% 5. Conclusion

In this paper we investigated instance based matching using similarity metrics. We proposed an approach that does not rely on learning or similarity metrics techniques. To the best of our knowledge, the work presented in this paper is the first attempt to use regular expression in finding correspondence attributes of schemas. We have conducted several experiments and the results showed that our proposed approach is better than the other well known similarity metrics in terms of accuracy. We intend to further evaluate our proposed approach with respect to precision, recall and f-measure, as well as execution time.

6. References

[1] Gollmick,C. Replication in mobile database environments: a client-oriented approach. In: Proc. of DEXA 2003, p.980-981. [2]E. Rahm, P. Bernstein. A survey of approaches to automatic schema matching. The VLDB J 2001; 10 (4):334-350.

[3]H. Zhao, S. Ram. Combining schema and instance information for integrating heterogeneous data sources. Data Know & Eng

J 2007; 61 (2): 281-303.

[4]W. Cohen, P. Ravikumar, S. Fienb erg (2003). A comparison of string distance metrics for name-matching tasks. In: Proc. of IJCAI2003, p.73-78.

[5]H.B. Newcombe, J.M. Kennedy, S.J. Axford, A.P. James. Automatic linkage of vital records. Sci J 1959; 130 (3381): 954– 959.

[6] J.C. Pinheiro, D.X. Sun (1998). Methods for linking and mining massive heterogeneous databases. In: Proc. of IJCAI1998, p. 309–313.

[7]J. Wang, S. Madnick. The inter-database instance identification problem in integrating autonomous systems. In: Proc. of ICDEIEEE1989, p.46-55.

[8]M. Ganesh, J. Srivastava, T. Richardson (1996). Mining entity identification rules for database integration. In: Proc. ofKDD 1996, p. 291-294.

[9]M. Hernandez, S. Stolfo. Real-world data is dirty: Data cleansing and the merge/purge problem. Data Mining and Know

Disco J1998; 2(1): 9-37.

[10] V. Verykios, A. Elmagarmid, E. Houstis. Automating the approximate record-matching process. Info Sci J 2000; 126(1-4): 83-98, 2000.

(8)

[12] W. Cohen, H. Kautz, D. McAllester (2000). Hardening soft information sources. In: Proc. of ACM SIGKDD2000, p. 255-259.

[13] M. Bilenko, R. Mo oney, W. Cohen, P. Ravikumar, and S. Fienb erg. Adaptive name matching in information integration.

IIWEB J 2003; 18(5): 16-23.

[14] S. Tejada, C.A. Knoblock, S. Minton. Learning object identification rules for information integration. Info Syst J 2001; 26(8): 607–633.

[15] S. Tejada, C.A. Knoblock, S. Minton. Learning domain-independent string transformation weights for high accuracy object identification. In: Proc. of ACM SIGKDD 2002, p.350–359.

[16] V. Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. Soviet Physics Doklady 1966;8: 707-710.

[17] M. A. Jaro. Advances in Record-Linkage Methodology as Applied to Matching the 1985 Census of Tampa, Florida. J

ASA1989; 84(406): 414-420.

[18] E. Moreau, F. Yvon, and O. Cappe (2008). Robust similarity measures for named entities matching. In: Proc. of KRAQ 2008, p. 593-600.

[19] P. Jaccard. The Distribution of the Flora in the Alpine Zone. New Phytologist J 1912; 11(2): 37-50

[20] Alvaro E. Monge, Charles P. Elkan. The Field Matching Problem: Algorithms and Applications. In: Proc. of KDD 1996, p. 267-270.

[21] A. K. Elmagarmid, P. G. Ipeirotis, V. S. Verykios. Duplicate Record Detection: A Survey. TKDE J 2007; 19(1): 1-16. [22] Wen-Syan Li a, Chris Clifton. SEMINT: A tool for identifying attributes correspondences in heterogeneous databases using neural networks. DKE J 2000; 33(1):49-84.

[23] Y. Yang, M. Chen, B. Gao (2008). An effective content-based schema matching algorithm. In: Proc. of FITME, 2008, pp.7-11.

[24] Y. Li, D. Liu, W. Zhang. Schema matching using neural network. In: Proc. of IEEE/WIC/ACM2005, p.743-746. [25] AnHai Doan, Pedro Domingos, Alon Halevy. Halevy (2001). Reconciling Schemas of Disparate Data Sources: A Machine-Learning Approach. In: Proc. of ACM SIGMOD 2001, p. 509-520.

[26] Yan Liang. An instance-based approach for domain-independent schema matching. In: Proc. of ACM-SE 2008, p. 268-271. [27] Jeffrey E. F. Friedl. Mastering Regular Expressions, 3rd Edition. O'Reilly; August 2006.

[28] AnHai Doan, Alon Y. Halevy. Semantic Integration Research in the Database Community: A Brief Survey. AAAI J 2005; 26(1): 83- 94.

[29] Katrin Katrin, Stefan Conrad. Instance-Based Ontology matching Using Different Kinds of Formalisms. In: Proc. of WASET2009, p.164- 172.

[30] http://www.cs.cmu.edu/~mehrbod/RR/.

[31] Mohammadreza Ektefa.(2011). A threshold-Based Combination of String and Semantic Similarity Measures for Record

References

Related documents

Medicinal plants have been utilised for several years because of their therapeutic and health promoting benefits. The present study revealed that medicinal plants contain a lot

If the top C pin is open yet V + is still connected, then the best way to detect an open connection to the top C pin is by comparing the sum of all cell measurements using

Yet, to the best knowledge of the researcher, no event-related research study has evaluated the impact of brand orientation and organisational innovativeness on brand and

Thus, it seems to me somewhat contradictory that Hardt and Negri do not dispute Marx’s assertion as cited above but then make the claim that socially necessary labour time is

Sequencing of stable variants revealed up to three exchanges in the linear TAV-epitope. These exchanges were accompanied by interesting, probably compensa- tory exchanges especially

The Impact of Motivation on Object-Based Visual Attention Indexed by Continuous Flash

The present thesis describes the development and validation of a viscosity adaption method for the numerical simulation of non-Newtonian fluids on the basis of the Lattice

XML[2] is a restricted version of SGML (Standard Generalized Markup Language), designed especially for Web documents. For example, XML supports links that point to multiple