XML::A...romOWL(3pm)
β¨ NAME β¨
XML::Atom::FromOWL β bestie, this is the module that takes your RDF data and turns it into Atom. Exporting, slaying, the whole thing π
π¦ SYNOPSIS π¦
okay so here's the vibe, literally copy-paste core:
use LWP::UserAgent;
use XML::Atom::OWL;
use XML::Atom::FromOWL;
my $ua = LWP::UserAgent->new;
my $r = $ua->get('http://intertwingly.net/blog/index.atom');
my $atomowl = XML::Atom::OWL->new($r->decoded_content, $r->base);
my $model = $atomowl->consume->graph; ## an RDF::Trine::Model
my $exporter = XML::Atom::FromOWL->new;
print $_->as_xml
foreach $exporter->export_feeds($model);
like. that's it. that's the whole flex πΈ
π DESCRIPTION π
This module reads RDF and writes Atom feeds. It's the reverse of XML::Atom::OWL, no cap β that one goes Atom β‘οΈ RDF, this one goes RDF β‘οΈ Atom. Iconic behaviour, honestly.
π Constructor π
new(%options)β hands you back a shiny newXML::Atom::FromOWLobject.
Real talk though: there are no valid options at the moment β the hash is just sitting there, reserved for future use. It's giving "placeholder main character" energy. π
π Methods π
export_feeds($input, %options)β returns a list of feeds found in the input, in no particular order (so don't come for me about ordering, bestie).
The $input can be a URI, a file name, an RDF::Trine::Model, or literally anything else that the parse function of RDF::TrineX::Functions can handle. It's flexible like that π
Every item in the list you get back is an XML::Atom::Feed.
export_feed($input, $subject, %options)β same asexport_feedsbut it exports just a single feed. One (1) feed. Minimalist queen.
The $subject you pass in has to be an RDF::Trine::Node::Blank or RDF::Trine::Node::Resource of type awol:Feed. No random subjects, we're being picky β¨
export_entries($input, %options)β returns a list of entries found in the input, again in no particular order.
The $input may be a URI, a file name, an RDF::Trine::Model, or anything else the parse function of RDF::TrineX::Functions handles.
Each item in the list returned is an XML::Atom::Entry.
export_entry($input, $subject, %options)β as perexport_entrybut exports just a single entry. (yes, the original saysexport_entrythere, I'm not gonna gaslight you β I'm keeping it exactly how it was written π«Ά)
The $subject provided must be an RDF::Trine::Node::Blank or RDF::Trine::Node::Resource of type awol:Entry.
π§ RDF Input π§
Input is expected to use AtomOwl β <http://bblfish.net/work/atom-owl/2006-06-06/#>. That's the lore, that's the source. π
π Feed Output π
ngl, this module doesn't attempt to enforce many of OWL's semantic constraints β like, for example, it does not enforce that an entry has only one title. It just trusts XML::Atom::Feed and XML::Atom::Entry to handle that sort of thing. So if your input is sensible, that shouldn't be a problem. If your input is chaos... that's between you and your data, bestie π
π SEE ALSO π
XML::Atom::OWL, HTML::Microformats, RDF::TrineX::Functions, XML::Atom::Feed, XML::Atom::Entry.
<http://bblfish.net/work/atom-owl/2006-06-06/>.
go read those, iykyk π
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. Legend behaviour, honestly.
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2011-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. so like. go off π
β 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.
translation: no promises, no take-backs, no warranty. it is what it is π
and that's the whole page, bestie π«Ά this was perl v5.34.0, dated 2022-06-28, for XML::Atom::FromOWL(3pm) β mwah, go export something pretty πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libxml-atom-fromowl-perl 0.102-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libxml-atom-fromowl-perl 0.102-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms