| 1 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | package Conclave::OTK::Queries; | ||
| 4 | # ABSTRACT: query provider for OTK | ||
| 5 | |||
| 6 | 3 | ▶ | use Template; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 3 | ▶ | use Conclave::OTK::Queries::OWL; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 2 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 10 | 2 | my ($class, $format) = @_; | |
| 11 | 2 | my $self = bless({}, $class); | |
| 12 | |||
| 13 | 2 | my $provider = "Conclave::OTK::Queries::$format"; | |
| 14 | |||
| 15 | 2 | my $template_config = { | |
| 16 | INCLUDE_PATH => [ 'templates' ], | ||
| 17 | }; | ||
| 18 | 2 | my $template = Template->new({ | |
| 19 | LOAD_TEMPLATES => [ $provider->new($template_config) ], | ||
| 20 | }); | ||
| 21 | |||
| 22 | 2 | $self->{format} = $format; | |
| 23 | 2 | $self->{template} = $template; | |
| 24 | |||
| 25 | 2 | return $self; | |
| 26 | } | ||
| 27 | |||
| 28 | 22 | ▶ | sub process { |
|
Subroutine
process: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 29 | 22 | my ($self, $template_name, $vars) = @_; | |
| 30 | |||
| 31 | 22 | my $sparql; | |
| 32 | 22 | $self->{template}->process($template_name, $vars, \$sparql); | |
| 33 | |||
| 34 | 22 | return $sparql | |
| 35 | } | ||
| 36 | |||
| 37 | 3 | 1; | |
| 38 | |||
| 39 | __END__ | ||