SemanticWeb-Schema
view release on metacpan or search on metacpan
devel/etc/base.tt view on Meta::CPAN
use utf8;
package [% class_name %];
# ABSTRACT: Moo classes for [% context %] classes
use v5.10.1;
use Moo;
use List::Util qw/ first /;
use MooX::JSON_LD 'base';
use Ref::Util qw/ is_blessed_ref is_plain_arrayref /;
use Types::Standard qw/ Str /;
use namespace::autoclean;
our $VERSION = '[% version %]';
# RECOMMEND PREREQ: aliased
# RECOMMEND PREREQ: Class::XSAccessor 1.18
# RECOMMEND PREREQ: Ref::Util::XS
# RECOMMEND PREREQ: Type::Tiny::XS
=encoding utf8
=head1 append:VERSION
The version number of this distribution is based on the corresponding
version of schema classes.
=head1 SYNOPSIS
use aliased 'SemanticWeb::Schema::Person' => 'Person';
my $person = Person->new(
name => 'James Clerk Maxwell',
birth_date => '1831-06-13',
birth_place => 'Edinburgh',
);
print $person->json_ld;
=head1 DESCRIPTION
This distribution contains Perl classes for L<https://schema.org>
semantic markup. These can be used to generate JSON-LD
to embed in websites.
This is a base class for the C<[% class_name %]> classes, which
were generated automatically from the following sources:
=over
[% FOREACH uri IN sources.sort %]
=item L<[% uri %]>
[% END -%]
=back
=head1 ATTRIBUTES
=head2 C<id>
If this is set, it adds a C<@id> to the L</json_ld_data>.
=cut
has id => (
is => 'rw',
isa => Str,
predicate => 1,
json_ld => '@id',
);
=head2 C<context>
The context defaults to "[% context %]".
=cut
around _build_context => sub { return 'http://schema.org/' };
( run in 1.885 second using v1.01-cache-2.11-cpan-39bf76dae61 )