line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RDF::QueryX::Lazy; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
46546
|
use 5.010; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
64
|
|
4
|
2
|
|
|
2
|
|
14789
|
use common::sense; |
|
2
|
|
|
|
|
22
|
|
|
2
|
|
|
|
|
11
|
|
5
|
2
|
|
|
2
|
|
128
|
use constant { FALSE => 0, TRUE => 1 }; |
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
195
|
|
6
|
2
|
|
|
2
|
|
2142
|
use utf8; |
|
2
|
|
|
|
|
18
|
|
|
2
|
|
|
|
|
11
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our (%Lazy); |
9
|
|
|
|
|
|
|
BEGIN { |
10
|
2
|
|
|
2
|
|
363
|
$RDF::QueryX::Lazy::AUTHORITY = 'cpan:TOBYINK'; |
11
|
2
|
|
|
|
|
4
|
$RDF::QueryX::Lazy::VERSION = '0.003'; |
12
|
|
|
|
|
|
|
|
13
|
56
|
50
|
|
|
|
345
|
%Lazy = |
14
|
2
|
|
|
|
|
77
|
map { /^PREFIX (.+?):/ ? ($1 => $_) : () } |
15
|
|
|
|
|
|
|
split /\r?\n/, <<'LAZY'; |
16
|
|
|
|
|
|
|
PREFIX bibo: |
17
|
|
|
|
|
|
|
PREFIX bio: |
18
|
|
|
|
|
|
|
PREFIX cc: |
19
|
|
|
|
|
|
|
PREFIX dc: |
20
|
|
|
|
|
|
|
PREFIX doap: |
21
|
|
|
|
|
|
|
PREFIX foaf: |
22
|
|
|
|
|
|
|
PREFIX frbr: |
23
|
|
|
|
|
|
|
PREFIX geo: |
24
|
|
|
|
|
|
|
PREFIX gr: |
25
|
|
|
|
|
|
|
PREFIX ical: |
26
|
|
|
|
|
|
|
PREFIX og: |
27
|
|
|
|
|
|
|
PREFIX org: |
28
|
|
|
|
|
|
|
PREFIX owl: |
29
|
|
|
|
|
|
|
PREFIX rdf: |
30
|
|
|
|
|
|
|
PREFIX rdfa: |
31
|
|
|
|
|
|
|
PREFIX rdfg: |
32
|
|
|
|
|
|
|
PREFIX rdfs: |
33
|
|
|
|
|
|
|
PREFIX rev: |
34
|
|
|
|
|
|
|
PREFIX rss: |
35
|
|
|
|
|
|
|
PREFIX sioc: |
36
|
|
|
|
|
|
|
PREFIX skos: |
37
|
|
|
|
|
|
|
PREFIX vann: |
38
|
|
|
|
|
|
|
PREFIX vcard: |
39
|
|
|
|
|
|
|
PREFIX void: |
40
|
|
|
|
|
|
|
PREFIX wdrs: |
41
|
|
|
|
|
|
|
PREFIX wot: |
42
|
|
|
|
|
|
|
PREFIX xhv: |
43
|
|
|
|
|
|
|
PREFIX xsd: |
44
|
|
|
|
|
|
|
LAZY |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
2
|
|
|
2
|
|
12
|
use Scalar::Util 0 qw[blessed refaddr]; |
|
2
|
|
|
|
|
69
|
|
|
2
|
|
|
|
|
284
|
|
48
|
2
|
|
|
2
|
|
2382
|
use RDF::Query 2.900; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
use parent qw[RDF::Query]; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub new |
53
|
|
|
|
|
|
|
{ |
54
|
|
|
|
|
|
|
my ($class, $query, @params) = @_; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
my $lazy = ''; |
57
|
|
|
|
|
|
|
$lazy .= join "\n", |
58
|
|
|
|
|
|
|
map { $Lazy{$_} } |
59
|
|
|
|
|
|
|
grep { $query =~ /$_:/ } |
60
|
|
|
|
|
|
|
keys %Lazy; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
if (exists $params[0] |
63
|
|
|
|
|
|
|
and ref $params[0] eq 'HASH' |
64
|
|
|
|
|
|
|
and ref $params[0]{lazy} eq 'HASH') |
65
|
|
|
|
|
|
|
{ |
66
|
|
|
|
|
|
|
my %more = %{ delete($params[0]{lazy}) // {} }; |
67
|
|
|
|
|
|
|
$lazy .= join "\n", |
68
|
|
|
|
|
|
|
map { sprintf('PREFIX %s: <%s>', $_, $more{$_}) } |
69
|
|
|
|
|
|
|
grep { $query =~ /$_:/ } |
70
|
|
|
|
|
|
|
keys %more; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
return $class->SUPER::new($lazy.$query, @params); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
TRUE; |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
__END__ |