| line | stmt | bran | cond | sub | pod | time | code | 
| 1 | 50 |  |  | 50 |  | 709 | use v5.14; | 
|  | 50 |  |  |  |  | 156 |  | 
| 2 | 50 |  |  | 50 |  | 243 | use warnings; | 
|  | 50 |  |  |  |  | 93 |  | 
|  | 50 |  |  |  |  | 2279 |  | 
| 3 |  |  |  |  |  |  |  | 
| 4 |  |  |  |  |  |  | =head1 NAME | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | Attean::Variable - Pattern matching variables | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  | =head1 VERSION | 
| 9 |  |  |  |  |  |  |  | 
| 10 |  |  |  |  |  |  | This document describes Attean::Variable version 0.033 | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | use v5.14; | 
| 15 |  |  |  |  |  |  | use Attean; | 
| 16 |  |  |  |  |  |  | my $term = Attean::Variable->new('name'); | 
| 17 |  |  |  |  |  |  | $term->ntriples_string; # ?name | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 20 |  |  |  |  |  |  |  | 
| 21 |  |  |  |  |  |  | The Attean::Variable class represents variables for use in pattern matching. | 
| 22 |  |  |  |  |  |  | It conforms to the L<Attean::API::TermOrVariable|Attean::API> role. | 
| 23 |  |  |  |  |  |  |  | 
| 24 |  |  |  |  |  |  | =head1 ATTRIBUTES | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | =over 4 | 
| 27 |  |  |  |  |  |  |  | 
| 28 |  |  |  |  |  |  | =item C<< value >> | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | =item C<< ntriples_string >> | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | =back | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | =cut | 
| 35 |  |  |  |  |  |  |  | 
| 36 |  |  |  |  |  |  | use Moo; | 
| 37 | 50 |  |  | 50 |  | 265 | use Types::Standard qw(Str); | 
|  | 50 |  |  |  |  | 100 |  | 
|  | 50 |  |  |  |  | 352 |  | 
| 38 | 50 |  |  | 50 |  | 16628 | use UUID::Tiny ':std'; | 
|  | 50 |  |  |  |  | 149 |  | 
|  | 50 |  |  |  |  | 404 |  | 
| 39 | 50 |  |  | 50 |  | 23118 | use namespace::clean; | 
|  | 50 |  |  |  |  | 105 |  | 
|  | 50 |  |  |  |  | 11124 |  | 
| 40 | 50 |  |  | 50 |  | 350 |  | 
|  | 50 |  |  |  |  | 96 |  | 
|  | 50 |  |  |  |  | 399 |  | 
| 41 |  |  |  |  |  |  | has 'value' => (is => 'ro', isa => Str, required => 1); | 
| 42 |  |  |  |  |  |  | has 'ntriples_string'	=> (is => 'ro', isa => Str, lazy => 1, builder => '_ntriples_string'); | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | with 'Attean::API::Variable'; | 
| 45 |  |  |  |  |  |  | with 'Attean::API::TermOrVariable'; | 
| 46 |  |  |  |  |  |  | with 'Attean::API::TermOrVariableOrTriplePattern'; | 
| 47 |  |  |  |  |  |  |  | 
| 48 |  |  |  |  |  |  | around BUILDARGS => sub { | 
| 49 |  |  |  |  |  |  | my $orig 	= shift; | 
| 50 |  |  |  |  |  |  | my $class	= shift; | 
| 51 |  |  |  |  |  |  | if (scalar(@_) == 0) { | 
| 52 |  |  |  |  |  |  | my $uuid	= unpack('H*', create_uuid()); | 
| 53 |  |  |  |  |  |  | return $class->$orig(value => 'v' . $uuid); | 
| 54 |  |  |  |  |  |  | } elsif (scalar(@_) == 1) { | 
| 55 |  |  |  |  |  |  | return $class->$orig(value => shift); | 
| 56 |  |  |  |  |  |  | } | 
| 57 |  |  |  |  |  |  | return $class->$orig(@_); | 
| 58 |  |  |  |  |  |  | }; | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | my $self	= shift; | 
| 61 |  |  |  |  |  |  | return '?' . $self->value; | 
| 62 | 138 |  |  | 138 |  | 2152 | } | 
| 63 | 138 |  |  |  |  | 1616 | } | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | 1; | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  |  | 
| 68 |  |  |  |  |  |  | =head1 BUGS | 
| 69 |  |  |  |  |  |  |  | 
| 70 |  |  |  |  |  |  | Please report any bugs or feature requests to through the GitHub web interface | 
| 71 |  |  |  |  |  |  | at L<https://github.com/kasei/attean/issues>. | 
| 72 |  |  |  |  |  |  |  | 
| 73 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 74 |  |  |  |  |  |  |  | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  |  | 
| 77 |  |  |  |  |  |  | =head1 AUTHOR | 
| 78 |  |  |  |  |  |  |  | 
| 79 |  |  |  |  |  |  | Gregory Todd Williams  C<< <gwilliams@cpan.org> >> | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | =head1 COPYRIGHT | 
| 82 |  |  |  |  |  |  |  | 
| 83 |  |  |  |  |  |  | Copyright (c) 2014--2022 Gregory Todd Williams. | 
| 84 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or modify it under | 
| 85 |  |  |  |  |  |  | the same terms as Perl itself. | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  | =cut |