3 my $inputfile = $ARGV[0];
5 #print "Now splitting file $inputfile\n";
6 open(IN, "<$inputfile") or die "Error opening file $inputfile";
7 while(($skip = <IN>) && not ($skip =~ /<rdf:RDF/)) {}
8 while(($line0 = <IN>) && not ($line0 =~ /<\/rdf:RDF>/)) { # <h:Object
10 $line0 =~ s/^[^"]*"([^"]*)">$/$1/;
11 $line1 = <IN>; #<h:refRel..
13 $line2 = <IN>; # <h:position rdf:resource="&hns;value"/>
16 $position =~ s/^[ \t]*[^"]*"&hns;([^"]*)"\/>/$1/;
17 $position = "http://www.cs.unibo.it/helm/schemas/schema-helm#$position";
18 $line3 = <IN>; #<h:depth..
21 $depth =~ s/^[ \t]*<h:depth>([^<]*)<\/h:depth>$/$1/;
22 $line4 = <IN>; # </h:refRel
23 $line5 = <IN>; # </h:Object>
26 $position =~ s/'/\\'/g;
28 print "insert into hrefRel values ('$line0', '$position', $depth);\n\n";