| 1 |
NAME |
| 2 |
XML::Atom::FromOWL - export RDF data to Atom |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
use LWP::UserAgent; |
| 6 |
use XML::Atom::OWL; |
| 7 |
use XML::Atom::FromOWL; |
| 8 |
|
| 9 |
my $ua = LWP::UserAgent->new; |
| 10 |
my $r = $ua->get('http://intertwingly.net/blog/index.atom'); |
| 11 |
my $atomowl = XML::Atom::OWL->new($r->decoded_content, $r->base); |
| 12 |
my $model = $atomowl->consume->graph; ## an RDF::Trine::Model |
| 13 |
|
| 14 |
my $exporter = XML::Atom::FromOWL->new; |
| 15 |
print $_->as_xml |
| 16 |
foreach $exporter->export_feeds($model); |
| 17 |
|
| 18 |
DESCRIPTION |
| 19 |
This module reads RDF and writes Atom feeds. It does the reverse of |
| 20 |
XML::Atom::OWL. |
| 21 |
|
| 22 |
Constructor |
| 23 |
* `new(%options)` |
| 24 |
|
| 25 |
Returns a new XML::Atom::FromOWL object. |
| 26 |
|
| 27 |
There are no valid options at the moment - the hash is reserved for |
| 28 |
future use. |
| 29 |
|
| 30 |
Methods |
| 31 |
* `export_feeds($input, %options)` |
| 32 |
|
| 33 |
Returns a list of feeds found in the input, in no particular order. |
| 34 |
|
| 35 |
The input may be a URI, file name, RDF::Trine::Model or anything else |
| 36 |
that can be handled by the `parse` function of RDF::TrineX::Functions. |
| 37 |
|
| 38 |
Each item in the list returned is an XML::Atom::Feed. |
| 39 |
|
| 40 |
* `export_feed($input, $subject, %options)` |
| 41 |
|
| 42 |
As per `export_feeds` but exports just a single feed. |
| 43 |
|
| 44 |
The subject provided must be an RDF::Trine::Node::Blank or |
| 45 |
RDF::Trine::Node::Resource of type awol:Feed. |
| 46 |
|
| 47 |
* `export_entries($input, %options)` |
| 48 |
|
| 49 |
Returns a list of entries found in the input, in no particular order. |
| 50 |
|
| 51 |
The input may be a URI, file name, RDF::Trine::Model or anything else |
| 52 |
that can be handled by the `parse` function of RDF::TrineX::Functions. |
| 53 |
|
| 54 |
Each item in the list returned is an XML::Atom::Entry. |
| 55 |
|
| 56 |
* `export_entry($input, $subject, %options)` |
| 57 |
|
| 58 |
As per `export_entry` but exports just a single entry. |
| 59 |
|
| 60 |
The subject provided must be an RDF::Trine::Node::Blank or |
| 61 |
RDF::Trine::Node::Resource of type awol:Entry. |
| 62 |
|
| 63 |
RDF Input |
| 64 |
Input is expected to use AtomOwl |
| 65 |
<http://bblfish.net/work/atom-owl/2006-06-06/#>. |
| 66 |
|
| 67 |
Feed Output |
| 68 |
This module doesn't attempt to enforce many of OWL's semantic constraints |
| 69 |
(e.g. it doesn't enforce that an entry has only one title). It relies on |
| 70 |
XML::Atom::Feed and XML::Atom::Entry for that sort of thing, but if your |
| 71 |
input is sensible that shouldn't be a problem. |
| 72 |
|
| 73 |
SEE ALSO |
| 74 |
XML::Atom::OWL, HTML::Microformats, RDF::TrineX::Functions, |
| 75 |
XML::Atom::Feed, XML::Atom::Entry. |
| 76 |
|
| 77 |
<http://bblfish.net/work/atom-owl/2006-06-06/>. |
| 78 |
|
| 79 |
<http://www.perlrdf.org/>. |
| 80 |
|
| 81 |
AUTHOR |
| 82 |
Toby Inkster <[email protected]>. |
| 83 |
|
| 84 |
COPYRIGHT AND LICENCE |
| 85 |
This software is copyright (c) 2011-2012 by Toby Inkster. |
| 86 |
|
| 87 |
This is free software; you can redistribute it and/or modify it under the |
| 88 |
same terms as the Perl 5 programming language system itself. |
| 89 |
|
| 90 |
DISCLAIMER OF WARRANTIES |
| 91 |
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED |
| 92 |
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF |
| 93 |
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
| 94 |
|