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:sort..
21 $sort =~ s/^[ \t]*[^"]*"&hns;([^"]*)"\/>/$1/;
22 $sort = "http://www.cs.unibo.it/helm/schemas/schema-helm#$sort";
23 $line4 = <IN>; #<h:depth..
26 $depth =~ s/^[ \t]*<h:depth>([^<]*)<\/h:depth>$/$1/;
27 $line5 = <IN>; # </h:refRel
28 $line6 = <IN>; # </h:Object>
31 $position =~ s/'/\\'/g;
34 print "insert into hrefSort values ('$line0', '$position', '$sort', $depth);\n\n";