1 / 19

Sharing address cleaning patterns for Patstat : a metadata structure proposal

Sharing address cleaning patterns for Patstat : a metadata structure proposal. By Gianluca Tarasconi. From chaos to order. Main milestones of clearing and standardizing patstat persons (inventors and applicants) can be synthesized as follows: PRE-PARSING CLEANING STANDARDIZATION

callia
Télécharger la présentation

Sharing address cleaning patterns for Patstat : a metadata structure proposal

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SharingaddresscleaningpatternsforPatstat: a metadatastructureproposal By Gianluca Tarasconi

  2. From chaos to order... Main milestones of clearing and standardizing patstat persons (inventors and applicants) can be synthesized as follows: • PRE-PARSING • CLEANING • STANDARDIZATION • DEDUPLICATION Due to the strict sequentiality of the process, last steps (address standardization and deduplication) results greatly depend from the quality of first two steps.

  3. ... and back to chaos... • Different team specialize on ‘local’ addresses [countrywise data cleaning] • Standards (i.e. sequence in toponym, street name, number) differ from team to team • Enrichments / links to other data may need special data structure Eventually results of data parsing and cleaning may differ much among different workteams.

  4. Metadata structure proposal (I) We figure that there will be a certain point in which data coming from patstat are parsed into an intermediate data structure where original strings are splitted into several fields according to the meaning of geographic information contained. Standard data Standard & disambig data Parsed & clean data Parsed data structure Data origin (206, 206ascii…) Dedupl. Pre-parsing Standard. Cleaning

  5. Metadata structure proposal (II) • ADDRESS Tipically toponim, name, number • LOCALITY City area (optional) • ADDR_OTHER Other specifics different than toponims (floor, building, but also c/o company name) [should be data not relevant for standardization] • CITY Municipality name • COUNTY Administrative level above municipality • REGION Administrative level above county • STATE Administrative level above region for federal nations • ZIP_CODE Alphanumeric zip code

  6. Dimensions in data cleaning: operators (I) typical operators in order to clean/move pieces of information across fields are: • MOVE moves a string from one field to another • REPLACE changes a string inside a field • INSERT inserts a string without removing other strings • DELETE removes a string without removing other strings For such operators we should consider two dimensions indicating where the operation takes place: • FIELD FROM name of the field where operation start from • FIELD TO name of the final target of operator (optional) Also we need to list what string has to be found and what must be replaced with • FIND string to be found • REPLACE string replacing the string found

  7. Dimensions in data cleaning: operators (II) We may reduce the number of operators only to MOVE considering the other as particular cases of MOVE • REPLACE = MOVE where FIELD FROM = FIELD TO • INSERT = MOVE where FIELD FROM = FIELD TO and REPLACE string = FIND + insert string • DELETE = MOVE where FIELD FROM = FIELD TO and REPLACE string is empty This structure allows also combinations of operators like move & replace (f.i. remove from a field a misspelled string to the correct field with correct spelling see example #5 below)

  8. Dimensions in data cleaning: example Eventually we will have to take count, using move operator, in which position of target field we want to move the string. This issue will be faced later on.

  9. Dimensions in data cleaning: endogenous data Methods used to clean addresses may differ depending from pieces of information contained in the data themselves. Typical case are: • APPLICATION AUTHORITY gives some ‘address filling hints’ and charset • COUNTRY CODE gives toponyms, administrative data etc. etc. • YEAR FROM / TO (OPT.) some info may change with time (fi: change in ctry code) • PATSTATEDICTION FROM/TO (OPT.) some info can change with changes in patstat.

  10. Dimensions in data cleaning:match patterns Eventually, at string level, this is the core of our interchange format. Our proposal is to use SQL REGEXP operator patterns as default, including the following parameters • LIKE pattern to be found (inclusion criteria) • LIKE NOT [OPTIONAL] pattern not to be in (exclusion criteria) • POSITION (begin / end) start / end position where pattern can be • SQLSTANDARD gives the standard used for filling the patterns (sql ‘dialect’, like vsregexp…) in order to make easier translation

  11. Interchange data structure proposal: operator • It’s proposed to use a field called OPERATIONKIND where we may store origin and destination of the move operation. • It would be a multilayer indicator having a digit for each of the field of the pattern group, indicating the address field to be addressed. • FI: BCEF • LIKE, LIKE NOT, FIND, REPLACE = BCEF would mean if LIKE pattern is in address, NOT LIKE is not in locality, find FIND pattern in city and insert REPLACE pattern in county. • It will be added an optional last digit indicating in case of move operation (where 1st and 4th digit are different) containing L or T respectively where REPLACE pattern must be inserted leading or trailing in target field. • FI: BBBDT would mean LIKE, LIKE NOT, FIND are in address, and replace string must be inserted at the end of addr_other field.

  12. Interchange data structure proposal: endogenous data This is the list of the fields needed; where not indicated meaning of the field is explained in previous slides • APPLICATION AUTHORITY 2 char string % may indicate valid for all • COUNTRY CODE 2 char string % may indicate any country • DATE FROM date [optional] empty means no exclusion • DATE TO date [optional] empty means no exclusion • PATSTATFROM MMYYYY [optional] empty means no exclusion • PATSTATTO MMYYYY [optional] empty means no exclusion

  13. Interchange data structure proposal: match patterns (I) Where not indicated meaning of the field is explained in previous slides • ALIKE string (is not called LIKE cause it may cause errors in some SQL ) • LIKE NOT [OPTIONAL] string • FIND string • FIND2 string when literal find do not work and we need a fix len • REPLACE string • POSFROM integer start point of string position • POSTO integer end of position where string can be • SQLSTANDARD string

  14. Interchange data structure proposal: match patterns (II) Note: some combinations of POSFROM POSTO may have particular meanings like : (1 , 1) mean start position ; (9999; 9999) means trailing position; (2 ; 9999) means everywhere but at beginning. Eventually a field containing a description of the operation is needed; • DESCRIPTION text

  15. Some examples

  16. Deep into one pattern (I) Let’s see how query would work in one examples (# 100 the one highlightened) We suppose we have an intermediate table called address where our fields are structured according to metadata structure proposal (see above). Our patterns table is called here corrections. We run it on a record with ADDRESS = “WAGNER STRASSE 3 BIS 12”

  17. Deep into one pattern (II): “WAGNER STRASSE 3 BIS 12” VS “ BIS “ update applicant a, corrections b set a.address=trim(concat( LEFT(a.address, INSTR(a.address,b.find)-1), b.replace, right(a.address, LENGTH(a.address) - length(b.find)-INSTR(a.address, b.find)+1) )) where b.OPERATIONKIND = “BBBB” INSTR(a.address, b.find) >= b.posfrom and INSTR(a.address, b.find) <= b.POSTO and a.address regexp b.like and a. address not regexp b.likenot and b.datefrom is null and b.dateto is null and b.pastatfrom is null and b.pastatto is null; new address field is trimmed aggregation of what was before the change (“WAGNER STRASSE 3“) “-“ “12” this means “ – “ is from position 2 onward this means “ – “ is before position 9999 address contains reg. expr. '[0-9] BIS [0-9]' addr. don’t contain ' BIS .+ BIS ‘that means twice‘ BIS ‘ no criteria on date or patstat ediction

  18. Open issues (I): Eventually we have to consider some issues still pending • Define a standard address Since cleaning pattern rely on backward logic, people sharing these data should have a common target in data standardization. It’s propose to use local post office standards, but such standards may be unavailable / not fitting. • Company Names standardization It may be possible to think about adding company names, benefitting from national experience in standardizing legal kind (ie CO. LTD GMBH…) of company names. • Automatic query generation User would greatly benefit from exchanging patterns if it could be possible to create a query generating tool that would, from pattern table, create SQL files.

  19. Open issues (II): • High correlation & chronology Quality and results of data cleaning may depend from the order steps have been run (FI: if I do not remove PO BOXES numbers from addresses before cleaning street numbers I may have wrong results). Most of all some patterns must be run recursively and in some cases groups of patterns should run recursively (fi: MOVE from address PO BOX, CITY, ZIP, REMOVE COMMA; since I do not know the order the elements have in ADDRESS I should run the group of queries 4 times to be sure) A partial solution may be to add fields indicating the ID of previous query, of following query and number of repetitions. Remain open the issue of how do we manage group of repetitions and cleaning patterns needing a ‘loop until no match is found.

More Related