roformats::DocumentContext;
use HTML::Microformats::Datatype;
use HTML::Microformats::Format;
use JSON;
use RDF::Trine 0.130;
use XML::LibXML;
use Object::AUTHORITY;
BEGIN {
$HTML::Microformats::AU
= shift;
$self->parse_microformats;
return $self->{'objects'};
}
sub TO_JSON
{
return $_[0]->all_objects;
}
sub json
{
my $self = shift;
my %opts = @_;
$opts{'convert_blessed'} = 1
unles
defined $opts{'convert_blessed'};
$opts{'utf8'} = 1
unless defined $opts{'utf8'};
return to_json($self->all_objects, \%opts);
}
sub model
{
my $self = shift;
my $model = RDF::Trine::Model->
no warnings;
use 5.010;
use HTML::Microformats::Utilities qw(stringify xml_stringify);
use JSON qw/to_json/;
use Object::AUTHORITY;
BEGIN {
$HTML::Microformats::Format::XOXO::AUTHORITY = 'cpan:TO
(
$self->id(1),
RDF::Trine::Node::Resource->new('http://open.vocab.org/terms/json'),
$self->_make_literal( to_json($self, {canonical=>1,convert_blessed=>1}) ),
));
return $self;
}
sub profi
s, HTML::Microformats::Format::XOXO::LI->parse($li, $xoxo); }
bless \@items, $class;
}
sub TO_JSON
{
return [ @{$_[0]} ];
}
sub as_array
{
my ($self) = @_;
return wantarray ? @$self : $self;
}
ts::Datatype::Duration->new($this->{i}->duration);
return $this->{i}->start . "/$D";
}
sub TO_JSON
{
my $this = shift;
return $this->to_string;
}
=item C<< $d->datatype >>
Returns an the RDF d
ar) string.
=back
=cut
sub to_string
{
my $this = shift;
return $this->{'string'};
}
sub TO_JSON
{
my $this = shift;
return $this->{'string'};
}
=head2 Functions
=over 4
=item C<< $str = ms
ne::Node::Literal->new($self->to_string, undef, $self->datatype),
));
return $self;
}
sub TO_JSON
{
my $self = shift;
return $self->to_string;
}
1;
__END__
=head1 BUGS
Please report any bug
ds + ($self->{d}->nanoseconds / 1000000000)).'S'; }
$str =~ s/T$//;
return $str;
}
sub TO_JSON
{
my $self = shift;
return $self->to_string;
}
=item C<< $d->datatype >>
Returns an the RDF d
.w3.org/2001/XMLSchema#date'; }
return 'http://www.w3.org/2001/XMLSchema#dateTime';
}
sub TO_JSON
{
return "$_[0]";
}
1;
__END__
=head1 BUGS
Please report any bugs to L<http://rt.cpan.org/>.
.
=cut
sub data
{
return {} unless defined $_[0]->{'DATA'};
return $_[0]->{'DATA'};
}
sub TO_JSON
{
return data( $_[0] );
}
=item C<< $object->element >>
Returns the root element.
=cut
sub