CONTRIBUTING 000664 001750 001750 6146 12405262061 14331 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 NAME
CONTRIBUTING
DESCRIPTION
If you're reading this document, that means you might be thinking about
helping me out with this project. Thanks!
Here's some ways you could help out:
* Bug reports
Found a bug? Great! (Well, not so great I suppose.)
The place to report them is . Don't e-mail me
about it, as your e-mail is more than likely to get lost amongst the
spam.
An example script clearly demonstrating the bug (preferably written
using Test::More) would be greatly appreciated.
* Patches
If you've found a bug and written a fix for it, even better!
Generally speaking you should check out the latest copy of the code
from the source repository rather than using the CPAN distribution.
The file META.yml should contain a link to the source repository. If
not, then try or submit a bug report.
(As far as I'm concerned the lack of a link is a bug.) Many of my
distributions are also mirrored at .
To submit the patch, do a pull request on GitHub or Bitbucket, or
attach a diff file to a bug report. Unless otherwise stated, I'll
assume that your contributions are licensed under the same terms as
the rest of the project.
(If using git, feel free to work in a branch. For Mercurial, I'd
prefer bookmarks within the default branch.)
* Documentation
If there's anything unclear in the documentation, please submit this
as a bug report or patch as above.
Non-toy example scripts that I can bundle would also be appreciated.
* Translation
Translations of documentation would be welcome.
For translations of error messages and other strings embedded in the
code, check with me first. Sometimes the English strings may not in
a stable state, so it would be a waste of time translating them.
Coding Style
I tend to write using something approximating the Allman style, using
tabs for indentation and Unix-style line breaks.
*
*
I nominally encode all source files as UTF-8, though in practice most of
them use a 7-bit-safe ASCII-compatible subset of UTF-8.
AUTHOR
Toby Inkster .
COPYRIGHT AND LICENCE
Copyright (c) 2012-2014 by Toby Inkster.
CONTRIBUTING is available under three different licences permitting its
redistribution: the CC-BY-SA_UK-2.0 licence, plus the same licences as
Perl itself, which is distributed under the GNU General Public Licence
version 1, and the Artistic Licence.
This file is licensed under the Creative Commons Attribution-ShareAlike
2.0 UK: England & Wales License. To view a copy of this license, visit
.
This file is free software; you can redistribute it and/or modify it
under the same terms as the Perl 5 programming language system itself.
COPYRIGHT 000664 001750 001750 3672 12405262061 13773 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: App-perlrdf
Upstream-Contact: Toby Inkster (TOBYINK)
Source: https://metacpan.org/release/App-perlrdf
Files: Changes
META.json
META.yml
dist.ini
doap.ttl
lib/App/perlrdf/Command.pm
lib/App/perlrdf/Command/About.pm
lib/App/perlrdf/Command/Aliases.pm
lib/App/perlrdf/Command/Canonicalize.pm
lib/App/perlrdf/Command/Commands.pm
lib/App/perlrdf/Command/FileSpec.pm
lib/App/perlrdf/Command/Isomorphic.pm
lib/App/perlrdf/Command/MakeStore.pm
lib/App/perlrdf/Command/Prefix.pm
lib/App/perlrdf/Command/StoreDescribe.pm
lib/App/perlrdf/Command/StoreDump.pm
lib/App/perlrdf/Command/StoreLoad.pm
lib/App/perlrdf/Command/StoreTruncate.pm
lib/App/perlrdf/Command/Translate.pm
lib/App/perlrdf/Command/Validate.pm
lib/App/perlrdf/DummyModel.pm
lib/App/perlrdf/FileSpec.pm
lib/App/perlrdf/FileSpec/InputFile.pm
lib/App/perlrdf/FileSpec/InputRDF.pm
lib/App/perlrdf/FileSpec/OutputFile.pm
lib/App/perlrdf/FileSpec/OutputRDF.pm
Copyright: Copyright 2014 Toby Inkster.
License: GPL-1.0+ or Artistic-1.0
Files: CONTRIBUTING
INSTALL
LICENSE
TODO
Copyright: Unknown
License: Unknown
Files: bin/perlrdf
t/01basic.t
t/02translate.t
Copyright: Copyright 2012 Toby Inkster.
License: GPL-1.0+ or Artistic-1.0
Files: COPYRIGHT
CREDITS
SIGNATURE
Copyright: None
License: public-domain
Files: README
lib/App/perlrdf.pm
Copyright: This software is copyright (c) 2012-2014 by Toby Inkster.
License: GPL-1.0+ or Artistic-1.0
Files: Makefile.PL
Copyright: Copyright 2013 Toby Inkster.
License: GPL-1.0+ or Artistic-1.0
License: Artistic-1.0
This software is Copyright (c) 2014 by the copyright holder(s).
This is free software, licensed under:
The Artistic License 1.0
License: GPL-1.0
This software is Copyright (c) 2014 by the copyright holder(s).
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
CREDITS 000664 001750 001750 71 12405262057 13453 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 Maintainer:
- Toby Inkster (TOBYINK)
Changes 000664 001750 001750 1617 12405262057 13775 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 App-perlrdf
===========
Created: 2012-07-08
Home page:
Bug tracker:
Maintainer: Toby Inkster (TOBYINK)
0.006 2014-09-14
[ Packaging ]
- Add repo link.
0.005 2014-09-14
[ Packaging ]
- Switch to Dist::Inkt.
[ Other ]
- Drop final usage of smartmatch in favour of match::simple.
- No longer require Object::AUTHORITY.
0.004 2013-07-04
- Removed: Dropped the `-p` shorthand for the `--password` option because
it conflicts with another shorthand.
- Updated: Eliminate smartmatch/given/when (except in one module where it
will continue to be used for a short time).
0.003 2012-12-15
- Updated: Switch from Any::Moose to Moose.
0.002 2012-12-12 Day of the Dozens!
[ Packaging ]
- Add IO::Scalar dependency.
0.001 2012-07-22 Initial release: happy pi day!
INSTALL 000664 001750 001750 1665 12405262057 13536 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 Installing App-perlrdf should be straightforward.
INSTALLATION WITH CPANMINUS
If you have cpanm, you only need one line:
% cpanm App::perlrdf
If you are installing into a system-wide directory, you may need to pass
the "-S" flag to cpanm, which uses sudo to install the module:
% cpanm -S App::perlrdf
INSTALLATION WITH THE CPAN SHELL
Alternatively, if your CPAN shell is set up, you should just be able to
do:
% cpan App::perlrdf
MANUAL INSTALLATION
As a last resort, you can manually install it. Download the tarball and
unpack it.
Consult the file META.json for a list of pre-requisites. Install these
first.
To build App-perlrdf:
% perl Makefile.PL
% make && make test
Then install it:
% make install
If you are installing into a system-wide directory, you may need to run:
% sudo make install
LICENSE 000664 001750 001750 43655 12405262057 13537 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 This software is copyright (c) 2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2014 by Toby Inkster.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2014 by Toby Inkster.
This is free software, licensed under:
The Artistic License 1.0
The Artistic License
Preamble
The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of
the package the right to use and distribute the Package in a more-or-less
customary fashion, plus the right to make reasonable modifications.
Definitions:
- "Package" refers to the collection of files distributed by the Copyright
Holder, and derivatives of that collection of files created through
textual modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of media
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major archive site
such as ftp.uu.net, or by allowing the Copyright Holder to include your
modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide a separate
manual page for each non-standard executable that clearly documents how it
differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where to
get the Standard Version.
b) accompany the distribution with the machine-readable source of the Package
with your modifications.
c) accompany any non-standard executables with their corresponding Standard
Version executables, giving the non-standard executables non-standard
names, and clearly documenting the differences in manual pages (or
equivalent), together with instructions on where to get the Standard
Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this
Package in aggregate with other (possibly commercial) programs as part of a
larger (possibly commercial) software distribution provided that you do not
advertise this Package as a product of your own.
6. The scripts and library files supplied as input to or produced as output
from the programs of this Package do not automatically fall under the copyright
of this Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.
7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.
8. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
MANIFEST 000664 001750 001750 1665 12405262062 13632 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 CONTRIBUTING
COPYRIGHT
CREDITS
Changes
INSTALL
LICENSE
MANIFEST
META.json
META.yml
Makefile.PL
README
SIGNATURE
TODO
bin/perlrdf
dist.ini
doap.ttl
lib/App/perlrdf.pm
lib/App/perlrdf/Command.pm
lib/App/perlrdf/Command/About.pm
lib/App/perlrdf/Command/Aliases.pm
lib/App/perlrdf/Command/Canonicalize.pm
lib/App/perlrdf/Command/Commands.pm
lib/App/perlrdf/Command/FileSpec.pm
lib/App/perlrdf/Command/Isomorphic.pm
lib/App/perlrdf/Command/MakeStore.pm
lib/App/perlrdf/Command/Prefix.pm
lib/App/perlrdf/Command/StoreDescribe.pm
lib/App/perlrdf/Command/StoreDump.pm
lib/App/perlrdf/Command/StoreLoad.pm
lib/App/perlrdf/Command/StoreTruncate.pm
lib/App/perlrdf/Command/Translate.pm
lib/App/perlrdf/Command/Validate.pm
lib/App/perlrdf/DummyModel.pm
lib/App/perlrdf/FileSpec.pm
lib/App/perlrdf/FileSpec/InputFile.pm
lib/App/perlrdf/FileSpec/InputRDF.pm
lib/App/perlrdf/FileSpec/OutputFile.pm
lib/App/perlrdf/FileSpec/OutputRDF.pm
t/01basic.t
t/02translate.t
META.json 000664 001750 001750 12561 12405262061 14136 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 {
"abstract" : "perlrdf command line utils",
"author" : [
"Toby Inkster (TOBYINK) "
],
"dynamic_config" : 0,
"generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640",
"keywords" : [],
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2"
},
"name" : "App-perlrdf",
"no_index" : {
"directory" : [
"eg",
"examples",
"inc",
"t",
"xt"
]
},
"optional_features" : {},
"prereqs" : {
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "6.17"
}
},
"runtime" : {
"recommends" : {
"App::perlrdf::Command::Query" : "0",
"App::perlrdf::Command::Void" : "0"
},
"requires" : {
"App::Cmd" : "0",
"App::Cmd::Plugin::Prompt" : "0",
"Data::UUID" : "0",
"IO::Scalar" : "0",
"JSON" : "2.00",
"LWP::UserAgent" : "0",
"Moose" : "0",
"Path::Class" : "0",
"PerlX::Maybe" : "0",
"RDF::NS" : "0",
"RDF::TriN3" : "0",
"RDF::Trine" : "0",
"RDF::TrineX::Functions" : "0.004",
"RDF::TrineX::Parser::Pretdsl" : "0",
"RDF::TrineX::Parser::RDFa" : "0",
"URI" : "0",
"URI::file" : "0",
"match::simple" : "0",
"namespace::clean" : "0"
}
},
"test" : {
"requires" : {
"Test::Exception" : "0",
"Test::More" : "0.61",
"Test::RDF" : "1.00"
}
}
},
"provides" : {
"App::perlrdf" : {
"file" : "lib/App/perlrdf.pm",
"version" : "0.006"
},
"App::perlrdf::Command" : {
"file" : "lib/App/perlrdf/Command.pm",
"version" : "0.006"
},
"App::perlrdf::Command::About" : {
"file" : "lib/App/perlrdf/Command/About.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Aliases" : {
"file" : "lib/App/perlrdf/Command/Aliases.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Canonicalize" : {
"file" : "lib/App/perlrdf/Command/Canonicalize.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Commands" : {
"file" : "lib/App/perlrdf/Command/Commands.pm",
"version" : "0.006"
},
"App::perlrdf::Command::FileSpec" : {
"file" : "lib/App/perlrdf/Command/FileSpec.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Isomorphic" : {
"file" : "lib/App/perlrdf/Command/Isomorphic.pm",
"version" : "0.006"
},
"App::perlrdf::Command::MakeStore" : {
"file" : "lib/App/perlrdf/Command/MakeStore.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Prefix" : {
"file" : "lib/App/perlrdf/Command/Prefix.pm",
"version" : "0.006"
},
"App::perlrdf::Command::StoreDescribe" : {
"file" : "lib/App/perlrdf/Command/StoreDescribe.pm",
"version" : "0.006"
},
"App::perlrdf::Command::StoreDump" : {
"file" : "lib/App/perlrdf/Command/StoreDump.pm",
"version" : "0.006"
},
"App::perlrdf::Command::StoreLoad" : {
"file" : "lib/App/perlrdf/Command/StoreLoad.pm",
"version" : "0.006"
},
"App::perlrdf::Command::StoreTruncate" : {
"file" : "lib/App/perlrdf/Command/StoreTruncate.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Translate" : {
"file" : "lib/App/perlrdf/Command/Translate.pm",
"version" : "0.006"
},
"App::perlrdf::Command::Validate" : {
"file" : "lib/App/perlrdf/Command/Validate.pm",
"version" : "0.006"
},
"App::perlrdf::DummyModel" : {
"file" : "lib/App/perlrdf/DummyModel.pm",
"version" : "0.006"
},
"App::perlrdf::FileSpec" : {
"file" : "lib/App/perlrdf/FileSpec.pm",
"version" : "0.006"
},
"App::perlrdf::FileSpec::InputFile" : {
"file" : "lib/App/perlrdf/FileSpec/InputFile.pm",
"version" : "0.006"
},
"App::perlrdf::FileSpec::InputRDF" : {
"file" : "lib/App/perlrdf/FileSpec/InputRDF.pm",
"version" : "0.006"
},
"App::perlrdf::FileSpec::OutputFile" : {
"file" : "lib/App/perlrdf/FileSpec/OutputFile.pm",
"version" : "0.006"
},
"App::perlrdf::FileSpec::OutputRDF" : {
"file" : "lib/App/perlrdf/FileSpec/OutputRDF.pm",
"version" : "0.006"
}
},
"release_status" : "stable",
"resources" : {
"bugtracker" : {
"web" : "http://rt.cpan.org/Dist/Display.html?Queue=App-perlrdf"
},
"homepage" : "https://metacpan.org/release/App-perlrdf",
"license" : [
"http://dev.perl.org/licenses/"
],
"repository" : {
"type" : "git",
"url" : "git://github.com/tobyink/p5-app-perlrdf.git",
"web" : "https://github.com/tobyink/p5-app-perlrdf"
},
"x_identifier" : "http://purl.org/NET/cpan-uri/dist/App-perlrdf/project"
},
"version" : "0.006",
"x_provides_scripts" : {
"perlrdf" : {
"file" : "bin/perlrdf"
}
}
}
META.yml 000664 001750 001750 7106 12405262061 13745 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 ---
abstract: 'perlrdf command line utils'
author:
- 'Toby Inkster (TOBYINK) '
build_requires:
Test::Exception: '0'
Test::More: '0.61'
Test::RDF: '1.00'
configure_requires:
ExtUtils::MakeMaker: '6.17'
dynamic_config: 0
generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640'
keywords: []
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: App-perlrdf
no_index:
directory:
- eg
- examples
- inc
- t
- xt
optional_features: {}
provides:
App::perlrdf:
file: lib/App/perlrdf.pm
version: '0.006'
App::perlrdf::Command:
file: lib/App/perlrdf/Command.pm
version: '0.006'
App::perlrdf::Command::About:
file: lib/App/perlrdf/Command/About.pm
version: '0.006'
App::perlrdf::Command::Aliases:
file: lib/App/perlrdf/Command/Aliases.pm
version: '0.006'
App::perlrdf::Command::Canonicalize:
file: lib/App/perlrdf/Command/Canonicalize.pm
version: '0.006'
App::perlrdf::Command::Commands:
file: lib/App/perlrdf/Command/Commands.pm
version: '0.006'
App::perlrdf::Command::FileSpec:
file: lib/App/perlrdf/Command/FileSpec.pm
version: '0.006'
App::perlrdf::Command::Isomorphic:
file: lib/App/perlrdf/Command/Isomorphic.pm
version: '0.006'
App::perlrdf::Command::MakeStore:
file: lib/App/perlrdf/Command/MakeStore.pm
version: '0.006'
App::perlrdf::Command::Prefix:
file: lib/App/perlrdf/Command/Prefix.pm
version: '0.006'
App::perlrdf::Command::StoreDescribe:
file: lib/App/perlrdf/Command/StoreDescribe.pm
version: '0.006'
App::perlrdf::Command::StoreDump:
file: lib/App/perlrdf/Command/StoreDump.pm
version: '0.006'
App::perlrdf::Command::StoreLoad:
file: lib/App/perlrdf/Command/StoreLoad.pm
version: '0.006'
App::perlrdf::Command::StoreTruncate:
file: lib/App/perlrdf/Command/StoreTruncate.pm
version: '0.006'
App::perlrdf::Command::Translate:
file: lib/App/perlrdf/Command/Translate.pm
version: '0.006'
App::perlrdf::Command::Validate:
file: lib/App/perlrdf/Command/Validate.pm
version: '0.006'
App::perlrdf::DummyModel:
file: lib/App/perlrdf/DummyModel.pm
version: '0.006'
App::perlrdf::FileSpec:
file: lib/App/perlrdf/FileSpec.pm
version: '0.006'
App::perlrdf::FileSpec::InputFile:
file: lib/App/perlrdf/FileSpec/InputFile.pm
version: '0.006'
App::perlrdf::FileSpec::InputRDF:
file: lib/App/perlrdf/FileSpec/InputRDF.pm
version: '0.006'
App::perlrdf::FileSpec::OutputFile:
file: lib/App/perlrdf/FileSpec/OutputFile.pm
version: '0.006'
App::perlrdf::FileSpec::OutputRDF:
file: lib/App/perlrdf/FileSpec/OutputRDF.pm
version: '0.006'
recommends:
App::perlrdf::Command::Query: '0'
App::perlrdf::Command::Void: '0'
requires:
App::Cmd: '0'
App::Cmd::Plugin::Prompt: '0'
Data::UUID: '0'
IO::Scalar: '0'
JSON: '2.00'
LWP::UserAgent: '0'
Moose: '0'
Path::Class: '0'
PerlX::Maybe: '0'
RDF::NS: '0'
RDF::TriN3: '0'
RDF::Trine: '0'
RDF::TrineX::Functions: '0.004'
RDF::TrineX::Parser::Pretdsl: '0'
RDF::TrineX::Parser::RDFa: '0'
URI: '0'
URI::file: '0'
match::simple: '0'
namespace::clean: '0'
resources:
Identifier: http://purl.org/NET/cpan-uri/dist/App-perlrdf/project
bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=App-perlrdf
homepage: https://metacpan.org/release/App-perlrdf
license: http://dev.perl.org/licenses/
repository: git://github.com/tobyink/p5-app-perlrdf.git
version: '0.006'
x_provides_scripts:
perlrdf:
file: bin/perlrdf
Makefile.PL 000664 001750 001750 24025 12405262061 14465 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 use strict;
use ExtUtils::MakeMaker 6.17;
my $EUMM = eval( $ExtUtils::MakeMaker::VERSION );
my $meta = {
"abstract" => "perlrdf command line utils",
"author" => ["Toby Inkster (TOBYINK) "],
"dynamic_config" => 0,
"generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.016, CPAN::Meta::Converter version 2.140640",
"keywords" => [],
"license" => ["perl_5"],
"meta-spec" => {
url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
version => 2,
},
"name" => "App-perlrdf",
"no_index" => { directory => ["eg", "examples", "inc", "t", "xt"] },
"prereqs" => {
configure => { requires => { "ExtUtils::MakeMaker" => 6.17 } },
runtime => {
recommends => {
"App::perlrdf::Command::Query" => 0,
"App::perlrdf::Command::Void" => 0,
},
requires => {
"App::Cmd" => 0,
"App::Cmd::Plugin::Prompt" => 0,
"Data::UUID" => 0,
"IO::Scalar" => 0,
"JSON" => "2.00",
"LWP::UserAgent" => 0,
"match::simple" => 0,
"Moose" => 0,
"namespace::clean" => 0,
"Path::Class" => 0,
"PerlX::Maybe" => 0,
"RDF::NS" => 0,
"RDF::TriN3" => 0,
"RDF::Trine" => 0,
"RDF::TrineX::Functions" => 0.004,
"RDF::TrineX::Parser::Pretdsl" => 0,
"RDF::TrineX::Parser::RDFa" => 0,
"URI" => 0,
"URI::file" => 0,
},
},
test => {
requires => { "Test::Exception" => 0, "Test::More" => 0.61, "Test::RDF" => "1.00" },
},
},
"provides" => {
"App::perlrdf" => { file => "lib/App/perlrdf.pm", version => 0.006 },
"App::perlrdf::Command" => { file => "lib/App/perlrdf/Command.pm", version => 0.006 },
"App::perlrdf::Command::About" => { file => "lib/App/perlrdf/Command/About.pm", version => 0.006 },
"App::perlrdf::Command::Aliases" => { file => "lib/App/perlrdf/Command/Aliases.pm", version => 0.006 },
"App::perlrdf::Command::Canonicalize" => { file => "lib/App/perlrdf/Command/Canonicalize.pm", version => 0.006 },
"App::perlrdf::Command::Commands" => { file => "lib/App/perlrdf/Command/Commands.pm", version => 0.006 },
"App::perlrdf::Command::FileSpec" => { file => "lib/App/perlrdf/Command/FileSpec.pm", version => 0.006 },
"App::perlrdf::Command::Isomorphic" => { file => "lib/App/perlrdf/Command/Isomorphic.pm", version => 0.006 },
"App::perlrdf::Command::MakeStore" => { file => "lib/App/perlrdf/Command/MakeStore.pm", version => 0.006 },
"App::perlrdf::Command::Prefix" => { file => "lib/App/perlrdf/Command/Prefix.pm", version => 0.006 },
"App::perlrdf::Command::StoreDescribe" => {
file => "lib/App/perlrdf/Command/StoreDescribe.pm",
version => 0.006,
},
"App::perlrdf::Command::StoreDump" => { file => "lib/App/perlrdf/Command/StoreDump.pm", version => 0.006 },
"App::perlrdf::Command::StoreLoad" => { file => "lib/App/perlrdf/Command/StoreLoad.pm", version => 0.006 },
"App::perlrdf::Command::StoreTruncate" => {
file => "lib/App/perlrdf/Command/StoreTruncate.pm",
version => 0.006,
},
"App::perlrdf::Command::Translate" => { file => "lib/App/perlrdf/Command/Translate.pm", version => 0.006 },
"App::perlrdf::Command::Validate" => { file => "lib/App/perlrdf/Command/Validate.pm", version => 0.006 },
"App::perlrdf::DummyModel" => { file => "lib/App/perlrdf/DummyModel.pm", version => 0.006 },
"App::perlrdf::FileSpec" => { file => "lib/App/perlrdf/FileSpec.pm", version => 0.006 },
"App::perlrdf::FileSpec::InputFile" => { file => "lib/App/perlrdf/FileSpec/InputFile.pm", version => 0.006 },
"App::perlrdf::FileSpec::InputRDF" => { file => "lib/App/perlrdf/FileSpec/InputRDF.pm", version => 0.006 },
"App::perlrdf::FileSpec::OutputFile" => { file => "lib/App/perlrdf/FileSpec/OutputFile.pm", version => 0.006 },
"App::perlrdf::FileSpec::OutputRDF" => { file => "lib/App/perlrdf/FileSpec/OutputRDF.pm", version => 0.006 },
},
"release_status" => "stable",
"resources" => {
bugtracker => { web => "http://rt.cpan.org/Dist/Display.html?Queue=App-perlrdf" },
homepage => "https://metacpan.org/release/App-perlrdf",
license => ["http://dev.perl.org/licenses/"],
repository => {
type => "git",
url => "git://github.com/tobyink/p5-app-perlrdf.git",
web => "https://github.com/tobyink/p5-app-perlrdf",
},
x_identifier => "http://purl.org/NET/cpan-uri/dist/App-perlrdf/project",
},
"version" => 0.006,
"x_provides_scripts" => { perlrdf => { file => "bin/perlrdf" } },
};
my %dynamic_config;
my %WriteMakefileArgs = (
ABSTRACT => $meta->{abstract},
AUTHOR => ($EUMM >= 6.5702 ? $meta->{author} : $meta->{author}[0]),
DISTNAME => $meta->{name},
VERSION => $meta->{version},
EXE_FILES => [ map $_->{file}, values %{ $meta->{x_provides_scripts} || {} } ],
NAME => do { my $n = $meta->{name}; $n =~ s/-/::/g; $n },
test => { TESTS => "t/*.t" },
%dynamic_config,
);
$WriteMakefileArgs{LICENSE} = $meta->{license}[0] if $EUMM >= 6.3001;
sub deps
{
my %r;
for my $stage (@_)
{
for my $dep (keys %{$meta->{prereqs}{$stage}{requires}})
{
next if $dep eq 'perl';
my $ver = $meta->{prereqs}{$stage}{requires}{$dep};
$r{$dep} = $ver if !exists($r{$dep}) || $ver >= $r{$dep};
}
}
\%r;
}
my ($build_requires, $configure_requires, $runtime_requires, $test_requires);
if ($EUMM >= 6.6303)
{
$WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build');
$WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure');
$WriteMakefileArgs{TEST_REQUIRES} ||= deps('test');
$WriteMakefileArgs{PREREQ_PM} ||= deps('runtime');
}
elsif ($EUMM >= 6.5503)
{
$WriteMakefileArgs{BUILD_REQUIRES} ||= deps('build', 'test');
$WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure');
$WriteMakefileArgs{PREREQ_PM} ||= deps('runtime');
}
elsif ($EUMM >= 6.52)
{
$WriteMakefileArgs{CONFIGURE_REQUIRES} ||= deps('configure');
$WriteMakefileArgs{PREREQ_PM} ||= deps('runtime', 'build', 'test');
}
else
{
$WriteMakefileArgs{PREREQ_PM} ||= deps('configure', 'build', 'test', 'runtime');
}
{
my ($minperl) = reverse sort(
grep defined && /^[0-9]+(\.[0-9]+)?$/,
map $meta->{prereqs}{$_}{requires}{perl},
qw( configure build runtime )
);
if (defined($minperl))
{
die "Installing $meta->{name} requires Perl >= $minperl"
unless $] >= $minperl;
$WriteMakefileArgs{MIN_PERL_VERSION} ||= $minperl
if $EUMM >= 6.48;
}
}
sub FixMakefile
{
return unless -d 'inc';
my $file = shift;
local *MAKEFILE;
open MAKEFILE, "< $file" or die "FixMakefile: Couldn't open $file: $!; bailing out";
my $makefile = do { local $/; };
close MAKEFILE or die $!;
$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
$makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
$makefile =~ s/^(FULLPERL = .*)/$1 "-Iinc"/m;
$makefile =~ s/^(PERL = .*)/$1 "-Iinc"/m;
open MAKEFILE, "> $file" or die "FixMakefile: Couldn't open $file: $!; bailing out";
print MAKEFILE $makefile or die $!;
close MAKEFILE or die $!;
}
my $mm = WriteMakefile(%WriteMakefileArgs);
FixMakefile($mm->{FIRST_MAKEFILE} || 'Makefile');
exit(0);
README 000664 001750 001750 1350 12405262057 13354 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 NAME
App::perlrdf - perlrdf command line utils
DESCRIPTION
Support library for the perlrdf command-line tool.
BUGS
Please report any bugs to
.
SEE ALSO
perlrdf.
AUTHOR
Toby Inkster .
COPYRIGHT AND LICENCE
This software is copyright (c) 2012-2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the
same terms as the Perl 5 programming language system itself.
DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
SIGNATURE 000664 001750 001750 6570 12405262062 13765 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 This file contains message digests of all files listed in MANIFEST,
signed via the Module::Signature module, version 0.73.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
% cpansign -v
It will check each file's integrity, as well as the signature's
validity. If "==> Signature verified OK! <==" is not displayed,
the distribution may already have been compromised, and you should
not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SHA1 33317486c4fa2cf7fec85bf92ed38ac0f64233a0 CONTRIBUTING
SHA1 d3d7ab04266912e19174b4ae826a6810b4063341 COPYRIGHT
SHA1 6bd7b17d81be63d08d4efa6cb80106e72887842c CREDITS
SHA1 ea0ec24a77a8b4a865c0ecb1bf76742aaf140da1 Changes
SHA1 172c944de69eb2f47cab33001a43178d533a13d3 INSTALL
SHA1 34f5e12514b91055de4b164a1f2327ef5c30ba53 LICENSE
SHA1 69119a321fbf07aa886d3764bc5e5c6b80e826a5 MANIFEST
SHA1 dd8dac3c3ef4a298574bb20b7e4c91f9480a0c9f META.json
SHA1 84ce15f83d7be8046c63c905fe910172e7319fce META.yml
SHA1 8e3ecc29bcf9b4b519a1d20a06ed93702176de05 Makefile.PL
SHA1 c6ee2def3893c22f06f2fe08547de41cb5cc74e1 README
SHA1 a001add01ab487da8096acefe5259d1586c2f409 TODO
SHA1 d718b7bae6895cd40bc514a91de615457df87b74 bin/perlrdf
SHA1 3e3947b454d7e706c1e9e2769643b99ec2fcbd0a dist.ini
SHA1 188a13d6580929f50725a559cdf8d57655d3da60 doap.ttl
SHA1 fb4cabda06ca23fb619ab4c83e4436c1bd880c2d lib/App/perlrdf.pm
SHA1 61575d7c7beee57f4fe81907580604a9e5efd966 lib/App/perlrdf/Command.pm
SHA1 dd214b91201bd6ffebed41e1463e9dbe88aa0b6a lib/App/perlrdf/Command/About.pm
SHA1 5b7ace53562f99bee6e5ed9d515261e7d6440de5 lib/App/perlrdf/Command/Aliases.pm
SHA1 36bdc5b66c9365571cd3c87be0523f25a6b53fe2 lib/App/perlrdf/Command/Canonicalize.pm
SHA1 6122d192d1fa844faa384f7316cafa3a3913cf74 lib/App/perlrdf/Command/Commands.pm
SHA1 c55ddcaccd2a3eabb8d53527e0a1cd9ae83d0860 lib/App/perlrdf/Command/FileSpec.pm
SHA1 d6b0663937c79f94abb7dbe1b904861c2cf350f5 lib/App/perlrdf/Command/Isomorphic.pm
SHA1 a4cd516ba13d219785f991d7c27c02e687fc1cd4 lib/App/perlrdf/Command/MakeStore.pm
SHA1 f1bf3d93f1637c16c4228b20c4e1bef05ddb4dda lib/App/perlrdf/Command/Prefix.pm
SHA1 ffb21803824d32400aa8e27ec312dbf39e2e1eb0 lib/App/perlrdf/Command/StoreDescribe.pm
SHA1 7d2e23ba452c87644f99a9364a713d89dc8e9530 lib/App/perlrdf/Command/StoreDump.pm
SHA1 51c68c1bf3412fceebc6db7f5088ad39c825767b lib/App/perlrdf/Command/StoreLoad.pm
SHA1 9d887cfbebefb857157b7ab76b62e4304d08c1a7 lib/App/perlrdf/Command/StoreTruncate.pm
SHA1 5eee9793274c63eef7a06aa9d2133daf5db3d442 lib/App/perlrdf/Command/Translate.pm
SHA1 019edd7479827a5ce34f4bcebef1d2f32e17597d lib/App/perlrdf/Command/Validate.pm
SHA1 c53fed5353f055d8071d36a7a906b891300a1964 lib/App/perlrdf/DummyModel.pm
SHA1 72a2c58bad86ac50518eacb406ad394d7ae681dd lib/App/perlrdf/FileSpec.pm
SHA1 197a1ac919225cfc96d9bc73bf947b98bd47c773 lib/App/perlrdf/FileSpec/InputFile.pm
SHA1 e825f3bcd7ddbc9ae740389d9b3fe80c74255797 lib/App/perlrdf/FileSpec/InputRDF.pm
SHA1 bc2f37a861059dd6fbb407d19c1c8937b5c40475 lib/App/perlrdf/FileSpec/OutputFile.pm
SHA1 a08554d75585dc16d5ded889c944a93cc31af6a0 lib/App/perlrdf/FileSpec/OutputRDF.pm
SHA1 a80384ed5585861df9f1bcbd1a812de36eb42a21 t/01basic.t
SHA1 6241e55ff9b8eb12e239edfd8c6e8f09a905a878 t/02translate.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEYEARECAAYFAlQVZDIACgkQzr+BKGoqfTnPnACeOcm1x9WLne1rtRwi3uT7z86j
Pg8An3PBH/+y0gK4V9Hgj/1aFcRyZOdt
=XlCG
-----END PGP SIGNATURE-----
TODO 000664 001750 001750 163 12405262056 13144 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 Another release...
- generate RSA keys
- sign RDF
- verify RDF
- encrypt RDF
- decrypt RDF
- sign/verify manifest
dist.ini 000664 001750 001750 74 12405262056 14101 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 ;;class='Dist::Inkt::Profile::TOBYINK'
;;name='App-perlrdf'
doap.ttl 000664 001750 001750 15671 12405262061 14172 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006 @prefix dc: .
@prefix doap: .
@prefix doap-changeset: .
@prefix doap-deps: .
@prefix foaf: .
@prefix rdfs: .
@prefix xsd: .
dc:title "the same terms as the perl 5 programming language system itself".
a doap:Project;
dc:contributor ;
doap-deps:runtime-recommendation [
doap-deps:on "App::perlrdf::Command::Query"^^doap-deps:CpanId;
], [
doap-deps:on "App::perlrdf::Command::Void"^^doap-deps:CpanId;
];
doap-deps:runtime-requirement [ doap-deps:on "Path::Class"^^doap-deps:CpanId ], [ doap-deps:on "PerlX::Maybe"^^doap-deps:CpanId ], [ doap-deps:on "RDF::NS"^^doap-deps:CpanId ], [ doap-deps:on "RDF::TriN3"^^doap-deps:CpanId ], [ doap-deps:on "RDF::Trine"^^doap-deps:CpanId ], [
doap-deps:on "RDF::TrineX::Functions 0.004"^^doap-deps:CpanId;
], [
doap-deps:on "RDF::TrineX::Parser::Pretdsl"^^doap-deps:CpanId;
], [
doap-deps:on "RDF::TrineX::Parser::RDFa"^^doap-deps:CpanId;
], [ doap-deps:on "URI"^^doap-deps:CpanId ], [ doap-deps:on "URI::file"^^doap-deps:CpanId ], [ doap-deps:on "App::Cmd"^^doap-deps:CpanId ], [ doap-deps:on "Moose"^^doap-deps:CpanId ], [
doap-deps:on "App::Cmd::Plugin::Prompt"^^doap-deps:CpanId;
], [ doap-deps:on "Data::UUID"^^doap-deps:CpanId ], [ doap-deps:on "IO::Scalar"^^doap-deps:CpanId ], [ doap-deps:on "JSON 2.00"^^doap-deps:CpanId ], [ doap-deps:on "LWP::UserAgent"^^doap-deps:CpanId ], [ doap-deps:on "match::simple"^^doap-deps:CpanId ], [ doap-deps:on "namespace::clean"^^doap-deps:CpanId ];
doap-deps:test-requirement [ doap-deps:on "Test::More 0.61"^^doap-deps:CpanId ], [ doap-deps:on "Test::Exception"^^doap-deps:CpanId ], [ doap-deps:on "Test::RDF 1.00"^^doap-deps:CpanId ];
doap:bug-database ;
doap:created "2012-07-08"^^xsd:date;
doap:developer ;
doap:download-page ;
doap:homepage ;
doap:license ;
doap:maintainer ;
doap:name "App-perlrdf";
doap:programming-language "Perl";
doap:release , , , , , ;
doap:repository [
a doap:GitRepository;
doap:browse ;
];
doap:shortdesc "perlrdf command line utils".
a doap:Version;
rdfs:label "Initial release: happy pi day!";
dc:identifier "App-perlrdf-0.001"^^xsd:string;
dc:issued "2012-07-22"^^xsd:date;
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.001"^^xsd:string;
rdfs:comment "22/7 is a closer approximation to pi than 3.14.".
a doap:Version;
rdfs:label "Day of the Dozens!";
dc:identifier "App-perlrdf-0.002"^^xsd:string;
dc:issued "2012-12-12"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Packaging;
rdfs:label "Add IO::Scalar dependency.";
];
];
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.002"^^xsd:string.
a doap:Version;
dc:identifier "App-perlrdf-0.003"^^xsd:string;
dc:issued "2012-12-15"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Update;
rdfs:label "Switch from Any::Moose to Moose.";
];
];
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.003"^^xsd:string.
a doap:Version;
dc:identifier "App-perlrdf-0.004"^^xsd:string;
dc:issued "2013-07-04"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Update;
rdfs:label "Eliminate smartmatch/given/when (except in one module where it will continue to be used for a short time).";
], [
a doap-changeset:Removal;
rdfs:label "Dropped the `-p` shorthand for the `--password` option because it conflicts with another shorthand.";
];
];
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.004"^^xsd:string.
a doap:Version;
dc:identifier "App-perlrdf-0.005"^^xsd:string;
dc:issued "2014-09-14"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Change;
rdfs:label "No longer require Object::AUTHORITY.";
], [
a doap-changeset:Change;
rdfs:label "Drop final usage of smartmatch in favour of match::simple.";
], [
a doap-changeset:Packaging;
rdfs:label "Switch to Dist::Inkt.";
];
];
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.005"^^xsd:string.
a doap:Version;
dc:identifier "App-perlrdf-0.006"^^xsd:string;
dc:issued "2014-09-14"^^xsd:date;
doap-changeset:changeset [
doap-changeset:item [
a doap-changeset:Packaging;
rdfs:label "Add repo link.";
];
];
doap-changeset:released-by ;
doap:file-release ;
doap:revision "0.006"^^xsd:string.
a foaf:Person;
foaf:mbox ;
foaf:name "Toby Inkster";
foaf:nick "TOBYINK";
foaf:page .
perlrdf 000664 001750 001750 20545 12405262056 14653 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/bin #!/usr/bin/env perl
use App::perlrdf;
App::perlrdf->run;
__END__
=head1 NAME
perlrdf - perlrdf command line utils
=head1 SYNOPSIS
$ perlrdf make_store --sqlite=mystore.dat
Initialized RDF::Trine::Store::DBI::SQLite
$ perlrdf validate input.rdf
1..1
ok 1 - file:///tmp/example/input.rdf is valid RDFXML, 9 triples
$ perlrdf store_load --autograph --sqlite=mystore.dat input.rdf
Loading file:///tmp/example/input.rdf
$ perlrdf store_dump --sqlite=mystore.dat output.nq
Writing file:///tmp/example/output.nq
$ perlrdf translate output.nq output.rdf
$ perlrdf isomorphic input.rdf output.rdf
graphs are isomorphic
=head1 DESCRIPTION
perlrdf is a single front-end to various RDF functionality available for
Perl. The core distribution includes commands for create and manipulate
quad stores (i.e. databases for RDF data); and commands to parse, serialise,
convert and validate RDF data in various formats.
However, perlrdf is pluggable and it is anticipated that plugins on CPAN
will cover other tasks such as RDF querying, signing, encryption, and
reasoning.
=head1 COMMANDS
This section describes the commands included with the core App::perlrdf
distribution. Others are available as plugins. Run C<< perlrdf commands >>
to see a list of locally installed commands.
=head2 Meta Commands
=head3 C<< perlrdf about >>
Shows the version numbers of all installed perlrdf commands, plus the CPAN
ID of each command's author.
=head3 C<< perlrdf aliases >>
Many commands have aliases or shortcuts. For example, the following two are
equivalent:
$ perlrdf translate input.ttl output.rdf
$ perlrdf tr input.ttl output.rdf
C<< perlrdf aliases >> shows a list of available aliases.
=head3 C<< perlrdf commands >>
Shows a list of installed perlrdf commands, along with a brief extract.
=head3 C<< perlrdf filespec >>
Shows help on "File Specifications". FileSpecs are an App::perlrdf-specific
microsyntax for specifying a filename or URI along with a tiny bit of
associated key-value metadata. The following are three examples of FileSpecs:
{format:RDFXML}C:\Data\contacts.xml
http://www.example.com/mydata.ttl
{format:Turtle,base:"http://example.net/"}stdin:
Running the C<< perlrdf filespec >> command on its own shows some help on
using FileSpecs. If you run it with additional arguments, these are parsed
as FileSpecs with debugging information shown.
$ perlrdf filespec /tmp/foo.rdf
{
"base" : "file:///tmp/foo.rdf",
"format" : "RDF::Trine::Parser::RDFXML",
"uri" : "file:///tmp/foo.rdf"
}
=head3 C<< perlrdf help >>
Running the C<< perlrdf help >> command on its own shows a list of commands
with their abstracts. Detailed help for a particular command can be shown
by providing that as an argument. For example, for help on the
C<< perlrdf translate >> command, run:
$ perlrdf help translate
=head2 Parsing and Serialization
In general, parsing and serialization commands take one or more FileSpecs
as arguments. These can be provided as options, as in:
$ perlrdf translate --input-spec="in.nt" --output-spec="out.rdf"
Alternatively the first "positional argument" will usually be treated as
an input FileSpec, and the second as an output FileSpec:
$ perlrdf translate in.nt out.rdf
Using options rather than positional parameters can often be clearer, and is
the recommended way of passing parameters, especially when you need to pass
multiple input files or multiple output files as parameters.
When no inputs are provided as named or positional arguments, STDIN is
normally used. When no outputs are provided, output normally goes to STDOUT.
=head3 C<< perlrdf canonicalize >>
Given a single FileSpec as input, serializes as canonical N-Triples, which
is a useful format for SHA1/MD5 digests, graph signing, etc, because it means
that incidental features of serialization (blank node identifiers, whitespace,
order of statements) don't affect the output. If no input FileSpec is
provided, then defaults to STDIN.
A filename or URL (but not a full FileSpec) may be provided for output.
Otherwise defaults to STDOUT.
=head3 C<< perlrdf translate >>
Parses one or more input FileSpecs into a single RDF graph and serializes
them to one or more output FileSpecs. Thus this command can be used as a
translator between different RDF serializations, and also as a graph
concatenator.
$ perlrdf translate \
--skolem \
-i "{format:RDFXML}/tmp/contacts.xml" \
-i "http://www.example.com/employees.ttl" \
-o "merged-contacts.nt" \
-o "merged-contacts.rdf"
The 'skolem' option allows you to generate URIs for any blank nodes in the
graph. (Not especially fantastic URIs, but URIs all the same.)
=head3 C<< perlrdf validate >>
Parses one or more input FileSpecs (doing nothing with the results), and
makes sure that each file parses without croaking. Writes output to STDOUT
in TAP format.
$ perlrdf validate "foo.ttl" "ftp://acme.example.com/pub/bar.rdf"
It's often a good idea to validate RDF before attempting to load it into a
store.
=head2 Quad Store Management
RDF::Trine stores can be connected to using DSN-like configuration strings
such as:
DBI;mymodel;DBI:mysql:database=rdf;user;password
These configuration strings are passed to the App::perlrdf tool using the
'store' option:
$ perlrdf make_store \
--store="DBI;mymodel;DBI:mysql:database=rdf;user;password"
For the common case of DBI-backed stores, App::perlrdf offers the ability
to avoid configuration strings and just specify database type, name, etc:
$ perlrdf make_store \
--database=mysql \
--dbname=rdf \
--username=user \
--password=password \
--model=contacts_db
SQLite-backed stores are particularly easy to work with:
$ perlrdf make_store --sqlite=/tmp/mydatabase.sqlite
If no store is specified on the command line, the C
environment variable is consulted.
$ setenv PERLRDF_STORE "DBI;xyz;DBI:mysql:database=rdf;un;pw"
$ perlrdf make_store
=head3 C<< perlrdf make_store >>
Initializes the store, creating empty data structures, etc.
If the store already exists this I be non-destructive.
=head3 C<< perlrdf store_describe >>
Describes a resource in the database.
$ perlrdf store_describe --sqlite=/tmp/mydatabase.sqlite \
--output-format=RDFXML \
"http://www.example.com/id/alice"
=head3 C<< perlrdf store_dump >>
Dumps the contents of a store to a FileSpec, or to STDOUT. As with the
C command, this may take multiple output filenames.
With the 'graph' option, you can limit the dump to specific graphs.
=head3 C<< perlrdf store_load >>
Loads one or more FileSpecs into the store. By default, data is loaded as
triples (in no graph). You can specify a graph URI for the data using the
'graph' option; or use the 'autograph' option to indicate that you wish to
use the FileSpec URIs as graph URIs.
=head3 C<< perlrdf store_truncate >>
Deletes all data from a store.
With the 'graph' option, you can delete specific graphs.
=head2 Other
=head3 C<< perlrdf isomorphic >>
Given two input FileSpecs, checks whether they are isomorphic (i.e. the same
graph after mapping blank node identifiers). If they are non-isomorphic, it
will also inform you about them differing in "interesting" ways - i.e. one
graph being an exact subgraph of the other.
=head3 C<< perlrdf prefix >>
Looks up one or more prefixes using RDF::NS.
$ perlrdf prefix rdf,rdfs,owl,xsd
owl http://www.w3.org/2002/07/owl#
rdf http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs http://www.w3.org/2000/01/rdf-schema#
xsd http://www.w3.org/2001/XMLSchema#
$ perlrdf prefix --format=turtle foaf,dc
@prefix dc: .
@prefix foaf: .
=head1 SEE ALSO
L,
L,
L,
L,
L.
Find App::perlrdf plugins on MetaCPAN:
L.
=head1 AUTHOR
Toby Inkster Etobyink@cpan.orgE.
=head1 COPYRIGHT AND LICENCE
This software is copyright (c) 2012 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
01basic.t 000664 001750 001750 76 12405262056 14311 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/t use Test::More tests => 1;
BEGIN { use_ok('App::perlrdf') };
02translate.t 000664 001750 001750 2261 12405262056 15264 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/t use App::Cmd::Tester;
use App::perlrdf;
use JSON qw(from_json);
use RDF::Trine qw(statement iri literal variable);
use Test::Exception;
use Test::More tests => 6;
use Test::RDF;
my @args = (
translate => (map {;-i=>$_} ),
-O => '{format:RDFJSON}stdout:',
);
my $result = test_app 'App::perlrdf' => \@args;
is($result->stderr, '', 'nothing sent to STDERR');
is($result->error, undef, 'threw no exceptions');
is($result->exit_code, 0, 'exit code 0');
my $json_data;
lives_ok {
$json_data = from_json( $result->stdout );
} 'JSON output to STDOUT'
or do {
note sprintf("STDOUT: %s", $result->stdout);
BAIL_OUT;
};
my $model = RDF::Trine::Model::->new;
$model->add_hashref($json_data);
pattern_target($model);
use RDF::Trine::Namespace qw(xsd);
my $doap = RDF::Trine::Namespace::->new('http://usefulinc.com/ns/doap#');
pattern_ok(
statement( variable('d'), $doap->name, literal('App-perlrdf') ),
statement( variable('d'), $doap->license, iri('http://dev.perl.org/licenses/') ),
statement( variable('d'), $doap->release, variable('r') ),
statement( variable('r'), $doap->revision, literal('0.001', undef, $xsd->string->uri) ),
'output contains some known data',
);
perlrdf.pm 000664 001750 001750 2226 12405262056 15760 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App package App::perlrdf;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::VERSION = '0.006';
}
use App::Cmd::Setup -app => {
plugins => [qw( Prompt )],
};
sub AUTHORITY
{
my $class = ref($_[0]) || $_[0];
no strict qw(refs);
${"$class\::AUTHORITY"};
}
1;
__END__
=pod
=encoding utf8
=begin trustme
=item AUTHORITY
=end trustme
=head1 NAME
App::perlrdf - perlrdf command line utils
=head1 DESCRIPTION
Support library for the L command-line tool.
=head1 BUGS
Please report any bugs to
L.
=head1 SEE ALSO
L.
=head1 AUTHOR
Toby Inkster Etobyink@cpan.orgE.
=head1 COPYRIGHT AND LICENCE
This software is copyright (c) 2012-2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=head1 DISCLAIMER OF WARRANTIES
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Command.pm 000664 001750 001750 10407 12405262057 17357 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf package App::perlrdf::Command;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::VERSION = '0.006';
}
use App::Cmd::Setup -command;
use constant store_opt_spec => (
[ 'database|t=s' => '"sqlite", "mysql" or "pg"' ],
[ 'dbname|d=s' => 'Database name (file name for SQLite)' ],
[ 'host|h=s' => 'Database server host name or IP address' ],
[ 'port=i' => 'Database server port' ],
[ 'username|u=s' => 'User name for database login' ],
[ 'password=s' => 'Password for database login' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'dbi|D=s' => 'DBI DSN' ],
[ 'sqlite|Q=s' => 'SQLite file name' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'store|T=s' => 'Trine store configuration string' ],
[ 'model|M=s' => 'Database model name (defaults to "")' ],
);
use constant store_help => q(
The database to connect to can be specified using the 'database', 'dbname',
'host', 'port', 'username' and 'password' options. Alternatively you can
specify an exact DBI DSN (in which case the 'database', 'dbname', 'host' and
'port' options must not be specified). The 'sqlite' option is a shortcut for
setting the 'database' option to 'sqlite', and setting the 'dbname' option.
Alternatively, you may specify an RDF::Trine::Store configuration string.
If you want to connect to a non-DBI store, this is the only way to specify
it.
Several DBI-based stores can share the same SQL database. This is achieved
by giving them each a different model name (which confusingly has nothing to
do with the RDF::Trine::Model class!).
);
sub get_filespecs
{
my ($self, $class, $name, $opt) = @_;
my @specs = map {
$class->new_from_filespec(
$_,
$opt->{$name.'_format'},
$opt->{$name.'_base'},
)
} do {
if (ref $opt->{$name.'_spec'} eq 'ARRAY')
{ @{$opt->{$name.'_spec'}} }
elsif (defined $opt->{$name.'_spec'})
{ ($opt->{$name.'_spec'}) }
else
{ qw() }
};
push @specs, map {
$class->new_from_filespec(
"{}$_",
$opt->{$name.'_format'},
$opt->{$name.'_base'},
)
} do {
if (ref $opt->{$name} eq 'ARRAY')
{ @{$opt->{$name}} }
elsif (defined $opt->{$name})
{ ($opt->{$name}) }
else
{ qw() }
};
return @specs;
}
sub get_store
{
require RDF::Trine;
my ($self, $opt) = @_;
my %exclusions = (
store => [qw[ dbi sqlite username password host port dbname database ]],
sqlite => [qw[ dbi username password host port dbname database ]],
dbi => [qw[ host port dbname database ]],
);
foreach my $k (keys %exclusions)
{
next unless exists $opt->{$k};
foreach my $e (@{ $exclusions{$k} })
{
next unless exists $opt->{$e};
$self->usage_error("Must not provide both '$k' and '$e' options.");
}
}
if (exists $opt->{dbname} or exists $opt->{database})
{
$self->usage_error("'dbname' and 'database' options must be used in conjunction.")
unless exists $opt->{dbname} && exists $opt->{database};
}
return RDF::Trine::store($opt->{store}) if exists $opt->{store};
my $dsn = exists $opt->{dbi}
? $opt->{dbi}
: do {
my ($database, $dbname, $host, $port) =
map { $opt->{$_} }
qw(database dbname host port);
if ($opt->{sqlite})
{
$database = 'sqlite';
$dbname = $opt->{sqlite};
}
my $d;
if (lc $database eq 'sqlite')
{
$d = "DBI:SQLite:dbname=${dbname}";
$self->usage_error("SQLite does not support 'host' and 'port'.")
if $opt->{host} || $opt->{port};
}
elsif (lc $database eq 'mysql')
{
$d = "DBI:mysql:database=${dbname}";
$d .= ";host=$host" if $host;
$d .= ";port=$port" if $port;
}
elsif ($database =~ m{^(pg|psql|pgsql|postgres|postgresql)$}i)
{
$d = "DBI:Pg:dbname=${dbname}";
$d .= ";host=$host" if $host;
$d .= ";port=$port" if $port;
}
$d;
};
if (length $dsn)
{
no warnings;
return RDF::Trine::Store::DBI->new(
"$opt->{model}",
$dsn,
$opt->{username},
$opt->{password},
);
}
return RDF::Trine::store($ENV{PERLRDF_STORE})
if defined $ENV{PERLRDF_STORE};
$self->usage_error("No SQLite, MySQL or Pg database specified.");
}
sub AUTHORITY
{
my $class = ref($_[0]) || $_[0];
no strict qw(refs);
${"$class\::AUTHORITY"};
}
1; DummyModel.pm 000664 001750 001750 1441 12405262057 20033 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf package App::perlrdf::DummyModel;
BEGIN {
$App::perlrdf::DummyModel::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::DummyModel::VERSION = '0.006';
}
use strict qw(vars subs);
no warnings;
use base 'RDF::Trine::Model';
use Carp 'confess';
sub new
{
my $size = 0;
bless \$size, shift;
}
*temporary_model = \&new;
sub _store
{
return;
}
sub add_statement
{
my $self = shift;
++$$self;
}
sub die_write_only
{
confess "this model is write-only!";
}
*{$_} = \&die_write_only
for qw(
get_statements get_pattern get_sparql get_contexts get_list get_sequence
remove_list remove_statement remove_statements
count_statements
as_stream as_hashref as_graphviz as_string
subjects predicates objects objects_for_predicate_list bounded_description
);
sub size
{
my $self = shift;
$$self;
}
1;
FileSpec.pm 000664 001750 001750 4364 12405262057 17460 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf package App::perlrdf::FileSpec;
use 5.010;
use autodie;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::FileSpec::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::FileSpec::VERSION = '0.006';
}
use Moose;
use Moose::Util::TypeConstraints;
use JSON;
use PerlX::Maybe;
use RDF::Trine;
use URI;
use URI::file;
use namespace::clean;
class_type PathClassFile => { class => 'Path::Class::File' };
class_type AbsoluteUri => { class => 'URI' };
coerce 'AbsoluteUri',
from Str => via {
if (/^std(in|out):$/i) { URI->new(lc $_) }
elsif (/^\w\w+:/i) { URI->new($_) }
else { URI::file->new_abs($_) }
};
coerce 'AbsoluteUri',
from PathClassFile => via {
URI::file->new_abs("$_")
};
has uri => (
is => 'ro',
isa => 'AbsoluteUri',
required => 1,
coerce => 1,
);
has base => (
is => 'ro',
isa => 'AbsoluteUri',
lazy_build => 1,
coerce => 1,
);
has 'format' => (
is => 'ro',
isa => 'Str',
lazy_build => 1,
);
sub DEFAULT_STREAM
{
warn "DEFAULT_STREAM is 'stdout:'\n";
return "stdout:";
}
sub _jsonish
{
my ($self, $str) = @_;
$str =~ s/(^\{)|(\}$)//g; # strip curlies
my $opts = {};
while ($str =~ m{ \s* (\w+|"[^"]+"|'[^']+') \s* [:] (\w+|"[^"]+"|'[^']+') \s* ([;,]|$) }xg)
{
my $key = $1;
my $val = $2;
$val = $1 if $val =~ /^["'](.+).$/;
$opts->{$key} = $val;
}
return $opts;
}
sub new_from_filespec
{
my ($class, $spec, $default_format, $default_base) = @_;
my ($optstr, $name) = ($spec =~ m<^ (\{ .*? \}) (.+) $>x)
? ($1, $2)
: ('{}', $spec);
my $opts = $class->_jsonish($optstr);
$class->new(
'uri' => ($name eq '-' ? $class->DEFAULT_STREAM : $name),
maybe('format' => ($opts->{format} // $default_format)),
maybe('base' => ($opts->{base} // $default_base)),
);
}
sub _build_base
{
shift->uri;
}
sub _build_format
{
return $1 if shift->uri =~ /\.(\w+)$/;
return '';
}
sub TO_JSON
{
my ($self, $stringify) = @_;
my $r = +{
base => $self->base->as_string,
format => $self->format,
uri => $self->uri->as_string,
};
return $stringify
? to_json($r => +{ pretty => 1, canonical => 1 })
: $r;
}
sub AUTHORITY
{
my $class = ref($_[0]) || $_[0];
no strict qw(refs);
${"$class\::AUTHORITY"};
}
1; About.pm 000664 001750 001750 1561 12405262057 20412 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::About;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::About::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::About::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant {
abstract => q[list which perlrdf plugins are installed],
usage_desc => q[%c about],
};
use constant FORMAT_STR => "%-36s%10s %s\n";
sub command_names
{
qw(
about
credits
);
}
sub opt_spec
{
return;
}
sub execute
{
my ($self, $opt, $args) = @_;
my $auth = $self->app->can('AUTHORITY');
printf(
FORMAT_STR,
ref($self->app),
$self->app->VERSION,
$auth ? $self->app->$auth : '???',
);
foreach my $cmd (sort $self->app->command_plugins)
{
my $auth = $cmd->can('AUTHORITY');
printf(
FORMAT_STR,
$cmd,
$cmd->VERSION,
$auth ? $cmd->$auth : '???',
);
}
}
1;
Aliases.pm 000664 001750 001750 2116 12405262057 20716 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Aliases;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Aliases::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Aliases::VERSION = '0.006';
}
use App::perlrdf -command;
use match::simple qw(match);
use namespace::clean;
use constant {
abstract => q[show aliases for perlrdf commands],
usage_desc => q[%c aliases],
};
sub description
{
<<'DESCRIPTION'
Most perlrdf commands can be invoked with shorter aliases.
perlrdf translate -s rdfxml input.ttl
perlrdf tr -s rdfxml input.ttl # same thing
The aliases command (which, ironically, has no shorter alias) shows existing
aliases.
DESCRIPTION
}
sub command_names
{
qw(
aliases
);
}
sub opt_spec
{
return;
}
sub execute
{
my ($self, $opt, $args) = @_;
my $filter = scalar(@$args)
? $args
: sub { not match($_[0], [qw(aliases commands help)]) };
foreach my $cmd (sort $self->app->command_plugins)
{
my ($preferred, @aliases) = $cmd->command_names;
printf("%-16s: %s\n", $preferred, "@aliases")
if match($preferred, $filter);
}
}
1;
Canonicalize.pm 000664 001750 001750 5461 12405262057 21742 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Canonicalize;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Canonicalize::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Canonicalize::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Generate canonical N-Triples from an input file.);
use constant command_names => qw( canonicalize canonicalise );
use constant description => <<'DESCRIPTION';
Converts an input file into canonical N-Triples. The idea of canonical
N-Triples is that blank node identifiers are normalised to a predictable
pattern; and statements are serialized in a predictable order. It is
useful as a canonical serialization for graph signing or generating a
SHA1/MD5 digest of a graph.
Not all RDF graphs can be fully canonicalized. The on-fail option allows
you to decide what is done with the extra triples left over from
canonicalization. May be set to "truncate" (the default), "append",
"space" or "die". See RDF::Trine::Serializer::NTriples::Canonical
for more details.
See .
DESCRIPTION
use constant opt_spec => (
[ 'input|i=s', 'Input filename or URL' ],
[ 'input-spec|I=s', 'Input file specification' ],
[ 'input-format|p=s', 'Input format (mnemonic: parse)' ],
[ 'input-base|b=s', 'Input base URI' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>
[ 'output|o=s', 'Output filename or URL' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>
[ 'on-fail|x=s', 'Behaviour when graphs cannot be canonicalized' ],
);
use constant usage_desc => '%c canonicalize %o INPUT [OUTPUT]';
sub execute
{
require App::perlrdf::FileSpec::InputRDF;
require App::perlrdf::FileSpec::OutputRDF;
require RDF::Trine::Serializer::NTriples::Canonical;
my ($self, $opt, $arg) = @_;
$opt->{output_format} = 'RDF::Trine::Serializer::NTriples::Canonical';
$opt->{on_fail} //= 'truncate';
my @inputs = $self->get_filespecs(
'App::perlrdf::FileSpec::InputRDF',
input => $opt,
);
@inputs = App::perlrdf::FileSpec::InputRDF->new_from_filespec(
(shift(@$arg) // '-'),
$opt->{input_format},
$opt->{input_base},
) unless @inputs;
my @outputs = $self->get_filespecs(
'App::perlrdf::FileSpec::OutputRDF',
output => $opt,
);
@outputs = App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
(shift(@$arg) // '-'),
$opt->{output_format},
undef,
) unless @outputs;
$self->usage_error("Need exactly one input source and one output destination")
unless @inputs==1 and @outputs==1;
my $in = RDF::Trine::Model->new;
$inputs[0]->parse_into_model($in);
my $ser = RDF::Trine::Serializer::NTriples::Canonical::->new(
onfail => $opt->{on_fail},
);
$ser->serialize_model_to_file($outputs[0]->handle, $in);
}
1;
Commands.pm 000664 001750 001750 1232 12405262057 21074 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Commands;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Commands::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Commands::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
require App::Cmd::Command::commands;
our @ISA;
unshift @ISA, 'App::Cmd::Command::commands';
use constant {
abstract => q[list installed perlrdf commands],
};
sub sort_commands
{
my ($self, @commands) = @_;
my $float = qr/^(?:help|commands|aliases|about)$/;
my @head = sort grep { $_ =~ $float } @commands;
my @tail = sort grep { $_ !~ $float } @commands;
return (\@head, \@tail);
}
1;
FileSpec.pm 000664 001750 001750 5371 12405262057 21035 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::FileSpec;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::FileSpec::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::FileSpec::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Shows help on how to use "file specifications");
use constant command_names => qw( filespec );
use constant description => <<'DESCRIPTION';
FileSpecs are an App::perlbrew microsyntax for specifying input and output
data streams. Various commands expect to be given filespecs so that they know
what files, URLs or streams to operate on.
FileSpecs have a two part syntax. They start with an optional JSON-like
options specification, and are followed by a (non-optional) file name, URL or
dash. Some examples:
{format:RDFXML}C:\Data\Countries.rdfx
http://www.example.com/data.rdf
{format:"Turtle",base:"http://www.example.net/"}-
The optional JSON-like part is a list of key-value pairs, where pairs are
separated with commas, and keys are seperated from values with colons. Keys
and values must be quoted with single or double quotes if they contain
"non-word" characters (i.e. /\W/). No escaping is available. There are no
nested data structures.
The following keys are currently defined:
format - file format (media type, format name or parser class)
base - base URI
Additional keys are currently ignored, available for future use.
The second part may be a relative or absolute filename which will be
converted into a URI; or may be an absolute URI in any supported URI scheme;
or may be a dash, which is treated as STDIN or STDOUT depending on context.
Supported URI schemes include any URI scheme which can be used for GET
requests by LWP::UserAgent, including http, https, data, file, ftp, gopher
and nntp; and pseudo-schemes cpan, loopback and nogo. App::perlrdf also
supports pseudo-schemes stdin, stdout and stderr.
So for example, to write Turtle to STDERR:
perlrdf translate -i mydata.rdf -o "{format:Turtle}stderr:"
The 'translate' command allows you to specify input our output as either a
filename or a file spec, using different parameters for each:
perlrdf translate --input=FILE --output-spec=SPEC
perlrdf translate --input-spec=SPEC --output=FILE
perlrdf translate -I SPEC -O SPEC
perlrdf translate -i FILE -o FILE -O SPEC
If you want to test FileSpecs, you can run:
perlrdf filespec SPEC1 SPEC2 ...
DESCRIPTION
use constant opt_spec => qw();
use constant usage_desc => '%c filespec';
sub execute
{
my ($class, $opt, $args) = @_;
if (@$args)
{
require App::perlrdf::FileSpec;
say
App::perlrdf::FileSpec->new_from_filespec($_)->TO_JSON(1),
for @$args;
}
else
{
say $class->description;
}
}
1;
Isomorphic.pm 000664 001750 001750 3726 12405262057 21461 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Isomorphic;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Isomorphic::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Isomorphic::VERSION = '0.006';
}
use App::perlrdf -command;
sub graph (_) { RDF::Trine::Graph->new(shift) };
use namespace::clean;
use constant abstract => q (Determine if two graphs are isomorphic.);
use constant command_names => qw( isomorphic );
use constant opt_spec => (
[ 'input|i=s@', 'Input filename or URL' ],
[ 'input-spec|I=s@', 'Input file specification' ],
[ 'input-format|p=s', 'Input format (mnemonic: parse)' ],
[ 'input-base|b=s', 'Input base URI' ],
);
use constant usage_desc => '%c isomorphic %o INPUT1 INPUT2';
sub execute
{
require App::perlrdf::FileSpec::InputRDF;
require RDF::Trine::Graph;
my ($self, $opt, $arg) = @_;
my @inputs = $self->get_filespecs(
'App::perlrdf::FileSpec::InputRDF',
input => $opt,
);
push @inputs, map {
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
$_,
$opt->{input_format},
$opt->{input_base},
)
} @$arg;
push @inputs,
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
'-',
$opt->{input_format},
$opt->{input_base},
)
unless @inputs >= 2;
$self->usage_error("Must provide exactly two inputs!")
unless @inputs == 2;
my ($i1, $i2) = @inputs;
my ($m1, $m2) = map {
my $m = RDF::Trine::Model->new;
$_->parse_into_model($m);
$m;
} $i1, $i2;
my ($g1, $g2) = map graph, $m1, $m2;
no warnings;
if ($m1->size == $m2->size)
{
say $g1->equals($g2)
? "graphs are isomorphic"
: sprintf("graphs differ: %s", $g1->error);
}
elsif ($m1->size < $m2->size)
{
say $g1->is_subgraph_of($g2)
? sprintf("%s is a subgraph of %s", $i1->uri, $i2->uri)
: sprintf("graphs differ: %s", $g1->error);
}
else
{
say $g2->is_subgraph_of($g1)
? sprintf("%s is a supergraph of %s", $i1->uri, $i2->uri)
: sprintf("graphs differ: %s", $g2->error);
}
}
1;
MakeStore.pm 000664 001750 001750 1415 12405262057 21230 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::MakeStore;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::MakeStore::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::MakeStore::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Initialise an RDF::Trine::Store.);
use constant command_names => qw( make_store mkstore );
use constant description => <<'DESCRIPTION' . __PACKAGE__->store_help;
Creates an empty RDF::Trine store.
DESCRIPTION
use constant opt_spec => ( __PACKAGE__->store_opt_spec );
use constant usage_desc => '%c make_store %o';
sub execute
{
my ($self, $opt, $arg) = @_;
my $store = $self->get_store($opt);
$store->init;
printf STDERR "Initialized %s\n", ref $store;
}
1;
Prefix.pm 000664 001750 001750 2100 12405262057 20563 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Prefix;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Prefix::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Prefix::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Look up the full URIs for customary prefixes);
use constant command_names => qw( prefix prefixes pfx );
use constant description => <<'DESCRIPTION';
Given one or more prefixes such as "foaf", "dc", looks up the most
commonly used full URI.
DESCRIPTION
use constant opt_spec => (
[ 'format|f=s' => 'Output format ("turtle", "xmlns", "sparql", "text")' ],
);
use constant usage_desc => '%c prefix %o PREFIX [PREFIX ...]';
sub execute
{
require RDF::NS;
my ($self, $opt, $arg) = @_;
my $method;
for ($opt->{format} // '')
{
if (/turtle|ttl/i) { $method = 'TTL' }
elsif (/sparql/i) { $method = 'SPARQL' }
elsif (/xmlns|xml/i) { $method = 'XMLNS' }
else { $method = 'TXT' }
}
say for RDF::NS->new('any')->$method(join q<,>, @$arg);
}
1;
StoreDescribe.pm 000664 001750 001750 4007 12405262057 22073 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::StoreDescribe;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::StoreDescribe::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::StoreDescribe::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Describe RDF resource using an RDF::Trine::Store.);
use constant command_names => qw( store_describe desc );
use constant description => <<'INTRO' . __PACKAGE__->store_help . <<'DESCRIPTION';
Retrieve a bounded description from an RDF::Trine::Store.
INTRO
Output files are specified the same way as for the 'translate' command. See
'filespec' for more details.
DESCRIPTION
use constant opt_spec => (
__PACKAGE__->store_opt_spec,
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'output|o=s@', 'Output filename or URL' ],
[ 'output-spec|O=s@', 'Output file specification' ],
[ 'output-format|s=s', 'Output format (mnemonic: serialise)' ],
);
use constant usage_desc => '%c store_describe %o RESOURCE';
sub execute
{
require RDF::Trine;
require App::perlrdf::FileSpec::OutputRDF;
my ($self, $opt, $arg) = @_;
my $store = $self->get_store($opt);
my $model = RDF::Trine::Model->new($store);
my $resource = @$arg
? RDF::Trine::iri(shift @$arg)
: $self->usage_error("No resource to describe");
my @outputs = $self->get_filespecs(
'App::perlrdf::FileSpec::OutputRDF',
output => $opt,
);
push @outputs, map {
App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
$_,
$opt->{output_format},
$opt->{output_base},
)
} @$arg;
push @outputs,
App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
'-',
($opt->{output_format} // 'NQuads'),
$opt->{output_base},
)
unless @outputs;
my $description = RDF::Trine::Model->new;
$description->add_iterator( $model->bounded_description($resource) );
for (@outputs)
{
printf STDERR "Writing %s\n", $_->uri;
eval {
local $@ = undef;
$_->serialize_model($description);
1;
} or warn "$@\n";
}
}
1;
StoreDump.pm 000664 001750 001750 4062 12405262057 21261 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::StoreDump;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::StoreDump::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::StoreDump::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Dump RDF data from an RDF::Trine::Store.);
use constant command_names => qw( store_dump dump );
use constant description => <<'INTRO' . __PACKAGE__->store_help . <<'DESCRIPTION';
Dump data from an RDF::Trine::Store.
INTRO
Output files are specified the same way as for the 'translate' command. See
'filespec' for more details.
DESCRIPTION
use constant opt_spec => (
__PACKAGE__->store_opt_spec,
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'output|o=s@', 'Output filename or URL' ],
[ 'output-spec|O=s@', 'Output file specification' ],
[ 'output-format|s=s', 'Output format (mnemonic: serialise)' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'graph|g=s@', 'Graph(s) to dump (default: all graphs)' ],
);
sub execute
{
require RDF::Trine;
require App::perlrdf::FileSpec::OutputRDF;
my ($self, $opt, $arg) = @_;
my $store = $self->get_store($opt);
my $model = RDF::Trine::Model->new($store);
if ($opt->{graph})
{
my $orig = $model;
$model = RDF::Trine::Model->new;
for (@{ $opt->{graph} })
{
my $graph = RDF::Trine::Node::Resource->new($_);
$model->add_iterator( scalar $orig->get_statements((undef)x3, $graph) );
}
}
my @outputs = $self->get_filespecs(
'App::perlrdf::FileSpec::OutputRDF',
output => $opt,
);
push @outputs, map {
App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
$_,
$opt->{output_format},
$opt->{output_base},
)
} @$arg;
push @outputs,
App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
'-',
($opt->{output_format} // 'NQuads'),
$opt->{output_base},
)
unless @outputs;
for (@outputs)
{
printf STDERR "Writing %s\n", $_->uri;
eval {
local $@ = undef;
$_->serialize_model($model);
1;
} or warn "$@\n";
}
}
1; StoreLoad.pm 000664 001750 001750 4374 12405262057 21241 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::StoreLoad;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::StoreLoad::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::StoreLoad::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Load RDF data into an RDF::Trine::Store.);
use constant command_names => qw( store_load load );
use constant description => <<'INTRO' . __PACKAGE__->store_help . <<'DESCRIPTION';
Load data into an RDF::Trine::Store. The store should have been previously
initialized (e.g. using the make_store command).
INTRO
Input files are specified the same way as for the 'translate' command. See
'filespec' for more details. If a parsing error occurs in an input,
subsequent inputs will still be processed. It may be a good idea to check
the input files first using 'validate'.
DESCRIPTION
use constant opt_spec => (
__PACKAGE__->store_opt_spec,
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'input|i=s@', 'Input filename or URL' ],
[ 'input-spec|I=s@', 'Input file specification' ],
[ 'input-format|p=s', 'Input format (mnemonic: parse)' ],
[ 'input-base|b=s', 'Input base URI' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'graph|g=s', 'Graph URI for input' ],
[ 'autograph|G', 'Generate graph URI based on input URI' ],
);
sub execute
{
require RDF::Trine;
require App::perlrdf::FileSpec::InputRDF;
my ($self, $opt, $arg) = @_;
my $store = $self->get_store($opt);
my $model = RDF::Trine::Model->new($store);
my @inputs = $self->get_filespecs(
'App::perlrdf::FileSpec::InputRDF',
input => $opt,
);
push @inputs, map {
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
$_,
$opt->{input_format},
$opt->{input_base},
)
} @$arg;
push @inputs,
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
'-',
$opt->{input_format},
$opt->{input_base},
)
unless @inputs;
for (@inputs)
{
printf STDERR "Loading %s\n", $_->uri;
my %params = ();
if ($opt->{autograph})
{ $params{graph} = $_->uri }
elsif ($opt->{graph})
{ $params{graph} = $opt->{graph} }
eval {
local $@ = undef;
$_->parse_into_model($model, %params);
1;
} or warn "$@\n";
}
}
1;
StoreTruncate.pm 000664 001750 001750 3522 12405262057 22141 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::StoreTruncate;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::StoreTruncate::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::StoreTruncate::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Delete RDF data from an RDF::Trine::Store.);
use constant command_names => qw( store_truncate truncate );
use constant description => <<'INTRO' . __PACKAGE__->store_help . <<'DESCRIPTION';
Delete data from an RDF::Trine::Store.
INTRO
Note that because multiple stores may share a database, the 'nuke' option
does not currently drop the database; it just removes the table which holds
RDF quads.
When one or more graph URIs are specified, the 'nuke' option is ignored,
and prompts are skipped.
DESCRIPTION
use constant opt_spec => (
__PACKAGE__->store_opt_spec,
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>,
[ 'graph|g=s@', 'Graph(s) to delete (default: all graphs)' ],
[ 'yes', 'Answer "yes" to prompts' ],
[ 'nuke', 'Delete the entire store' ],
);
sub execute
{
require RDF::Trine;
require App::perlrdf::FileSpec::OutputRDF;
my ($self, $opt, $arg) = @_;
my $store = $self->get_store($opt);
my $model = RDF::Trine::Model->new($store);
if ($opt->{graph})
{
for (@{ $opt->{graph} })
{
printf STDERR "Truncating graph %s\n", $_;
my $graph = RDF::Trine::Node::Resource->new($_);
$model->remove_statements((undef)x3, $graph);
}
printf STDERR "'nuke' ignored when 'graph' specified\n"
if $opt->{nuke};
}
else
{
if ($opt->{yes} or prompt_yn("Really delete all data from this store?"))
{
$model->remove_statements((undef)x4);
}
if ($opt->{nuke})
{
if ($opt->{yes} or prompt_yn("Really nuke this store?"))
{
$store->nuke;
}
}
}
}
1; Translate.pm 000664 001750 001750 5604 12405262057 21277 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Translate;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Translate::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Translate::VERSION = '0.006';
}
use App::perlrdf -command;
sub skolem ($)
{
require Data::UUID;
require RDF::Trine;
my $model = shift;
my %map;
my $uuid = Data::UUID->new;
my @statements =
grep { $_->has_blanks }
$model->get_statements(undef, undef, undef, undef)->get_all;
$model->remove_statement($_) for @statements;
$model->add_statement($_)
for map {
my $st = $_;
my @nodes =
map {
if ($_->is_blank)
{
$map{ $_->blank_identifier }
||= RDF::Trine::Node::Resource->new(
sprintf 'urn:uuid:%s', lc $uuid->create_str
)
}
else
{
$_
}
}
$st->nodes;
@nodes==4
? RDF::Trine::Statement::Quad->new(@nodes)
: RDF::Trine::Statement->new(@nodes)
}
@statements;
}
use namespace::clean;
use constant abstract => q (Parse/serialise some RDF.);
use constant command_names => qw( translate tr parse serialise serialize );
use constant description => <<'DESCRIPTION';
Parses the input as RDF in various serialisations, and re-serialises it
in your choice of serialisation.
Input may be a URL, filename or STDIN. If multiple inputs are sepcified,
these are merged into a single graph.
Output may be a URL (for HTTP POST), filename of STDOUT. If multiple
outputs are specified, the entire graph is written to each of them.
DESCRIPTION
use constant opt_spec => (
[ 'input|i=s@', 'Input filename or URL' ],
[ 'input-spec|I=s@', 'Input file specification' ],
[ 'input-format|p=s', 'Input format (mnemonic: parse)' ],
[ 'input-base|b=s', 'Input base URI' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>
[ 'output|o=s@', 'Output filename or URL' ],
[ 'output-spec|O=s@', 'Output file specification' ],
[ 'output-format|s=s', 'Output format (mnemonic: serialise)' ],
[]=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>
[ 'skolem|k', 'Transform blank nodes into URIs' ],
);
sub execute
{
require App::perlrdf::FileSpec::InputRDF;
require App::perlrdf::FileSpec::OutputRDF;
require RDF::Trine;
my ($self, $opt, $arg) = @_;
my @inputs = $self->get_filespecs(
'App::perlrdf::FileSpec::InputRDF',
input => $opt,
);
@inputs = App::perlrdf::FileSpec::InputRDF->new_from_filespec(
(shift(@$arg) // '-'),
$opt->{input_format},
$opt->{input_base},
) unless @inputs;
my @outputs = $self->get_filespecs(
'App::perlrdf::FileSpec::OutputRDF',
output => $opt,
);
@outputs = App::perlrdf::FileSpec::OutputRDF->new_from_filespec(
(shift(@$arg) // '-'),
$opt->{output_format},
undef,
) unless @outputs;
my $model = RDF::Trine::Model->new;
$_->parse_into_model($model) for @inputs;
skolem $model if $opt->{skolem};
$_->serialize_model($model) for @outputs;
0;
}
1;
Validate.pm 000664 001750 001750 4714 12405262057 21074 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/Command package App::perlrdf::Command::Validate;
use 5.010;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::Command::Validate::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::Command::Validate::VERSION = '0.006';
}
use App::perlrdf -command;
use namespace::clean;
use constant abstract => q (Check syntax of RDF files.);
use constant command_names => qw( validate val );
use constant description => <<'DESCRIPTION';
Given inputs, parses them and reports any errors.
The output conforms to the Test Anything Protocol.
DESCRIPTION
use constant opt_spec => (
[ 'input|i=s@', 'Input filename or URL' ],
[ 'input-spec|I=s@', 'Input file specification' ],
[ 'input-format|p=s', 'Input format (mnemonic: parse)' ],
[ 'input-base|b=s', 'Input base URI' ],
);
use constant usage_desc => '%c validate %o INPUT [INPUT ...]';
sub execute
{
require App::perlrdf::FileSpec::InputRDF;
require RDF::Trine;
require App::perlrdf::DummyModel;
my ($self, $opt, $arg) = @_;
my @inputs = $self->get_filespecs(
'App::perlrdf::FileSpec::InputRDF',
input => $opt,
);
push @inputs, map {
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
$_,
$opt->{input_format},
$opt->{input_base},
)
} @$arg;
push @inputs,
App::perlrdf::FileSpec::InputRDF->new_from_filespec(
'-',
$opt->{input_format},
$opt->{input_base},
)
unless @inputs;
$self->output_tap_header(\@inputs);
for my $in (@inputs)
{
my $model = App::perlrdf::DummyModel::->new;
my $valid = eval {
local $@ = undef;
$in->parse_into_model($model);
1;
};
$self->output_tap_result($in, $valid, $$model);
}
$self->output_tap_footer(\@inputs);
}
sub output_tap_header
{
my ($self, $inputs) = @_;
printf("1..%d\n", scalar @$inputs);
}
sub output_tap_result
{
my ($self, $in, $valid, $size) = @_;
my $parser_name = sub
{
my $f = shift;
my $p = ref($f->parser);
return $1 if $p =~ /^.+::([^:]+?)$/;
return $p;
};
if ($valid)
{
++$self->{tap_pass};
printf(
"ok %d - %s is valid %s, %d triples\n",
++$self->{tap_total},
$in->uri,
$in->$parser_name,
$size,
);
}
else
{
printf(
"not ok %d - %s is broken %s, %d triples before failure\n",
++$self->{tap_total},
$in->uri,
$in->$parser_name,
$size,
);
}
}
sub output_tap_footer
{
my $self = shift;
my $n = $self->{tap_total} - $self->{tap_pass};
$n = 254 if $n > 254;
if ($n)
{
print "# Summary: $self->{tap_pass} ok; $n not ok.\n";
}
exit($n);
}
1;
InputFile.pm 000664 001750 001750 2441 12405262057 21351 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/FileSpec package App::perlrdf::FileSpec::InputFile;
use 5.010;
use autodie;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::FileSpec::InputFile::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::FileSpec::InputFile::VERSION = '0.006';
}
use Moose;
use IO::Scalar;
use Path::Class;
use namespace::clean;
extends 'App::perlrdf::FileSpec';
use constant DEFAULT_STREAM => 'stdin:';
has response => (
is => 'ro',
isa => 'HTTP::Response',
lazy_build => 1,
);
has content => (
is => 'ro',
isa => 'Str',
lazy_build => 1,
);
has handle => (
is => 'ro',
isa => 'Any',
lazy_build => 1,
);
sub _build_response
{
LWP::UserAgent->new->get( shift->uri );
}
sub _build_content
{
my $self = shift;
if (lc $self->uri->scheme eq 'file')
{
return scalar Path::Class::File
-> new($self->uri->file)
-> slurp
}
elsif (lc $self->uri->scheme eq 'stdin')
{
local $/ = ;
return $/;
}
else
{
return $self->response->decoded_content;
}
}
sub _build_handle
{
my $self = shift;
if (lc $self->uri->scheme eq 'file')
{
return Path::Class::File
-> new($self->uri->file)
-> open
}
elsif (lc $self->uri->scheme eq 'stdin')
{
return \*STDIN;
}
else
{
my $data = $self->content;
open my $fh, '<', \$data;
return $fh;
}
}
1;
InputRDF.pm 000664 001750 001750 3566 12405262057 21116 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/FileSpec package App::perlrdf::FileSpec::InputRDF;
use 5.010;
use autodie;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::FileSpec::InputRDF::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::FileSpec::InputRDF::VERSION = '0.006';
}
use Moose;
use RDF::Trine;
use RDF::TriN3;
use RDF::TrineX::Parser::Pretdsl;
use RDF::TrineX::Parser::RDFa;
use RDF::TrineX::Functions -all => { -prefix => 'rdf_' };
use namespace::clean;
extends 'App::perlrdf::FileSpec::InputFile';
has parser => (
is => 'ro',
isa => 'Object|Undef',
lazy_build => 1,
);
sub _build_format
{
my $self = shift;
if (lc $self->uri->scheme eq 'file')
{
return 'RDF::TrineX::Parser::Pretdsl'
if $self->uri->file =~ /\.(pret|pretdsl)/i;
return RDF::Trine::Parser
-> guess_parser_by_filename($self->uri->file);
}
if ($self->can('response'))
{
return $self->response->content_type
if $self->response->content_type;
return 'RDF::TrineX::Parser::Pretdsl'
if (($self->response->base // $self->uri) =~ /\.(pret|pretdsl)/i);
return RDF::Trine::Parser->guess_parser_by_filename(
$self->response->base // $self->uri,
);
}
return 'RDF::TrineX::Parser::Pretdsl'
if $self->uri =~ /\.(pret|pretdsl)/i;
return RDF::Trine::Parser->guess_parser_by_filename($self->uri);
}
sub _build_parser
{
my $self = shift;
my $P = 'RDF::Trine::Parser';
if (blessed $self->format and $self->format->isa($P))
{
return $self->format;
}
if ($self->format =~ m{/})
{
return $P->parser_by_media_type($self->format)->new;
}
if ($self->format =~ m{::})
{
return $self->format->new;
}
if ($self->format =~ m{(pret|pretdsl)}i)
{
return RDF::TrineX::Parser::Pretdsl->new;
}
return $P->new($self->format);
}
sub parse_into_model
{
my ($self, $model, %args) = @_;
rdf_parse(
$self->handle,
base => $self->base,
using => $self->parser,
into => $model,
%args,
)
}
1;
OutputFile.pm 000664 001750 001750 1543 12405262057 21554 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/FileSpec package App::perlrdf::FileSpec::OutputFile;
use 5.010;
use autodie;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::FileSpec::OutputFile::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::FileSpec::OutputFile::VERSION = '0.006';
}
use Moose;
use LWP::UserAgent;
use Path::Class;
use namespace::clean;
extends 'App::perlrdf::FileSpec';
use constant DEFAULT_STREAM => 'stdout:';
has handle => (
is => 'ro',
isa => 'Any',
lazy_build => 1,
);
sub _build_handle
{
my $self = shift;
if (lc $self->uri->scheme eq 'file')
{
return Path::Class::File
-> new($self->uri->file)
-> openw
}
elsif (lc $self->uri->scheme eq 'stdout')
{
return \*STDOUT;
}
elsif (lc $self->uri->scheme eq 'stderr')
{
return \*STDERR;
}
else
{
die sprintf("TODO - '%s' URIs are not supported for output yet", $self->uri->scheme);
}
}
1;
OutputRDF.pm 000664 001750 001750 3650 12405262057 21311 0 ustar 00tai tai 000000 000000 App-perlrdf-0.006/lib/App/perlrdf/FileSpec package App::perlrdf::FileSpec::OutputRDF;
use 5.010;
use autodie;
use strict;
use warnings;
use utf8;
BEGIN {
$App::perlrdf::FileSpec::OutputRDF::AUTHORITY = 'cpan:TOBYINK';
$App::perlrdf::FileSpec::OutputRDF::VERSION = '0.006';
}
use Moose;
use RDF::Trine;
use RDF::TriN3;
use RDF::TrineX::Functions -all => { -prefix => 'rdf_' };
use namespace::clean;
extends 'App::perlrdf::FileSpec::OutputFile';
has serializer => (
is => 'ro',
isa => 'Object|Undef',
lazy_build => 1,
);
sub _build_format
{
my $self = shift;
if (lc $self->uri->scheme eq 'file')
{
return 'RDF::TrineX::Parser::Pretdsl'
if $self->uri->file =~ /\.(pret|pretdsl)/i;
return RDF::Trine::Parser
-> guess_parser_by_filename($self->uri->file);
}
if ($self->can('response'))
{
return $self->response->content_type
if $self->response->content_type;
return 'RDF::TrineX::Parser::Pretdsl'
if (($self->response->base // $self->uri) =~ /\.(pret|pretdsl)/i);
return RDF::Trine::Parser->guess_parser_by_filename(
$self->response->base // $self->uri,
);
}
return 'RDF::TrineX::Parser::Pretdsl'
if $self->uri =~ /\.(pret|pretdsl)/i;
return RDF::Trine::Parser->guess_parser_by_filename($self->uri);
}
sub _build_serializer
{
my $self = shift;
my $P = 'RDF::Trine::Serializer';
if (blessed $self->format and $self->format->isa($P))
{
return $self->format;
}
if ($self->format =~ m{/})
{
my (undef, $s) = $P->negotiate(
request_headers => HTTP::Headers->new(
Accept => $self->format,
),
);
return $s;
}
if ($self->format =~ m{::})
{
(my $class = $self->format)
=~ s/::Parser/::Serializer/;
$class = 'RDF::Trine::Serializer::Turtle'
if $class eq 'RDF::TrineX::Serializer::Pretdsl';
return $class->new;
}
return $P->new($self->format);
}
sub serialize_model
{
my ($self, $model) = @_;
rdf_serialize(
$model,
as => $self->serializer,
to => $self->handle,
)
}
1;