CONTRIBUTING000664001750001750 614612406374116 14455 0ustar00taitai000000000000RDF-iCalendar-0.005NAME 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. COPYRIGHT000664001750001750 240012406374117 14104 0ustar00taitai000000000000RDF-iCalendar-0.005Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: RDF-iCalendar Upstream-Contact: Toby Inkster (TOBYINK) Source: https://metacpan.org/release/RDF-iCalendar Files: CONTRIBUTING INSTALL LICENSE TODO examples/example1.pl Copyright: Unknown License: Unknown Files: README lib/RDF/iCalendar.pm lib/RDF/iCalendar/Entity.pm lib/RDF/iCalendar/Exporter.pm lib/RDF/iCalendar/Line.pm Copyright: Copyright 2011, 2013 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: Changes META.json META.yml dist.ini doap.ttl Copyright: Copyright 2014 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: COPYRIGHT CREDITS SIGNATURE Copyright: None License: public-domain Files: Makefile.PL t/02rdf2ical.t Copyright: Copyright 2013 Toby Inkster. License: GPL-1.0+ or Artistic-1.0 Files: t/01basic.t Copyright: Copyright 2011 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 CREDITS000664001750001750 13512406374115 13612 0ustar00taitai000000000000RDF-iCalendar-0.005Maintainer: - Toby Inkster (TOBYINK) Thanks: - JONASS Changes000664001750001750 232112406374115 14104 0ustar00taitai000000000000RDF-iCalendar-0.005RDF-iCalendar ============= Created: 2011-01-21 Home page: Bug tracker: Maintainer: Toby Inkster (TOBYINK) 0.005 2014-09-17 [ Packaging ] - Add IRC link. - Switch to Dist::Inkt. [ Other ] - use warnings 0.004 2013-05-17 [ Bug Fixes ] - Explicitly require RDF::vCard. Fixes RT#85188. JONASS++ - Remove references to paths on TOBYINK's local computer from example script. Fixes RT#78050. JONASS++ - Stop claiming to be able to convert between RDF and iCalendar; right now it's only one-way. Fixes RT#85190. JONASS++ [ Other ] - Added: Add a vaguely decent test case. 0.003 2011-02-04 [ Packaging ] - Module::Package::RDF. [ Other ] - Drop some dependencies. - Various minor cleanups. 0.002 2011-02-04 [ Bug Fixes ] - Minor bugfixes and cleanups. [ Other ] - Added: Support for VALARM. - Added: Support for VFREEBUSY. - Added: Support for VJOURNAL. 0.001 2011-01-23 First release INSTALL000664001750001750 167712406374114 13656 0ustar00taitai000000000000RDF-iCalendar-0.005 Installing RDF-iCalendar should be straightforward. INSTALLATION WITH CPANMINUS If you have cpanm, you only need one line: % cpanm RDF::iCalendar 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 RDF::iCalendar INSTALLATION WITH THE CPAN SHELL Alternatively, if your CPAN shell is set up, you should just be able to do: % cpan RDF::iCalendar 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 RDF-iCalendar: % 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 LICENSE000664001750001750 4365512406374114 13654 0ustar00taitai000000000000RDF-iCalendar-0.005This 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 MANIFEST000664001750001750 44012406374117 13724 0ustar00taitai000000000000RDF-iCalendar-0.005CONTRIBUTING COPYRIGHT CREDITS Changes INSTALL LICENSE MANIFEST META.json META.yml Makefile.PL README SIGNATURE TODO dist.ini doap.ttl examples/example1.pl lib/RDF/iCalendar.pm lib/RDF/iCalendar/Entity.pm lib/RDF/iCalendar/Exporter.pm lib/RDF/iCalendar/Line.pm t/01basic.t t/02rdf2ical.t META.json000664001750001750 442312406374116 14240 0ustar00taitai000000000000RDF-iCalendar-0.005{ "abstract" : "convert from RDF to iCalendar", "author" : [ "Toby Inkster (TOBYINK) " ], "dynamic_config" : 0, "generated_by" : "Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.140640", "keywords" : [ "Directory", "Event", "RDF", "SemWeb", "Semantic Web", "Todo", "hCal", "hCalendar", "iCal", "iCalendar", "vCalendar" ], "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "RDF-iCalendar", "no_index" : { "directory" : [ "eg", "examples", "inc", "t", "xt" ] }, "optional_features" : {}, "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "6.17" } }, "runtime" : { "requires" : { "DateTime" : "0", "RDF::vCard" : "0.010", "perl" : "5.008" } }, "test" : { "requires" : { "Test::More" : "0.61" } } }, "provides" : { "RDF::iCalendar" : { "file" : "lib/RDF/iCalendar.pm", "version" : "0.005" }, "RDF::iCalendar::Entity" : { "file" : "lib/RDF/iCalendar/Entity.pm", "version" : "0.005" }, "RDF::iCalendar::Exporter" : { "file" : "lib/RDF/iCalendar/Exporter.pm", "version" : "0.005" }, "RDF::iCalendar::Line" : { "file" : "lib/RDF/iCalendar/Line.pm", "version" : "0.005" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "http://rt.cpan.org/Dist/Display.html?Queue=RDF-iCalendar" }, "homepage" : "https://metacpan.org/release/RDF-iCalendar", "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "git://github.com/tobyink/p5-rdf-icalendar.git", "web" : "https://github.com/tobyink/p5-rdf-icalendar" }, "x_IRC" : "irc://irc.perl.org/#perlrdf", "x_identifier" : "http://purl.org/NET/cpan-uri/dist/RDF-iCalendar/project" }, "version" : "0.005" } META.yml000664001750001750 262312406374116 14070 0ustar00taitai000000000000RDF-iCalendar-0.005--- abstract: 'convert from RDF to iCalendar' author: - 'Toby Inkster (TOBYINK) ' build_requires: Test::More: '0.61' configure_requires: ExtUtils::MakeMaker: '6.17' dynamic_config: 0 generated_by: 'Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.140640' keywords: - Directory - Event - RDF - SemWeb - 'Semantic Web' - Todo - hCal - hCalendar - iCal - iCalendar - vCalendar license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: RDF-iCalendar no_index: directory: - eg - examples - inc - t - xt optional_features: {} provides: RDF::iCalendar: file: lib/RDF/iCalendar.pm version: '0.005' RDF::iCalendar::Entity: file: lib/RDF/iCalendar/Entity.pm version: '0.005' RDF::iCalendar::Exporter: file: lib/RDF/iCalendar/Exporter.pm version: '0.005' RDF::iCalendar::Line: file: lib/RDF/iCalendar/Line.pm version: '0.005' requires: DateTime: '0' RDF::vCard: '0.010' perl: '5.008' resources: IRC: irc://irc.perl.org/#perlrdf Identifier: http://purl.org/NET/cpan-uri/dist/RDF-iCalendar/project bugtracker: http://rt.cpan.org/Dist/Display.html?Queue=RDF-iCalendar homepage: https://metacpan.org/release/RDF-iCalendar license: http://dev.perl.org/licenses/ repository: git://github.com/tobyink/p5-rdf-icalendar.git version: '0.005' Makefile.PL000664001750001750 1305312406374116 14610 0ustar00taitai000000000000RDF-iCalendar-0.005use strict; use ExtUtils::MakeMaker 6.17; my $EUMM = eval( $ExtUtils::MakeMaker::VERSION ); my $meta = { "abstract" => "convert from RDF to iCalendar", "author" => ["Toby Inkster (TOBYINK) "], "dynamic_config" => 0, "generated_by" => "Dist::Inkt::Profile::TOBYINK version 0.023, CPAN::Meta::Converter version 2.140640", "keywords" => [ "Directory", "Event", "RDF", "SemWeb", "Semantic Web", "Todo", "hCal", "hCalendar", "iCal", "iCalendar", "vCalendar", ], "license" => ["perl_5"], "meta-spec" => { url => "http://search.cpan.org/perldoc?CPAN::Meta::Spec", version => 2, }, "name" => "RDF-iCalendar", "no_index" => { directory => ["eg", "examples", "inc", "t", "xt"] }, "prereqs" => { configure => { requires => { "ExtUtils::MakeMaker" => 6.17 } }, runtime => { requires => { "DateTime" => 0, "perl" => 5.008, "RDF::vCard" => "0.010" }, }, test => { requires => { "Test::More" => 0.61 } }, }, "provides" => { "RDF::iCalendar" => { file => "lib/RDF/iCalendar.pm", version => 0.005 }, "RDF::iCalendar::Entity" => { file => "lib/RDF/iCalendar/Entity.pm", version => 0.005 }, "RDF::iCalendar::Exporter" => { file => "lib/RDF/iCalendar/Exporter.pm", version => 0.005 }, "RDF::iCalendar::Line" => { file => "lib/RDF/iCalendar/Line.pm", version => 0.005 }, }, "release_status" => "stable", "resources" => { bugtracker => { web => "http://rt.cpan.org/Dist/Display.html?Queue=RDF-iCalendar", }, homepage => "https://metacpan.org/release/RDF-iCalendar", license => ["http://dev.perl.org/licenses/"], repository => { type => "git", url => "git://github.com/tobyink/p5-rdf-icalendar.git", web => "https://github.com/tobyink/p5-rdf-icalendar", }, x_identifier => "http://purl.org/NET/cpan-uri/dist/RDF-iCalendar/project", x_IRC => "irc://irc.perl.org/#perlrdf", }, "version" => 0.005, }; 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); README000664001750001750 252012406374114 13471 0ustar00taitai000000000000RDF-iCalendar-0.005NAME RDF::iCalendar - convert from RDF to iCalendar DESCRIPTION This module doesn't do anything itself; it just loads RDF::iCalendar::Exporter for you. RDF::iCalendar::Exporter RDF::iCalendar::Exporter takes some RDF using the W3C's iCalendar vocabulary, and outputs RDF::iCalendar::Entity objects. RDF::iCalendar::Importer RDF::vCard::Importer will do the reverse, but doesn't exist yet. RDF::iCalendar::Entity An RDF::iCalendar::Entity objects is an individual iCalendar calendar. It overloads stringification, so just treat it like a string. RDF::iCalendar::Line RDF::iCalendar::Line is internal fu that you probably don't want to touch. BUGS Please report any bugs to . SEE ALSO . . RDF::vCard. AUTHOR Toby Inkster . COPYRIGHT Copyright 2011, 2013 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. SIGNATURE000664001750001750 364712406374117 14113 0ustar00taitai000000000000RDF-iCalendar-0.005This 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 b6c86935d4ce30a70ba9e48d2dc374b56209f715 COPYRIGHT SHA1 5abeac54ef4164f5931983fe14f0c5fc2ed3ec6b CREDITS SHA1 22446c11790ed8f18fe938e95a86b2587d342a8b Changes SHA1 73e2c1eeb1effd40d60a170ae45ecee185ba68de INSTALL SHA1 34f5e12514b91055de4b164a1f2327ef5c30ba53 LICENSE SHA1 5bfd55191e33a33a9f9ba14eec6363d9784639df MANIFEST SHA1 832431c2f9148b854089e021783cef66383e9d1e META.json SHA1 a3baf83293a34885a8479d24aec872fd32e3586f META.yml SHA1 1f7dc3dc99342062a9d57972703622f50c5f304c Makefile.PL SHA1 5664226eee8b48eadc856f0e07d45cc8823bde49 README SHA1 7d21eb9d82cc0da834f6f8fb3a8688f81d95ce5b TODO SHA1 e7d06ae1517321f1deff880f2db505c296fcc494 dist.ini SHA1 0f993b4453e0ad8fae6fb8a345d725ca588263c5 doap.ttl SHA1 d32e9803f67a72cb912c0e6b735d784db2fb3662 examples/example1.pl SHA1 67bfe4cb50df503aa9d308054cd2d0ebcf4fb36a lib/RDF/iCalendar.pm SHA1 fb58f2ce5332e08310620685bc4a2bb940f34efe lib/RDF/iCalendar/Entity.pm SHA1 bcdc7d0e9bf9cdaf03d7970bd3ae2992d49239b3 lib/RDF/iCalendar/Exporter.pm SHA1 68ff6f014004dfda58e66605ec903199a63c2487 lib/RDF/iCalendar/Line.pm SHA1 c356758da772331ac071f66161248e87968db8b8 t/01basic.t SHA1 7a7256658dad791fca6c9fd2d72aa51765ec37e6 t/02rdf2ical.t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlQZ+E8ACgkQzr+BKGoqfTl6qACguE+zxmJagHlrQ9CKt/PAxkmB 1HoAnAsqgdb7GWQaUFeQ3Wn32G01UNIq =sQBt -----END PGP SIGNATURE----- TODO000664001750001750 21412406374114 13257 0ustar00taitai000000000000RDF-iCalendar-0.005* Still to do: - VTIMEZONE entities - RELATED-TO properties * Need to do more testing and polishing. * And of course iCalendar -> RDF. dist.ini000664001750001750 12712406374114 14236 0ustar00taitai000000000000RDF-iCalendar-0.005;;class='Dist::Inkt::Profile::TOBYINK' ;;name='RDF-iCalendar' ;;skip_whitespace_test=1 doap.ttl000664001750001750 1614112406374116 14307 0ustar00taitai000000000000RDF-iCalendar-0.005@prefix cpan-uri: . @prefix dc: . @prefix doap: . @prefix doap-bugs: . @prefix doap-changeset: . @prefix doap-deps: . @prefix foaf: . @prefix owl: . @prefix rdfs: . @prefix xsd: . a doap:Project; cpan-uri:x_IRC ; dc:contributor ; doap-deps:runtime-requirement [ doap-deps:on "perl 5.008"^^doap-deps:CpanId ], [ doap-deps:on "DateTime"^^doap-deps:CpanId ], [ doap-deps:on "RDF::vCard 0.010"^^doap-deps:CpanId ]; doap-deps:test-requirement [ doap-deps:on "Test::More 0.61"^^doap-deps:CpanId ]; doap:bug-database ; doap:category [ rdfs:label "RDF"@en ], [ rdfs:label "hCalendar"@en ], [ rdfs:label "hCal"@en ], [ rdfs:label "Semantic Web"@en ], [ rdfs:label "SemWeb"@en ], [ rdfs:label "vCalendar"@en ], [ rdfs:label "iCalendar"@en ], [ rdfs:label "iCal"@en ], [ rdfs:label "Directory"@en ], [ rdfs:label "Event"@en ], [ rdfs:label "Todo"@en ]; doap:created "2011-01-21"^^xsd:date; doap:developer ; doap:documenter ; doap:download-page ; doap:homepage ; doap:license ; doap:maintainer ; doap:name "RDF-iCalendar"; doap:programming-language "Perl"; doap:release , , , , ; doap:repository [ a doap:GitRepository; doap:browse ; ]; doap:shortdesc "convert from RDF to iCalendar"@en; doap:tester . a doap:Version; rdfs:label "First release"@en; dc:issued "2011-01-23"^^xsd:date; doap:file-release ; doap:revision "0.001"^^xsd:string. a doap:Version; dc:issued "2011-02-04"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Minor bugfixes and cleanups."; ], [ a doap-changeset:Addition; rdfs:label "Support for VALARM."; ], [ a doap-changeset:Addition; rdfs:label "Support for VJOURNAL."; ], [ a doap-changeset:Addition; rdfs:label "Support for VFREEBUSY."; ]; doap-changeset:versus ; ]; doap:file-release ; doap:revision "0.002"^^xsd:string. a doap:Version; dc:issued "2011-02-04"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ rdfs:label "Drop some dependencies." ], [ rdfs:label "Various minor cleanups." ], [ a doap-changeset:Packaging; rdfs:label "Module::Package::RDF."; ]; doap-changeset:versus ; ]; doap:file-release ; doap:revision "0.003"^^xsd:string. a doap:Version; dc:issued "2013-05-17"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Bugfix; rdfs:label "Stop claiming to be able to convert between RDF and iCalendar; right now it's only one-way."; doap-changeset:fixes ; doap-changeset:thanks ; ], [ a doap-changeset:Bugfix; rdfs:label "Explicitly require RDF::vCard."; doap-changeset:fixes ; doap-changeset:thanks ; ], [ a doap-changeset:Bugfix; rdfs:label "Remove references to paths on TOBYINK's local computer from example script."; doap-changeset:fixes ; doap-changeset:thanks ; ], [ a doap-changeset:Addition; rdfs:label "Add a vaguely decent test case."; ]; doap-changeset:versus ; ]; doap:file-release ; doap:revision "0.004"^^xsd:string. a doap:Version; dc:identifier "RDF-iCalendar-0.005"^^xsd:string; dc:issued "2014-09-17"^^xsd:date; doap-changeset:changeset [ doap-changeset:item [ a doap-changeset:Packaging; rdfs:label "Switch to Dist::Inkt."; ], [ a doap-changeset:Packaging; rdfs:label "Add IRC link."; ], [ a doap-changeset:Change; rdfs:label "use warnings"; ]; ]; doap-changeset:released-by ; doap:file-release ; doap:revision "0.005"^^xsd:string. a foaf:Person; foaf:nick "JONASS"; foaf:page . a foaf:Person; foaf:homepage ; foaf:mbox ; foaf:name "Toby Inkster"; foaf:nick "TOBYINK"; foaf:page ; owl:sameAs . a doap-bugs:Issue; doap-bugs:id "78050"^^xsd:string; doap-bugs:page . a doap-bugs:Issue; doap-bugs:id "85188"^^xsd:string; doap-bugs:page . a doap-bugs:Issue; doap-bugs:id "85190"^^xsd:string; doap-bugs:page . example1.pl000664001750001750 1027112406374114 16522 0ustar00taitai000000000000RDF-iCalendar-0.005/examplesuse HTML::Microformats; use RDF::TrineX::Functions -shortcuts; use RDF::iCalendar::Exporter; my $hcalendar = <<'HTML';
Foo 2011-02-02
I'm busy some times busy 19980415T133000Z/19980415T170000Z 19990415T133000Z/19990415T170000Z

