File: xml_rdfa11-to-ntriples.pl

package info (click to toggle)
librdf-rdfa-parser-perl 1.097-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,948 kB
  • sloc: perl: 6,582; makefile: 7; xml: 6; sh: 1
file content (13 lines) | stat: -rw-r--r-- 340 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl

use 5.010;
use RDF::RDFa::Parser;
use RDF::Trine::Serializer;

my $file = URI::file->new_abs(shift);
my $opts = RDF::RDFa::Parser::Config->new(xml => '1.1');
my $rdfa = RDF::RDFa::Parser->new_from_url($file, $opts);
my $ser  = RDF::Trine::Serializer->new('NTriples');

print $ser->serialize_model_to_string($rdfa->graph);