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
Subject Author Views Date
Thread Fetching the topic out of content.rdf.u8 srinivas 2517 Apr 2, 2002, 1:57 PM
Thread Re: [srinivas] Fetching the topic out of content.rdf.u8
Paul 2474 Apr 2, 2002, 2:03 PM
Thread Re: [Paul] Fetching the topic out of content.rdf.u8
srinivas 2474 Apr 2, 2002, 2:09 PM
Post Re: [srinivas] Fetching the topic out of content.rdf.u8
Paul 2454 Apr 2, 2002, 2:11 PM
Thread Re: [srinivas] Fetching the topic out of content.rdf.u8
Paul 2428 Apr 2, 2002, 2:13 PM
Thread Re: [Paul] Fetching the topic out of content.rdf.u8
srinivas 2455 Apr 2, 2002, 2:17 PM
Thread Re: [srinivas] Fetching the topic out of content.rdf.u8
Paul 2448 Apr 2, 2002, 2:35 PM
Post Re: [Paul] Fetching the topic out of content.rdf.u8
srinivas 2442 Apr 2, 2002, 2:52 PM