Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Fetching the topic out of content.rdf.u8

Quote Reply
Fetching the topic out of content.rdf.u8
Hello

If you are just trying to import a single TOPIC from that content.rdf.u8 file, you will know it takes for ever to let your server to run the nph-import. Ofcourse, you can follow what Alex suggested in another thread, but here is just another alternative.

Just save the following code snippet into a file,
say: fetchTopic.pl

Of course, update the startpattern with your own
topic of choice.

Code:
#!/usr/bin/perl

my $startpattern="Top/Regional/Asia/India";
my $flag = 0;
while(<>) {
####
if (/^<Topic r:id="${startpattern}/) {
$flag = 1;
} elsif (/^<Topic/) {
$flag = 0;
}
print if $flag;
}

Then,

% gunzip -c content.rdf.u8.gz | ./fetchTopic.pl > mytopic.rdf

That's it. And now you have your entire TOPIC extracted out and kept in its own RDF file. Just run nph-import on this file, and it wont take days and days.. but only few mins. to hours.

Hope this helps.

-Srinivas
Quote Reply
Re: [srinivas] Fetching the topic out of content.rdf.u8 In reply to
You mean like this....Wink ....this one splits the whole content.rdf.u8 file though into its top-level cats..

(Attachment removed)

Last edited by:

Paul: Apr 2, 2002, 2:37 PM
Quote Reply
Re: [Paul] Fetching the topic out of content.rdf.u8 In reply to
Yes, exactly. Did you post this before on this forum? I didn't find it the last time I checked for a tool to do exactly this. I guess, the only difference is that yours parses out all TOPICs, and my code just gets me what I want. Kinda nice to have both. Thanks for sharing the code.

-Srinivas
Quote Reply
Re: [srinivas] Fetching the topic out of content.rdf.u8 In reply to
Yep posted a link to it a while back. I made a browser and shell version.
Quote Reply
Re: [srinivas] Fetching the topic out of content.rdf.u8 In reply to
I swear theres something up with my pc.

The original file is neatly formatted and when I download that post attachment it is all over the place.

Last edited by:

Paul: Apr 2, 2002, 2:13 PM
Quote Reply
Re: [Paul] Fetching the topic out of content.rdf.u8 In reply to
mmm.. looks fine for me. May be you are using Opera... I get it jumbled up in Opera.. but in NS and IE it comes up just fine.

-Srinivas
Quote Reply
Re: [srinivas] Fetching the topic out of content.rdf.u8 In reply to
IE 6 Unsure
Quote Reply
Re: [Paul] Fetching the topic out of content.rdf.u8 In reply to
I am using IE 6.0.2600.0000IS, and dont see the same problem.

-Srinivas