3

I have the RETS metadata file and I would like to convert it to a database schema so I can query my database instead of a RETS server.

Does anyone know of a tool that can take the xml and convert it to database schema? Or maybe the database schema itself?

Everything is contained inside the metadata, fields description, lookup fields definition and so on.

Here's the metadata:

http://176.9.99.205/Test/metadata.xml

Thanks a lot.

abelabbesnabi
  • 1,819
  • 1
  • 16
  • 21

2 Answers2

0

No there isn't anything like that that I know of. You would have to make your own db schema based off your RETS server or code a script that will read in the metadata and spit out a schema for your platform. (Which you hadn't specified by the way).

Hopefully your MLS followed the RETS specification when they created their server and you can follow those rules.

Troy Davidson maintains a good utility PHP class that can help you get started. He also maintains RETS-MD

Anthony Hatzopoulos
  • 10,437
  • 2
  • 40
  • 57
  • 1
    The PHRETS documentation has sample code for creating mysql tables from RETS metadata: https://github.com/troydavisson/PHRETS/wiki/Create%20MySQL%20tables%20from%20RETS%20metadata – Andrew Briggs Jun 28 '13 at 18:46
0

I wrote something similar to this recently using XML::Rabbit and DBIx::Class.

You just need to build an XML::Rabbit structure so you can process your XML. In my case I was able to make a 1:1 match (your metadata XML is very similar to what I have) with tags in XML file to database columns with a couple minor changes. So when I processed the XML file I would be inserting into the same column in the database.

dj_goku
  • 117
  • 6