line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# RDF::Query::Functions |
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Functions - Standard Extension Functions |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Functions version 2.915_01. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 DESCRIPTION |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
This stub module simply loads all other modules named |
15
|
|
|
|
|
|
|
C<< RDF::Query::Functions::* >>. Each of those modules |
16
|
|
|
|
|
|
|
has an C<install> method that simply adds coderefs |
17
|
|
|
|
|
|
|
to C<< %RDF::Query::functions >>. |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=over 4 |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
package RDF::Query::Functions; |
26
|
|
|
|
|
|
|
|
27
|
35
|
|
|
35
|
|
199
|
use strict; |
|
35
|
|
|
|
|
84
|
|
|
35
|
|
|
|
|
1079
|
|
28
|
35
|
|
|
35
|
|
191
|
use warnings; |
|
35
|
|
|
|
|
76
|
|
|
35
|
|
|
|
|
1044
|
|
29
|
35
|
|
|
35
|
|
180
|
no warnings 'redefine'; |
|
35
|
|
|
|
|
133
|
|
|
35
|
|
|
|
|
1642
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
our $BLOOM_FILTER_LOADED; |
32
|
|
|
|
|
|
|
|
33
|
35
|
|
|
35
|
|
197
|
use Scalar::Util qw(refaddr); |
|
35
|
|
|
|
|
75
|
|
|
35
|
|
|
|
|
2112
|
|
34
|
35
|
|
|
35
|
|
197
|
use Log::Log4perl; |
|
35
|
|
|
|
|
81
|
|
|
35
|
|
|
|
|
306
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Module::Pluggable |
37
|
35
|
|
|
|
|
282
|
search_path => [ __PACKAGE__ ], |
38
|
|
|
|
|
|
|
require => 1, |
39
|
|
|
|
|
|
|
inner => 1, |
40
|
|
|
|
|
|
|
sub_name => 'function_sets', |
41
|
35
|
|
|
35
|
|
30174
|
; |
|
35
|
|
|
|
|
324858
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
###################################################################### |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
our ($VERSION, $l); |
46
|
|
|
|
|
|
|
BEGIN { |
47
|
35
|
|
|
35
|
|
4594
|
$l = Log::Log4perl->get_logger("rdf.query.functions"); |
48
|
35
|
|
|
|
|
19710
|
$VERSION = '2.915_01'; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
###################################################################### |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item C<< install_function ( $uri, \&func ) >> |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=item C<< install_function ( \@uris, \&func ) >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Install the supplied CODE reference as the implementation for the given function URI(s). |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=cut |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub install_function { |
62
|
3220
|
|
|
3220
|
1
|
4725
|
my $class = shift; |
63
|
3220
|
|
|
|
|
7119
|
while (@_) { |
64
|
3220
|
|
|
|
|
3999
|
my $uris = shift; |
65
|
3220
|
|
|
|
|
3936
|
my $func = shift; |
66
|
3220
|
100
|
|
|
|
12078
|
$RDF::Query::preferred_function_name{ refaddr($func) } = ref($uris) ? $uris->[0] : $uris; |
67
|
3220
|
100
|
|
|
|
6527
|
foreach my $uri (ref($uris) ? @$uris : $uris) { |
68
|
3535
|
|
|
|
|
16320
|
$RDF::Query::functions{$uri} = $func; |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
foreach my $function_set (__PACKAGE__->function_sets) { |
74
|
|
|
|
|
|
|
$function_set->install; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=back |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L<RDF::Query::Functions::SPARQL>, |
86
|
|
|
|
|
|
|
L<RDF::Query::Functions::Xpath>, |
87
|
|
|
|
|
|
|
L<RDF::Query::Functions::Jena>, |
88
|
|
|
|
|
|
|
L<RDF::Query::Functions::Geo>, |
89
|
|
|
|
|
|
|
L<RDF::Query::Functions::Kasei>. |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 AUTHOR |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Gregory Williams <gwilliams@cpan.org>, |
94
|
|
|
|
|
|
|
Toby Inkster <tobyink@cpan.org>. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |