Web Hosting Talk







View Full Version : RDF to MySQL insert query program needed..


mkaufman
04-06-2002, 09:44 AM
Hello,

I need to insert DMOZ's links into a MySQL database (links only, no categories, etc..)

They provide RDF files..though I really have no idea how to parse them or do whatever to them. I do want to convert them to MySQL files though so I can add links to a mysql db..

a short snippit of their file looks like this:



<ExternalPage about="http://www.mfgsupply.com">
<d:Title>Manufacturer's Supply</d:Title>
<d:Description>Your one-stop source for lawnmower, chainsaw, and small engine parts. We offer online ordering of all our parts and great service too.</d:Description>
</ExternalPage>

</Topic>



as you can see, they have a url in there, along with a title and description. I woudl want that above code turned into something like...

[code]

mysql_query("INSERT INTO links (url,title,description) VALUES ('$url', '$title', '$description'");

get it.....? yeah.. :) anyway, if you know of something already available for this..or would want to help me make one - please email me at mkaufman@techboost.com or PM me..

iVersit
04-06-2002, 04:43 PM
I can certainly make a php script that parses the RDF and inserts the data into a mysql table, however, you did not mention what sort of budget you are working with...

jks
04-06-2002, 04:50 PM
There's a freely available perl program that parses RDF files from DMOZ and into MySQL queries. I cannot remember it's exact name, but try searching on Freshmeat.

I've used it several times in the past to convert the DMOZ database into something useable.