#!/usr/bin/perl

eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
    if 0; # not running under some shell

use strict;
use warnings;
use RDF::Trine;

my $data;
if (scalar(@ARGV) and -r $ARGV[0]) {
	my $file	= shift;
	$data	= do { local($/) = undef; open(my $fh, '<:encoding(UTF-8)', $file) or die $!; <$fh> };
} else {
	binmode(\*STDIN, ':encoding(UTF-8)');
	local($/)	= undef;
	$data	= <>;
}

my $iter	= RDF::Trine::Iterator->from_string( $data );
print $iter->as_string;
