Comparison of multiple databases

Hi,

I have been working on schema matching for multiple databases and trying to implement it in php. I have two databases ;one is corpus that contains information about tables and columns of various databases which are matched. Another is bookstore whose tables and columns are to be matched with that of corpus. To make it more clear here is my schema:
Corpus:
db1|db2|left|right
Aaron_Day|Alon|warehouse/currentNumofBooks|books/CurrCapacity

that means from column currentNumofBooks of table warehouse of db Aaron_DAy matches with column currcapacity of table books of db Alon.

Now i have another database called bookstore which has tables like books, authors, warehouse, etc. Now I have to see if all tables and their columns matches with that of corpus or not.

Can you provide me some suggestions on how i can compare them?