 use strict;
 use warnings;
 use LWP::UserAgent;
 use HTTP::Request::Common;
 
 my $FH;
 my $upfile = shift;
 open($FH, "$upfile") or die "can not open $upfile $!";
 
 my $ua = LWP::UserAgent -> new;
 
 # POST準備
 my $url = 'http://sw05.dbcls.jp/bigdata/sparql';
 #my $url = 'http://sw05.dbcls.jp/bigdata/sparql?delete';
 my $postdata = "";
 
 my $counter = 0;
 while(my $line = <$FH>){
     $counter++;
     $postdata .= $line;
    
     if($counter%10000 == 0){
         my $request = POST( $url );
         $request->content_type('text/plain');
         $request->content($postdata); 
 
         # 送信
         my $res = $ua -> request( $request );
         print $res -> as_string;
         $postdata = "";
         $counter = 0;
     }
 }
 
 my $request = POST( $url );
 $request->content_type('text/plain');
 $request->content($postdata);
 
 # 送信
 my $res = $ua -> request( $request );
 print $res -> as_string;
 
 close($FH); 
 
 1;