line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
68
|
|
2
|
3
|
|
|
3
|
|
13
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
99
|
|
3
|
|
|
|
|
|
|
package Conclave::OTK::Queries; |
4
|
|
|
|
|
|
|
# ABSTRACT: query provider for OTK |
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
7886
|
use Template; |
|
3
|
|
|
|
|
81864
|
|
|
3
|
|
|
|
|
100
|
|
7
|
3
|
|
|
3
|
|
1833
|
use Conclave::OTK::Queries::OWL; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
497
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
2
|
|
|
2
|
0
|
5
|
my ($class, $format) = @_; |
11
|
2
|
|
|
|
|
5
|
my $self = bless({}, $class); |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
|
|
6
|
my $provider = "Conclave::OTK::Queries::$format"; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
9
|
my $template_config = { |
16
|
|
|
|
|
|
|
INCLUDE_PATH => [ 'templates' ], |
17
|
|
|
|
|
|
|
}; |
18
|
2
|
|
|
|
|
29
|
my $template = Template->new({ |
19
|
|
|
|
|
|
|
LOAD_TEMPLATES => [ $provider->new($template_config) ], |
20
|
|
|
|
|
|
|
}); |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
54844
|
$self->{format} = $format; |
23
|
2
|
|
|
|
|
5
|
$self->{template} = $template; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
12
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub process { |
29
|
22
|
|
|
22
|
0
|
63
|
my ($self, $template_name, $vars) = @_; |
30
|
|
|
|
|
|
|
|
31
|
22
|
|
|
|
|
43
|
my $sparql; |
32
|
22
|
|
|
|
|
180
|
$self->{template}->process($template_name, $vars, \$sparql); |
33
|
|
|
|
|
|
|
|
34
|
22
|
|
|
|
|
19757
|
return $sparql |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Conclave::OTK::Queries - query provider for OTK |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 0.01 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSIS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
TODO |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
TODO |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 AUTHOR |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Nuno Carvalho <smash@cpan.org> |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This software is copyright (c) 2014-2015 by Nuno Carvalho <smash@cpan.org>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
70
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |