trapper - command-line RDF parsing and serialising tool
trapper [options] INPUT-URI [INPUT-BASE-URI] Options: --input F, -i F Set the input format to F --input-uri U, -I U Alternative to INPUT-BASE-URI --output F, -o F Set the output format to F --count, -c Count triples only --quiet, -q No extra information messages --help, -h Show this help --version, -v Show module versions Input formats: rdfxml, n3, turtle, rdfa, nquads, trig, rdfjson, atom, xrd. Output formats: rdfxml, n3, turtle, ntriples, rdfa, nquads, rdfjson, canonical.
Specify the input format. The synopsis of this manual page shows a list of input formats. Using media types should work too. In summary, it accepts any type that the rdf_parse function from RDF::TrineShortcuts accepts.
rdf_parse
If an input type is not specified, trapper will try to guess the input type (and will almost always get it right).
Any of these three methods can be used to specify a base URI for the parser to resolve relative URI references.
Specifies the output format. The synopsis of this manual page shows a list of input formats. Using media types should work too. In summary, it accepts any type that the rdf_string function from RDF::TrineShortcuts accepts.
rdf_string
If an input type is not specified, 'ntriples' is assumed.
Suppresses the output of the data, and just shows a count of triples instead.
Hides useless debugging messages.
Shows a short help message.
Shows the version of various Perl modules used by trapper. trapper itself doesn't have a version number, but is distributed along with RDF::TrineShortcuts, so could be considered to have the same version number as that.
trapper can be used as a shebang line of a Turtle or N-Triples file. e.g.:
#!/usr/local/bin/trapper OPTS: -i turtle -o rdfxml @prefix foaf: <http://xmlns.com/foaf/0.1/> . [] a foaf:Person ; foaf:name "Toby Inkster" .
Note that you need the "OPTS:" bit to pass command-line options. This is a workaround for a limitation in Linux's shebang handling.
When possible, trapper attempts to use the same command-line options as the 'rapper' tool that is distributed with libraptor. However, full compatibility with rapper is not a goal, and is certainly not guaranteed.
A trapper is a person who catches animals, usually for fur.
Toby Inkster, <tobyink@cpan.org>
Copyright (C) 2010 by Toby Inkster
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8 or, at your option, any later version of Perl 5 you may have available.
To install RDF::TrineShortcuts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::TrineShortcuts
CPAN shell
perl -MCPAN -e shell install RDF::TrineShortcuts
For more information on module installation, please visit the detailed CPAN module installation guide.