#!/usr/bin/perl
#ABSTRACT: quickly get common URI namespaces
#PODNAME: rdfns

use strict;
use warnings;

use RDF::NS;
my $format = 'txt';
my $version = 'any';

if (!@ARGV or $ARGV[0] =~ /^(-[?h]|--help)$/) {
     print <DATA>;
     exit;
}

while (@ARGV and $ARGV[0] =~ /^-(.+)$/) {
     if ($1 =~ /^(ttl|n(otation)?3|sparql|xmlns|txt)$/i) {
         $format = $1;
     } elsif ($1 =~ /^(\d{8})$/) {
	     $version = $1;
     } else {
         print STDERR "Unknown option ".$ARGV[0]."\n";
     }
     shift @ARGV;
}

print map {"$_\n"} RDF::NS->new($version)->FORMAT( $format, @ARGV );



=pod

=head1 NAME

rdfns - quickly get common URI namespaces

=head1 VERSION

version 20111102

=head1 AUTHOR

Jakob Voss

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Jakob Voss.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.

=cut


__DATA__
USAGE: rdfns [format] [-YYYYMMDD] <prefix[es]>

  formats: -txt, -sparql, -ttl, -n3, -xmlns