Christmas Schedule

Yearly period of festive merriment.

Required for merriment:
Santa Claus (North Pole)

12;34

Shopping

In December, don't forget to buy everyone their presents before the shops shut on Christmas Eve! attachment
Reminder! -PT12H

Jones' Christmas Lunch

The Joneses have been having a wonderful lunch every year at 1pm for the last few years.

Everyone's invited.

Foo Bar Baz

Jones Household Lewes East Sussex

Boxing Day

Every year the day after Christmas is Boxing Day. Nobody knows quite why this day is called that.

required

Lewes East Sussex

Our organisation has been offering a series of summer lectures since January 1997. They are held yearly, every 2nd year (1999, 2001, etc), every Sunday in January at 8:30 and repeated at 9:30.

HTML my $doc = HTML::Microformats->new_document($hcalendar, 'http://hcal.example.net/')->assume_all_profiles; my @objects = $doc->objects('hCalendar'); print $objects[0]->to_icalendar; #print rdf_string($doc->model =>'RDFXML'); #print "========\n"; #my @cals = RDF::iCalendar::Exporter->new->export_calendars($doc->model); #print "========\n"; #print $_ foreach @cals ; 01basic.t000664001750001750 11212406374114 14436 0ustar00taitai000000000000RDF-iCalendar-0.005/tuse Test::More tests => 1; BEGIN { use_ok('RDF::iCalendar::Exporter') }; 02rdf2ical.t000664001750001750 4740712406374114 15126 0ustar00taitai000000000000RDF-iCalendar-0.005/tuse strict; use warnings; use Test::More; use RDF::iCalendar; my $ri = "RDF::iCalendar::Exporter"->new; my @cals = $ri->export_calendars([\*DATA, as => "RDFXML", base => "http://localhost/"]); is( scalar(@cals), 1, 'one calendar returned', ); my @components = @{ $cals[0]->components }; is( scalar(@components), 7, '... which contains seven components', ); my ($xmas) = grep $_->matches(UID => qr{^http://hcal\.example\.net/#xmas$}), @components; ok( defined $xmas, '... one of which is Christmas!' ); $xmas =~ s/\r\n/\n/g; is($xmas, <<'XMAS', 'Christmas stringifies!!!'); BEGIN:VEVENT ATTENDEE;CN=Santa Claus;CUTYPE=individual;ROLE="Required for mer riment:";VALUE=TEXT:Santa Claus COMMENT:Yearly period of festive merriment. DTSTART;VALUE=DATE:00011225 GEO:12;34 LOCATION:12\;34 RRULE;VALUE=RECUR:FREQ=YEARLY SUMMARY:Christmas UID;VALUE=URI:http://hcal.example.net/#xmas END:VEVENT XMAS done_testing; __DATA__ Jones Household Lewes East Sussex Lewes East Sussex 12 34 Reminder! -PT12H 2011-02-02 2011-02-02 Foo 2011-02-02 2011-02-02 2011-02-02 Foo http://hcal.example.net/#fooble Yearly period of festive merriment. 0001-12-25 12;34 Christmas individual Santa Claus Santa Claus Santa Required for merriment: Santa Claus Claus Santa FREQ=YEARLY YEARLY Bar Baz Foo The Joneses have been having a wonderful lunch every year at 1pm for the last few years. 2003-12-25T13:00:00+0000 Jones' Christmas Lunch Everyone Everyone Everyone location Jones Household Jones Household Jones Household Foo Foo Foo FREQ=YEARLY YEARLY Every year the day after Christmas is Boxing Day. Nobody knows quite why this day is called that. 0001-12-26 Boxing Day individual Alice Jones Alice Jones required Alice Jones individual Bob Jones Bob Jones Bob Jones Jones Bob Jones Alice FREQ=YEARLY YEARLY 1997-01-05T08:30:00 summer lectures FREQ=YEARLY;BYMINUTE=30;BYHOUR=8,9;BYMONTH=1;BYDAY=SU;INTERVAL=2 SU 8,9 30 1 YEARLY 2 2008-12-01 2008-12-24T16:00:00 buy everyone their presents 2008-12-01 buy everyone their presents I'm busy some times 12 34 http://hcal.example.net/#xmas sibling 1998-04-15T13:30:00+0000/PT12600S 1999-04-15T13:30:00+0000/PT12600S busy attachment attachment 12 34 iCalendar.pm000664001750001750 312212406374114 16211 0ustar00taitai000000000000RDF-iCalendar-0.005/lib/RDFpackage RDF::iCalendar; use 5.008; use strict; use warnings; no warnings qw(uninitialized); use RDF::iCalendar::Exporter; BEGIN { $RDF::iCalendar::AUTHORITY = 'cpan:TOBYINK'; $RDF::iCalendar::VERSION = '0.005'; } 1; __END__ =head1 NAME RDF::iCalendar - convert from RDF to iCalendar =head1 DESCRIPTION This module doesn't do anything itself; it just loads RDF::iCalendar::Exporter for you. =head2 RDF::iCalendar::Exporter L takes some RDF using the W3C's iCalendar vocabulary, and outputs L objects. =head2 RDF::iCalendar::Importer B will do the reverse, but doesn't exist yet. =head2 RDF::iCalendar::Entity An L objects is an individual iCalendar calendar. It overloads stringification, so just treat it like a string. =head2 RDF::iCalendar::Line L is internal fu that you probably don't want to touch. =head1 BUGS Please report any bugs to L. =head1 SEE ALSO L. L. L. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT Copyright 2011, 2013 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. Entity.pm000664001750001750 154512406374114 17474 0ustar00taitai000000000000RDF-iCalendar-0.005/lib/RDF/iCalendarpackage RDF::iCalendar::Entity; use 5.008; use base qw[RDF::vCard::Entity]; use strict; use warnings; no warnings qw(uninitialized); our $VERSION = '0.005'; 1; __END__ =head1 NAME RDF::iCalendar::Entity - represents an iCalendar calendar, event, todo, etc. =head1 DESCRIPTION This is a trivial subclass of L. =head1 SEE ALSO L, L. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT Copyright 2011, 2013 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. Exporter.pm000664001750001750 6036212406374114 20052 0ustar00taitai000000000000RDF-iCalendar-0.005/lib/RDF/iCalendarpackage RDF::iCalendar::Exporter; use 5.008; use base qw[RDF::vCard::Exporter]; use strict; use warnings; no warnings qw(uninitialized); use DateTime; use MIME::Base64 qw[]; use RDF::iCalendar::Entity; use RDF::iCalendar::Line; use RDF::TrineX::Functions -shortcuts, statement => { -as => 'rdf_statement' }, iri => { -as => 'rdf_resource' }; use Scalar::Util qw[blessed]; use URI; require RDF::vCard; # kinda constants sub I { return 'http://www.w3.org/2002/12/cal/icaltzd#' . shift; } sub IX { return 'http://buzzword.org.uk/rdf/icaltzdx#' . shift; } sub RDF { return 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' . shift; } sub V { return 'http://www.w3.org/2006/vcard/ns#' . shift; } sub VX { return 'http://buzzword.org.uk/rdf/vcardx#' . shift; } sub XSD { return 'http://www.w3.org/2001/XMLSchema#' . shift; } sub flatten_node { my $node = shift; return $node->value if $node->is_resource || $node->is_literal; return $node->as_ntriples; } use namespace::clean; our $VERSION = '0.005'; our $PRODID = sprintf("+//IDN cpan.org//NONSGML %s v %s//EN", __PACKAGE__, $VERSION); our %cal_dispatch = ( ); our %dispatch = ( IX('contact') => \&_prop_export_contact, I('contact') => \&_prop_export_contact, I('geo') => \&_prop_export_geo, IX('organizer') => \&_prop_export_Person, I('organizer') => \&_prop_export_Person, IX('attendee') => \&_prop_export_Person, I('attendee') => \&_prop_export_Person, I('attach') => \&RDF::vCard::Exporter::_prop_export_binary, I('dtstart') => \&_prop_export_DateTime, I('dtend') => \&_prop_export_DateTime, I('due') => \&_prop_export_DateTime, I('completed') => \&_prop_export_DateTime, I('created') => \&_prop_export_DateTime, I('dtstamp') => \&_prop_export_DateTime, I('last-modified') => \&_prop_export_DateTime, IX('location') => \&_prop_export_location, I('location') => \&_prop_export_location, I('rrule') => \&_prop_export_Recur, I('exrule') => \&_prop_export_Recur, I('valarm') => \&_prop_export_valarm, I('freebusy') => \&_prop_export_freebusy, # RELATED-TO ); our %list_dispatch = ( I('exdate') => ['exdate', \&_value_export_DateTime], I('rdate') => ['rdate', \&_value_export_DateTime], I('resources') => ['resources', \&_value_export_category], I('categories') => ['categories', \&_value_export_category], I('category') => ['categories', \&_value_export_category], IX('category') => ['categories', \&_value_export_category], ); sub _rebless { my ($self, $thing) = @_; if ($thing->isa('RDF::vCard::Line')) { return bless $thing, 'RDF::iCalendar::Line'; } if ($thing->isa('RDF::vCard::Entity')) { return bless $thing, 'RDF::iCalendar::Entity'; } } sub _debug { # my ($self, @debug) = @_; # printf(@debug); # print "\n"; } sub export_cards # need to really use superclass for these { my ($self, $model, %options) = @_; return RDF::vCard::Exporter->new->export_cards($model, %options); } sub export_card # need to really use superclass for these { my ($self, $model, $subject, %options) = @_; return RDF::vCard::Exporter->new->export_card($model, $subject, %options); } sub export_calendars { my ($self, $model, %options) = @_; $model = rdf_parse($model) unless blessed($model) && $model->isa('RDF::Trine::Model'); my @subjects = $model->subjects(rdf_resource(RDF('type')), rdf_resource(I('Vcalendar'))); push @subjects, $model->subjects(rdf_resource(I('component')), undef); my %subjects = map { flatten_node($_) => $_ } @subjects; my @cals; foreach my $s (values %subjects) { push @cals, $self->export_calendar($model, $s, %options); } if ($options{sort}) { return sort { $a->entity_order cmp $b->entity_order } @cals; } return @cals; } sub export_calendar { my ($self, $model, $subject, %options) = @_; $model = RDF::TrineShortcuts::rdf_parse($model) unless blessed($model) && $model->isa('RDF::Trine::Model'); my $ical = RDF::iCalendar::Entity->new( profile=>'VCALENDAR' ); my %categories; my $triples = $model->get_statements($subject, undef, undef); while (my $triple = $triples->next) { # next # unless (substr($triple->predicate->uri, 0, length(&I)) eq &I or # substr($triple->predicate->uri, 0, length(&IX)) eq &IX); if ($triple->predicate->uri eq I('component')) { $ical->add_component($self->export_component($model, $triple->object)); } elsif (defined $cal_dispatch{$triple->predicate->uri} and ref($cal_dispatch{$triple->predicate->uri}) eq 'CODE') { my $code = $cal_dispatch{$triple->predicate->uri}; my $r = $code->($self, $model, $triple); if (blessed($r) and $r->isa('RDF::iCalendar::Line')) { $ical->add($r); } elsif (blessed($r) and $r->isa('RDF::iCalendar::Entity')) { $ical->add_component($r); } } elsif ((substr($triple->predicate->uri, 0, length(&I)) eq &I or substr($triple->predicate->uri, 0, length(&IX)) eq &IX)) { $ical->add($self->_prop_export_simple($model, $triple)) unless $triple->object->is_blank; } } $ical->add( RDF::iCalendar::Line->new( property => 'version', value => '2.0', ) ); $ical->add( RDF::iCalendar::Line->new( property => 'prodid', value => (defined $options{prodid} ? $options{prodid} : $PRODID), ) ) unless exists $options{prodid} && !defined $options{prodid}; $ical->add( RDF::iCalendar::Line->new( property => 'source', value => $options{source}, type_parameters => {value=>'URI'}, ) ) if defined $options{source}; return $ical; } sub export_component { my ($self, $model, $subject, %options) = @_; $model = RDF::TrineShortcuts::rdf_parse($model) unless blessed($model) && $model->isa('RDF::Trine::Model'); my $profile = 'VEVENT'; $profile = 'VTIMEZONE' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Vtimezone'))); $profile = 'VFREEBUSY' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Vfreebusy'))); $profile = 'VALARM' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Valarm'))); $profile = 'VJOURNAL' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Vjournal'))); $profile = 'VTODO' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Vtodo'))); $profile = 'VEVENT' if $model->count_statements($subject, rdf_resource(RDF('type')), rdf_resource(I('Vevent'))); my $c = RDF::iCalendar::Entity->new( profile=>$profile ); $self->_debug("COMPONENT: %s", flatten_node($subject)); my $lists = {}; my $triples = $model->get_statements($subject, undef, undef); while (my $triple = $triples->next) { $self->_debug(" %s %s", $triple->predicate->sse, $triple->object->sse); if (defined $dispatch{$triple->predicate->uri} and ref($dispatch{$triple->predicate->uri}) eq 'CODE') { $self->_debug(" -> dispatch"); my $code = $dispatch{$triple->predicate->uri}; my $r = $code->($self, $model, $triple); if (blessed($r) and $r->isa('RDF::iCalendar::Line')) { $c->add($r); } elsif (blessed($r) and $r->isa('RDF::iCalendar::Entity')) { $c->add_component($r); } } elsif (defined $list_dispatch{$triple->predicate->uri} and ref($list_dispatch{$triple->predicate->uri}) eq 'ARRAY') { $self->_debug(" -> list_dispatch"); my ($listname, $code) = @{ $list_dispatch{$triple->predicate->uri} }; push @{ $lists->{$listname} }, $code->($self, $model, $triple); } elsif ((substr($triple->predicate->uri, 0, length(&I)) eq &I or substr($triple->predicate->uri, 0, length(&IX)) eq &IX)) { $self->_debug(" -> default"); $c->add($self->_prop_export_simple($model, $triple)) unless $triple->object->is_blank; } else { $self->_debug(" -> NO ACTION"); } } foreach my $listname (keys %$lists) { $c->add(RDF::iCalendar::Line->new( property => $listname, value => [[ sort keys %{{ map { $_ => 1 } @{$lists->{$listname}} }} ]], )); } return $c; } sub _prop_export_valarm { my ($self, $model, $triple) = @_; unless ($triple->object->is_literal) { return $self->export_component($model, $triple->object); } } sub _prop_export_simple { my ($self, $model, $triple) = @_; my $rv = $self->SUPER::_prop_export_simple($model, $triple); return $self->_rebless($rv); } # iCalendar forces different datetime/date formats than # the generalised text/directory ones used by vCard... sub _prop_export_DateTime { my ($self, $model, $triple) = @_; my $prop = 'x-data'; if ($triple->predicate->uri =~ m/([^\#\/]+)$/) { $prop = $1; } my $val = undef; my $params = undef; my ($dt, $has_time) = $self->_node2dt($triple->object, $model); my $tz = $dt->time_zone; if ($dt and $has_time) { $params = { value=>'DATE-TIME' }; unless ($tz->is_floating || $tz->is_utc || $tz->is_olson ) { $dt = $dt->clone->set_time_zone('UTC'); $tz = $dt->time_zone; } $val = sprintf('%04d%02d%02dT%02d%02d%02d', $dt->year, $dt->month, $dt->day, $dt->hour, $dt->minute, $dt->second); if ($tz->is_utc) { $val .= "Z"; } elsif (!$tz->is_floating) { $params->{tzid} = $tz->name; } } elsif ($dt) { $params = { value=>'DATE' }; unless ($tz->is_floating || $tz->is_utc || $tz->is_olson ) { $dt = $dt->clone->set_time_zone('UTC'); $tz = $dt->time_zone; } $val = sprintf('%04d%02d%02d', $dt->year, $dt->month, $dt->day); } return RDF::iCalendar::Line->new( property => $prop, value => $val, type_parameters => $params, ); } sub _node2dt { my ($self, $node, $model) = @_; # Shouldn't happen! return DateTime->now unless $node->is_literal; my ($date, $time) = split /T/i, $node->literal_value; my $has_time = (defined $time and length $time); my $dt; if ($date =~ m'^([0-9]{4})\-?([0-9]{2})\-?([0-9]{2})$') { $dt = DateTime->new(year => $1, month => $2, day => $3); } elsif ($date =~ m'^([0-9]{1,4})\-([0-9]{1,2})\-([0-9]{1,2})$') { $dt = DateTime->new(year => $1, month => $2, day => $3); } else { $dt = DateTime->now; } my $zone; if ($time =~ /^(.+)(Z|[\+\-]00\:?00])$/i) { $time = $1; $zone = DateTime::TimeZone->new(name => 'UTC'); } elsif ($time =~ /^(.+)([\+\-][0-9][0-9]\:?[0-9][0-9])$/i) { $time = $1; $zone = DateTime::TimeZone->new(name => $2); } elsif ($node->has_datatype and $node->literal_datatype =~ m'^http://www\.w3\.org/2002/12/cal/tzd/(.+)#tz$') { $zone = DateTime::TimeZone->new(name => $1); } elsif ($node->has_datatype and $node->literal_datatype !~ m'^http://www\.w3\.org/2001/XMLSchema#' and defined $model) { # Some funny datatype; let's try our best! my @locations = grep { $_->is_literal } $model->objects( rdf_resource($node->literal_datatype), rdf_resource('http://www.w3.org/2002/12/cal/prod/Ximian_NON_de8f2a9bed573980#location'), rdf_resource(RDF('value')), rdf_resource(RDFS('label')), ); $zone = DateTime::TimeZone->new(name => $locations[0]->literal_value) if @locations; } $dt->set_time_zone($zone) if $zone; if ($time =~ m'^([0-2][0-9])\:?([0-5][0-9])\:?([0-6][0-9](\.[0-9]*)?)?$') { $dt->set_hour($1)->set_minute($2); $dt->set_second($3) if defined $3; } elsif ($time =~ m'^([0-2]?[0-9])\:([0-5]?[0-9])\:([0-6]?[0-9](\.[0-9]*)?)$') { $dt->set_hour($1)->set_minute($2)->set_second($3); } elsif ($time =~ m'^([0-2]?[0-9])\:([0-5]?[0-9])\:?$') { $dt->set_hour($1)->set_minute($2); } return ($dt, $has_time); } sub _prop_export_contact { my ($self, $model, $triple) = @_; if ($triple->object->is_literal) { return $self->_prop_export_simple($model, $triple); } my $card = $self->export_card($model, $triple->object); my $uri = URI->new('data:'); $uri->media_type('text/directory'); $uri->data("$card"); my $label = ''; my ($fn) = $card->get('fn'); my ($email) = $card->get('email'); if ($fn and $email) { $label = sprintf('%s <%s>', $fn->_unescape_value($fn->value_to_string), $email->_unescape_value($email->value_to_string), ); } elsif ($fn) { $label = $fn->_unescape_value($fn->value_to_string); } elsif ($email) { $label = $email->_unescape_value($email->value_to_string); } return RDF::iCalendar::Line->new( property => 'contact', value => $label, type_parameters => { altrep => "\"$uri\"", }, ); } sub _prop_export_location { my ($self, $model, $triple) = @_; $self->_debug(" Location: %s", flatten_node($triple->object)); if ($triple->object->is_literal) { $self->_debug(" -> literal"); return $self->_prop_export_simple($model, $triple); } if ($model->count_statements( $triple->object, rdf_resource(RDF('type')), rdf_resource(V('VCard')), ) or $model->count_statements( $triple->object, rdf_resource(V('fn')), undef, ) ) { $self->_debug(" -> vcard"); my $card = $self->export_card($model, $triple->object); return RDF::iCalendar::Line->new( property => 'location', value => "$card", type_parameters => { value => "VCARD", }, ); } elsif ($model->count_statements( $triple->object, rdf_resource(RDF('type')), rdf_resource(V('Address')), ) or $model->count_statements( $triple->object, rdf_resource(V('locality')), undef, ) or $model->count_statements( $triple->object, rdf_resource(V('street-address')), undef, ) ) { $self->_debug(" -> adr"); my $line = $self->_rebless( $self->_prop_export_adr($model, $triple) ); $line->{property} = 'location'; return $line; } elsif ($model->count_statements( $triple->object, rdf_resource(RDF('type')), rdf_resource(V('Location')), ) or $model->count_statements( $triple->object, rdf_resource(V('latitude')), undef, ) ) { $self->_debug(" -> geo"); my $line = $self->_rebless( $self->SUPER::_prop_export_geo($model, $triple) ); $line->{property} = 'location'; return $line; } return $self->_prop_export_simple($model, $triple); } sub _prop_export_geo { my ($self, $model, $triple) = @_; if ($triple->object->is_literal) { return $self->_prop_export_simple($model, $triple); } elsif ($triple->object->is_resource and $triple->object->uri =~ /^geo:(.+)$/i) { my $g = $1; return RDF::iCalendar::Line->new( property => 'geo', value => [ split /[,;]/, $g, 2 ], ); } my ($lat, $lon); { my @latitudes = grep { $_->is_literal } $model->objects($triple->object, rdf_resource(RDF('first'))); $lat = $latitudes[0]->literal_value if @latitudes; my @nodes = grep { !$_->is_literal } $model->objects($triple->object, rdf_resource(RDF('next'))); if (@nodes) { my @longitudes = grep { $_->is_literal } $model->objects($nodes[0], rdf_resource(RDF('first'))); $lon = $longitudes[0]->literal_value if @longitudes; } } return RDF::iCalendar::Line->new( property => 'geo', value => [$lat||0, $lon||0], ); } sub _prop_export_Person { my ($self, $model, $triple) = @_; if ($triple->object->is_literal) { return $self->_prop_export_simple($model, $triple); } my $property = { I('organizer') => 'organizer', IX('organizer') => 'organizer', I('attendee') => 'attendee', IX('attendee') => 'attendee', }->{ $triple->predicate->uri }; my ($name, $email, $role, $partstat, $rsvp, $cutype, %thing_values); my %thing_meta = ( 'sent-by' => [map {rdf_resource($_)} IX('sentBy'), I('sent-by')], 'delegated-to' => [map {rdf_resource($_)} IX('delegatedTo'), I('delegated-to')], 'delegated-from' => [map {rdf_resource($_)} IX('delegatedFrom'), I('delegated-from')], ); if ($triple->object->is_resource and $triple->object->uri =~ /^mailto:.+$/i) { $email = $triple->object->uri; } else { ($name) = grep { $_->is_literal } $model->objects_for_predicate_list($triple->object, rdf_resource(IX('cn')), rdf_resource(V('fn'))); ($role) = grep { $_->is_literal } $model->objects_for_predicate_list($triple->object, rdf_resource(V('role')), rdf_resource(I('role')), rdf_resource(IX('role'))); ($partstat) = grep { $_->is_literal } $model->objects_for_predicate_list($triple->object, rdf_resource(I('partstat')), rdf_resource(IX('partstat'))); ($rsvp) = grep { $_->is_literal } $model->objects_for_predicate_list($triple->object, rdf_resource(I('rsvp')), rdf_resource(IX('rsvp'))); ($cutype) = grep { $_->is_literal } $model->objects_for_predicate_list($triple->object, rdf_resource(VX('kind')), rdf_resource(I('cutype')), rdf_resource(IX('cutype'))); ($email) = $model->objects($triple->object, rdf_resource(V('email'))); if ($email and ($email->is_blank or ($email->is_resource and $email->uri !~ /^mailto:/i))) { ($email) = grep { !$_->is_blank } $model->objects($email, rdf_resource(RDF('value'))); } # This bit doesn't just work for sent-by, but also delegated-from/delegated-to while (my ($P, $X) = each %thing_meta) { my ($sentby) = $model->objects_for_predicate_list($triple->object, @$X); # if $sentby isn't an email address if (!defined $sentby) {} elsif ($sentby->is_blank or $sentby->is_resource && $sentby->uri !~ /^mailto:/i) { # Maybe it's a vcard:Email resource; if so, then get the rdf:value. my ($value) = grep { !$_->is_blank } $model->objects($triple->object, rdf_resource(RDF('value'))); if ($value) { $sentby = $value; } # If it's not then it might be a vcard:VCard... else { my ($sb_email) = $model->objects($sentby, rdf_resource(V('email'))); if (!defined $sb_email) {} elsif ($sb_email->is_literal or $sb_email->is_resource && $sb_email->uri !~ /^mailto:/i) { $sentby = $sb_email; } else { my ($value) = grep { !$_->is_blank } $model->objects($sb_email, rdf_resource(RDF('value'))); if ($value) { $sentby = $value; } } } } $thing_values{$P} = $sentby if $sentby; } } my %params = (); $params{'cn'} = flatten_node($name) if defined $name; foreach my $P (keys %thing_meta) { $params{$P} = flatten_node($thing_values{$P}) if defined $thing_values{$P}; } $params{'cutype'} = flatten_node($cutype) if (defined $cutype and $property eq 'attendee'); $params{'partstat'} = flatten_node($partstat) if (defined $partstat and $property eq 'attendee'); $params{'role'} = flatten_node($role) if (defined $role and $property eq 'attendee'); $params{'rsvp'} = flatten_node($rsvp) if (defined $rsvp and $property eq 'attendee'); $params{'value'} = 'CAL-ADDRESS'; if (!$email) { $email = $name; $params{'value'} = 'TEXT'; } return RDF::iCalendar::Line->new( property => $property, value => flatten_node($email), type_parameters => \%params, ); } sub _value_export_simple { my ($self, $model, $triple) = @_; my $rv = $self->_prop_export_simple($model, $triple); return $rv->_unescape_value($rv->value_to_string); } sub _value_export_DateTime { my ($self, $model, $triple) = @_; my $rv = $self->_prop_export_DateTime($model, $triple); return $rv->_unescape_value($rv->value_to_string); } sub _value_export_category { my ($self, $model, $triple) = @_; if ($triple->object->is_literal) { return uc $triple->object->literal_value; } my @labels = grep { $_->is_literal } $model->objects_for_predicate_list( $triple->object, rdf_resource('http://www.w3.org/2004/02/skos/core#prefLabel'), rdf_resource('http://www.holygoat.co.uk/owl/redwood/0.1/tags/name'), rdf_resource('http://www.w3.org/2000/01/rdf-schema#label'), rdf_resource('http://www.w3.org/2004/02/skos/core#altLabel'), rdf_resource('http://www.w3.org/2004/02/skos/core#notation'), rdf_resource(RDF('value')), ); if (@labels) { return uc $labels[0]->literal_value; } elsif ($triple->object->is_resource) { return $triple->object->uri; } } sub _prop_export_Recur { my ($self, $model, $triple) = @_; my $prop = 'x-data'; if ($triple->predicate->uri =~ m/([^\#\/]+)$/) { $prop = $1; } if ($triple->object->is_literal) { return $self->_prop_export_simple($model, $triple); } my (%bits, @bits); my $iter = $model->get_statements($triple->object, undef, undef); while (my $st = $iter->next) { if ($st->predicate->uri =~ m'^http://www\.w3\.org/2002/12/cal/icaltzd#(.+)$') { my $p = uc $1; my $v = ($p eq 'UNITL') ? $self->_value_export_DateTime($model, $st) : flatten_node($st->object); push @{ $bits{$p} }, $v; } } while (my ($k, $v) = each %bits) { push @bits, sprintf('%s=%s', $k, join(',', @$v)); } return RDF::iCalendar::Line->new( property => $prop, value => [ map { [ split /,/, $_ ] } @bits ], type_parameters => { value => 'RECUR' }, ); } sub _prop_export_freebusy { my ($self, $model, $triple) = @_; if ($triple->object->is_literal) { return RDF::iCalendar::Line->new( property => 'freebusy', value => $triple->object->literal_value, type_parameters => { fbtype => 'BUSY' }, ); } my @values = sort map { $_->literal_value } grep { $_->is_literal } $model->objects_for_predicate_list( $triple->object, rdf_resource(RDF('value')), ); my ($fbtype) = map { uc $_->literal_value } grep { $_->is_literal } $model->objects_for_predicate_list( $triple->object, rdf_resource(I('fbtype')), rdf_resource(IX('fbtype')), ); return RDF::iCalendar::Line->new( property => 'freebusy', value => [[ @values ]], type_parameters => { fbtype => $fbtype || 'BUSY' }, ); } 1; __END__ =head1 NAME RDF::iCalendar::Exporter - export RDF data to iCalendar format =head1 SYNOPSIS use RDF::iCalendar; my $input = "http://example.com/calendar-data.ics"; my $exporter = RDF::iCalendar::Exporter->new; print $_ foreach $exporter->export_calendars($input); =head1 DESCRIPTION This module reads RDF and writes iCalendar files. This is a subclass of RDF::vCard::Exporter, so it can also export vCards. =head2 Constructor =over =item * C<< new(%options) >> Returns a new RDF::iCalendar::Exporter object. There are no valid options at the moment - the hash is reserved for future use. =back =head2 Methods =over =item * C<< export_calendars($input, %options) >> Returns a list of iCalendars found in the input, in no particular order. The input may be a URI, file name, L or anything else that can be handled by the C method of L. Each item in the list returned is an L, though that class overloads stringification, so you can just treat each item as a string mostly. =item * C<< export_calendar($input, $subject, %options) >> As per C but exports just a single calendar. The subject provided must be an RDF::Trine::Node::Blank or RDF::Trine::Node::Resource of type icaltzd:Vcalendar. =item * C<< export_component($input, $subject, %options) >> Exports a component from a calendar - e.g. a single VEVENT The subject provided must be an RDF::Trine::Node::Blank or RDF::Trine::Node::Resource of type icaltzd:Vevent, icaltzd:Vtodo or similar. =item * C<< export_cards($input, %options) >> See L. =item * C<< export_card($input, $subject, %options) >> See L. =back =head2 RDF Input Input is expected to use the newer of the 2005 revision of the W3C's vCard vocabulary L. (Note that even though this was revised in 2005, the term URIs include "2002" in them.) Some extensions from the namespace L are also supported. =head2 iCalendar Output The output of this module aims at iCalendar (RFC 2445) compliance. In the face of weird input data though, (e.g. an DTSTART property that is a URI instead of a literal) it can pretty easily descend into exporting junk, non-compliant iCalendars. The output has barely been tested in any iCalendar-supporting software, so beware. =head1 SEE ALSO L. L, L, L. L. L. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT Copyright 2011, 2013 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. Line.pm000664001750001750 150712406374114 17105 0ustar00taitai000000000000RDF-iCalendar-0.005/lib/RDF/iCalendarpackage RDF::iCalendar::Line; use 5.008; use base qw[RDF::vCard::Line]; use strict; use warnings; no warnings qw(uninitialized); our $VERSION = '0.005'; 1; __END__ =head1 NAME RDF::iCalendar::Line - represents a line within a vCard =head1 DESCRIPTION This is a trivial subclass of L. =head1 SEE ALSO L, L. =head1 AUTHOR Toby Inkster Etobyink@cpan.orgE. =head1 COPYRIGHT Copyright 2011, 2013 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.