need a program to parse odp PLEASE

M

martin30

Thank you! But those programs parse the odp dump while you are on a server, and since I am not, I would have to upload the whole dmoz file when I am only wanting to parse a relatively small part of the directory.
 

hmf

Member
Joined
Aug 5, 2003
Messages
10
Then your bets bet is tulipchain. (http://ostermiller.org/tulipchain/)
It reads odp content throgh the web interface. This makes
sense if you are only intersted in your categories data.
The approach of tulipchain is not usable for parsing larger parts of the directory)

However it does not insert its data into a database. I am currently working on such a feature. However I am using Berkeley DB/Object database, because mySQL is far too slow on hierarchical data.
 

windharp

Meta/kMeta
Curlie Meta
Joined
Apr 30, 2002
Messages
9,204
Nope, TulipChain is free for all. Several of its advanced features are available to editors only, but the program itself can be used by anyone.

But as stated above it does not solve the problem. It can produce HTML output of a complete tree with some tricks, but _if_ you want to spider a small part of the ODP I suggest spidering it directly, not with a tool like this that produces output that has to be spidered again.
 

bobrat

Member
Joined
Apr 15, 2003
Messages
11,061
Parsing and extracting a subset of data fromthe RDF dumps is not in itself time comsuming. My experience is that downloading the full RDF dump, and extracting a subset, is fairly easy and fast to do. Adding the data to mySQL, which is what I have been doing, seems to be the time killer. [Which is why I was only extracting a subset for one area of ODP]
 

theseeker

Curlie Meta
Joined
Mar 26, 2002
Messages
613
Adding the data to mySQL, which is what I have been doing, seems to be the time killer.

I extract most of the information and put it into mySQL tables, though my programs are very editor oriented so probably wouldn't be of much use to anyone else. But one way I speed this up is to extract the information into a tab-delimited flat file--for example, if I have a table with URL, Title, Description, and Category the each site would be on one line, with the URL, title, description and category separated by tabs.

Once I'm finished writing all the data to flat files, I then Truncate the table (or delete everything from the table), and then I use LOAD DATA LOCAL INFILE "flatfile.txt" INTO TABLE tablename

I don't use an index on the table containing the 4 mil+ sites, but if you do, you don't want the index there until you've loaded all the sites into the table. Then create the index.

One other very big time (and space) saver, is to create a catid table. This table should have only two fields: catid and path, where catid is the cat id in the RDF for each category, and path is the full path of the category, like Arts/Online_Writing. Then, in any other table where you need to specify a category, use the catid. When you query a table with a catid, join it with the catid table to get the path.

Using those techniques, and a few others that are more complicated to explain, I've reduced the parsing time to under an hour. :monacle:
 

nakulgoyal

Member
Joined
Nov 8, 2003
Messages
26
Re:

Thanks hmf !! The info you provided was useful for me as well. Just for General Knowledge you see :)
 

giz

Member
Joined
May 26, 2002
Messages
3,112
>> But those programs parse the odp dump while you are on a server, and since I am not, I would have to upload the whole dmoz file when I am only wanting to parse a relatively small part of the directory. <<

You could always run a local copy of Apache, PHP, and mySQL, so that it appears that you are on a server. Access it through http://localhost/ or http://127.0.0.1/ etc.
 

nakulgoyal

Member
Joined
Nov 8, 2003
Messages
26
giz said:
>> But those programs parse the odp dump while you are on a server, and since I am not, I would have to upload the whole dmoz file when I am only wanting to parse a relatively small part of the directory. <<

You could always run a local copy of Apache, PHP, and mySQL, so that it appears that you are on a server. Access it through http://localhost/ or http://127.0.0.1/ etc.

Good idea g1smd !! I will just try it !!
 
This site has been archived and is no longer accepting new content.
Top