1. Toby Inkster
  2. p5-moosex-semantic

Source

p5-moosex-semantic / lib / MooseX / Semantic / Role / Resource.pm

package MooseX::Semantic::Role::Resource;
use Moose::Role;
use Data::UUID;
use MooseX::Semantic::Types qw(TrineBlankOrUndef TrineNode TrineResource );
use URI;
# use MooseX::InstanceTracking;


has rdf_about => (
    is => 'rw',
    isa => TrineNode,
    coerce => 1,
    required => 0,
    lazy => 1,
    builder => '_build_rdf_about',
    handles => [qw( is_blank is_resource )],
);
sub _build_rdf_about {
    # XXX should Resources be by default blank nodes or have a UUID URI?
    TrineResource->coerce(sprintf('urn:uuid:%s', Data::UUID->new->create_str));
}

1;