| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | =head1 NAME | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | Attean::RDF - Utility package for exporting shorthand functions for constructing RDF objects | 
| 4 |  |  |  |  |  |  |  | 
| 5 |  |  |  |  |  |  | =head1 VERSION | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | This document describes Attean::RDF version 0.032 | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | =head1 SYNOPSIS | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | use v5.14; | 
| 12 |  |  |  |  |  |  | use Attean::RDF; | 
| 13 |  |  |  |  |  |  |  | 
| 14 |  |  |  |  |  |  | my $s = blank('b'); | 
| 15 |  |  |  |  |  |  | my $p = iri('http://xmlns.com/foaf/0.1/name'); | 
| 16 |  |  |  |  |  |  | my $o = langliteral("Eve", "en"); | 
| 17 |  |  |  |  |  |  | my $triple = triple($s, $p, $o); | 
| 18 |  |  |  |  |  |  | say $triple->as_string; # _:b <http://xmlns.com/foaf/0.1/name> "Eve"@en . | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | =head1 DESCRIPTION | 
| 21 |  |  |  |  |  |  |  | 
| 22 |  |  |  |  |  |  | This is a utility package for exporting shorthand functions for constructing | 
| 23 |  |  |  |  |  |  | RDF objects such as IRIs, Literals, Blanks, Triples, etc. | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | =head1 FUNCTIONS | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | All of the functions defined in this package may be exported (and are exported | 
| 28 |  |  |  |  |  |  | by default). | 
| 29 |  |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  | =over 4 | 
| 31 |  |  |  |  |  |  |  | 
| 32 |  |  |  |  |  |  | =cut | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | use v5.14; | 
| 35 | 50 |  |  | 50 |  | 230677 | use warnings; | 
|  | 50 |  |  |  |  | 187 |  | 
| 36 | 50 |  |  | 50 |  | 248 |  | 
|  | 50 |  |  |  |  | 90 |  | 
|  | 50 |  |  |  |  | 1170 |  | 
| 37 |  |  |  |  |  |  | use Attean; | 
| 38 | 50 |  |  | 50 |  | 924 | use List::MoreUtils qw(zip); | 
|  | 50 |  |  |  |  | 86 |  | 
|  | 50 |  |  |  |  | 1513 |  | 
| 39 | 50 |  |  | 50 |  | 222 | require Exporter::Tiny; | 
|  | 50 |  |  |  |  | 103 |  | 
|  | 50 |  |  |  |  | 336 |  | 
| 40 |  |  |  |  |  |  | use namespace::clean; | 
| 41 | 50 |  |  | 50 |  | 31411 |  | 
|  | 50 |  |  |  |  | 88 |  | 
|  | 50 |  |  |  |  | 306 |  | 
| 42 |  |  |  |  |  |  | our @ISA	= qw(Exporter::Tiny); | 
| 43 |  |  |  |  |  |  | our @EXPORT	= qw(iri blank literal dtliteral langliteral variable triple quad triplepattern quadpattern bgp); | 
| 44 |  |  |  |  |  |  |  | 
| 45 |  |  |  |  |  |  | =item C<< variable( $value ) >> | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | C<< Attean::Variable->new($value) >> | 
| 48 |  |  |  |  |  |  |  | 
| 49 |  |  |  |  |  |  | =cut | 
| 50 |  |  |  |  |  |  |  | 
| 51 |  |  |  |  |  |  | return Attean::Variable->new(@_); | 
| 52 |  |  |  |  |  |  | } | 
| 53 | 559 |  |  | 559 | 1 | 198069 |  | 
| 54 |  |  |  |  |  |  | =item C<< iri( $value ) >> | 
| 55 |  |  |  |  |  |  |  | 
| 56 |  |  |  |  |  |  | C<< Attean::IRI->new($value) >> | 
| 57 |  |  |  |  |  |  |  | 
| 58 |  |  |  |  |  |  | =cut | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | return Attean::IRI->new(@_); | 
| 61 |  |  |  |  |  |  | } | 
| 62 |  |  |  |  |  |  |  | 
| 63 | 837 |  |  | 837 | 1 | 335203 | =item C<< blank( $value ) >> | 
| 64 |  |  |  |  |  |  |  | 
| 65 |  |  |  |  |  |  | C<< Attean::Blank->new($value) >> | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | =cut | 
| 68 |  |  |  |  |  |  |  | 
| 69 |  |  |  |  |  |  | return Attean::Blank->new(@_); | 
| 70 |  |  |  |  |  |  | } | 
| 71 |  |  |  |  |  |  |  | 
| 72 |  |  |  |  |  |  | =item C<< literal( $value ) >> | 
| 73 | 77 |  |  | 77 | 1 | 37603 |  | 
| 74 |  |  |  |  |  |  | C<< Attean::Literal->new($value) >> | 
| 75 |  |  |  |  |  |  |  | 
| 76 |  |  |  |  |  |  | =cut | 
| 77 |  |  |  |  |  |  |  | 
| 78 |  |  |  |  |  |  | return Attean::Literal->new(@_); | 
| 79 |  |  |  |  |  |  | } | 
| 80 |  |  |  |  |  |  |  | 
| 81 |  |  |  |  |  |  | =item C<< dtliteral( $value, $dt ) >> | 
| 82 |  |  |  |  |  |  |  | 
| 83 | 211 |  |  | 211 | 1 | 34846 | C<< Attean::Literal->new( value => $value, datatype => $dt ) >> | 
| 84 |  |  |  |  |  |  |  | 
| 85 |  |  |  |  |  |  | =cut | 
| 86 |  |  |  |  |  |  |  | 
| 87 |  |  |  |  |  |  | my @k	= qw(value datatype); | 
| 88 |  |  |  |  |  |  | return Attean::Literal->new(zip @k, @_); | 
| 89 |  |  |  |  |  |  | } | 
| 90 |  |  |  |  |  |  |  | 
| 91 |  |  |  |  |  |  | =item C<< langliteral( $value, $lang ) >> | 
| 92 |  |  |  |  |  |  |  | 
| 93 | 17 |  |  | 17 | 1 | 4371 | C<< Attean::Literal->new( value => $value, language => $lang ) >> | 
| 94 | 17 |  |  |  |  | 321 |  | 
| 95 |  |  |  |  |  |  | =cut | 
| 96 |  |  |  |  |  |  |  | 
| 97 |  |  |  |  |  |  | my @k	= qw(value language); | 
| 98 |  |  |  |  |  |  | return Attean::Literal->new(zip @k, @_); | 
| 99 |  |  |  |  |  |  | } | 
| 100 |  |  |  |  |  |  |  | 
| 101 |  |  |  |  |  |  | =item C<< triple( @terms ) >> | 
| 102 |  |  |  |  |  |  |  | 
| 103 |  |  |  |  |  |  | C<< Attean::Triple->new( @terms ) >> | 
| 104 | 2 |  |  | 2 | 1 | 592 |  | 
| 105 | 2 |  |  |  |  | 41 | =cut | 
| 106 |  |  |  |  |  |  |  | 
| 107 |  |  |  |  |  |  | return Attean::Triple->new(@_); | 
| 108 |  |  |  |  |  |  | } | 
| 109 |  |  |  |  |  |  |  | 
| 110 |  |  |  |  |  |  | =item C<< triplepattern( @terms ) >> | 
| 111 |  |  |  |  |  |  |  | 
| 112 |  |  |  |  |  |  | C<< Attean::TriplePattern->new( @terms ) >> | 
| 113 |  |  |  |  |  |  |  | 
| 114 |  |  |  |  |  |  | =cut | 
| 115 | 179 |  |  | 179 | 1 | 7699 |  | 
| 116 |  |  |  |  |  |  | return Attean::TriplePattern->new(@_); | 
| 117 |  |  |  |  |  |  | } | 
| 118 |  |  |  |  |  |  |  | 
| 119 |  |  |  |  |  |  | =item C<< quad( @terms ) >> | 
| 120 |  |  |  |  |  |  |  | 
| 121 |  |  |  |  |  |  | C<< Attean::Quad->new( @terms ) >> | 
| 122 |  |  |  |  |  |  |  | 
| 123 |  |  |  |  |  |  | =cut | 
| 124 |  |  |  |  |  |  |  | 
| 125 | 120 |  |  | 120 | 1 | 8895 | return Attean::Quad->new(@_); | 
| 126 |  |  |  |  |  |  | } | 
| 127 |  |  |  |  |  |  |  | 
| 128 |  |  |  |  |  |  | =item C<< quadpattern( @terms ) >> | 
| 129 |  |  |  |  |  |  |  | 
| 130 |  |  |  |  |  |  | C<< Attean::QuadPattern->new( @terms ) >> | 
| 131 |  |  |  |  |  |  |  | 
| 132 |  |  |  |  |  |  | =cut | 
| 133 |  |  |  |  |  |  |  | 
| 134 |  |  |  |  |  |  | return Attean::QuadPattern->new(@_); | 
| 135 | 41 |  |  | 41 | 1 | 5134 | } | 
| 136 |  |  |  |  |  |  |  | 
| 137 |  |  |  |  |  |  | =item C<< bgp( @triplepatterns ) >> | 
| 138 |  |  |  |  |  |  |  | 
| 139 |  |  |  |  |  |  | C<< Attean::Algebra::BGP->new( triples => \@triplepatterns ) >> | 
| 140 |  |  |  |  |  |  |  | 
| 141 |  |  |  |  |  |  | =cut | 
| 142 |  |  |  |  |  |  |  | 
| 143 |  |  |  |  |  |  | return Attean::Algebra::BGP->new(triples => \@_); | 
| 144 |  |  |  |  |  |  | } | 
| 145 | 7 |  |  | 7 | 1 | 651 | } | 
| 146 |  |  |  |  |  |  |  | 
| 147 |  |  |  |  |  |  | 1; | 
| 148 |  |  |  |  |  |  |  | 
| 149 |  |  |  |  |  |  |  | 
| 150 |  |  |  |  |  |  | =back | 
| 151 |  |  |  |  |  |  |  | 
| 152 |  |  |  |  |  |  | =head1 BUGS | 
| 153 |  |  |  |  |  |  |  | 
| 154 |  |  |  |  |  |  | Please report any bugs or feature requests to through the GitHub web interface | 
| 155 | 8 |  |  | 8 | 1 | 367 | at L<https://github.com/kasei/attean/issues>. | 
| 156 |  |  |  |  |  |  |  | 
| 157 |  |  |  |  |  |  | =head1 SEE ALSO | 
| 158 |  |  |  |  |  |  |  | 
| 159 |  |  |  |  |  |  | L<IRI> | 
| 160 |  |  |  |  |  |  |  | 
| 161 |  |  |  |  |  |  | L<http://www.ietf.org/rfc/rfc3987.txt> | 
| 162 |  |  |  |  |  |  |  | 
| 163 |  |  |  |  |  |  |  | 
| 164 |  |  |  |  |  |  |  | 
| 165 |  |  |  |  |  |  | =head1 AUTHOR | 
| 166 |  |  |  |  |  |  |  | 
| 167 |  |  |  |  |  |  | Gregory Todd Williams  C<< <gwilliams@cpan.org> >> | 
| 168 |  |  |  |  |  |  |  | 
| 169 |  |  |  |  |  |  | =head1 COPYRIGHT | 
| 170 |  |  |  |  |  |  |  | 
| 171 |  |  |  |  |  |  | Copyright (c) 2014--2022 Gregory Todd Williams. | 
| 172 |  |  |  |  |  |  | This program is free software; you can redistribute it and/or modify it under | 
| 173 |  |  |  |  |  |  | the same terms as Perl itself. | 
| 174 |  |  |  |  |  |  |  | 
| 175 |  |  |  |  |  |  | =cut |