line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
317
|
use 5.010; |
|
17
|
|
|
|
|
66
|
|
2
|
17
|
|
|
17
|
|
90
|
use strict; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
372
|
|
3
|
17
|
|
|
17
|
|
76
|
use warnings; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
456
|
|
4
|
17
|
|
|
17
|
|
78
|
use utf8; |
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
103
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Neo4j::Driver::Type::Node; |
7
|
|
|
|
|
|
|
# ABSTRACT: Describes a node from a Neo4j graph |
8
|
|
|
|
|
|
|
$Neo4j::Driver::Type::Node::VERSION = '0.40'; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
1082
|
use parent 'Neo4j::Types::Node'; |
|
17
|
|
|
|
|
35
|
|
|
17
|
|
|
|
|
92
|
|
11
|
17
|
|
|
17
|
|
14790
|
use overload '%{}' => \&_hash, fallback => 1; |
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
178
|
|
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
1589
|
use Carp qw(croak); |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
8497
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
20
|
|
|
20
|
1
|
6620
|
my ($self, $property) = @_; |
18
|
|
|
|
|
|
|
|
19
|
20
|
|
|
|
|
135
|
return $$self->{$property}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub labels { |
24
|
19
|
|
|
19
|
1
|
10235
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
19
|
|
100
|
|
|
98
|
$$self->{_meta}->{labels} //= []; |
27
|
19
|
|
|
|
|
28
|
return @{ $$self->{_meta}->{labels} }; |
|
19
|
|
|
|
|
114
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub properties { |
32
|
9
|
|
|
9
|
1
|
5577
|
my ($self) = @_; |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
43
|
my $properties = { %$$self }; |
35
|
9
|
|
|
|
|
27
|
delete $properties->{_meta}; |
36
|
9
|
|
|
|
|
53
|
return $properties; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub element_id { |
41
|
11
|
|
|
11
|
1
|
8927
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
11
|
100
|
|
|
|
72
|
return $$self->{_meta}->{element_id} if defined $$self->{_meta}->{element_id}; |
44
|
5
|
|
|
|
|
26
|
return $$self->{_meta}->{id}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub id { |
49
|
40
|
|
|
40
|
1
|
17661
|
my ($self) = @_; |
50
|
|
|
|
|
|
|
|
51
|
40
|
100
|
|
|
|
293
|
return $$self->{_meta}->{id} if defined $$self->{_meta}->{id}; |
52
|
|
|
|
|
|
|
|
53
|
6
|
|
|
|
|
126
|
warnings::warnif deprecated => "Node->id() is deprecated since Neo4j 5; use element_id()"; |
54
|
6
|
|
|
|
|
2240
|
my ($id) = $$self->{_meta}->{element_id} =~ m/^4:[^:]*:([0-9]+)/; |
55
|
6
|
100
|
|
|
|
25
|
$id = 0 + $id if defined $id; |
56
|
6
|
|
|
|
|
19
|
return $id; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
# Unlike Bolt v5, the Jolt v2 format regrettably removes the legacy |
59
|
|
|
|
|
|
|
# numeric ID from the response entirely. Therefore we generate it |
60
|
|
|
|
|
|
|
# here using the algorithm from Neo4j's DefaultElementIdMapperV1; |
61
|
|
|
|
|
|
|
# the final part of the element ID is identical to the legacy ID |
62
|
|
|
|
|
|
|
# according to CypherFunctions in Neo4j 5.3. This may break with |
63
|
|
|
|
|
|
|
# future Neo4j versions. |
64
|
|
|
|
|
|
|
# https://github.com/neo4j/neo4j/blob/0c092b70cc/community/kernel/src/main/java/org/neo4j/kernel/api/DefaultElementIdMapperV1.java#L62-L68 |
65
|
|
|
|
|
|
|
# https://github.com/neo4j/neo4j/blob/0c092b70cc/community/cypher/runtime-util/src/main/java/org/neo4j/cypher/operations/CypherFunctions.java#L771-L802 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub deleted { |
69
|
|
|
|
|
|
|
# uncoverable pod |
70
|
2
|
|
|
2
|
0
|
5
|
my ($self) = @_; |
71
|
|
|
|
|
|
|
|
72
|
2
|
|
|
|
|
35
|
warnings::warnif deprecated => __PACKAGE__ . "->deleted() is deprecated"; |
73
|
2
|
|
|
|
|
731
|
return $$self->{_meta}->{deleted}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _hash { |
78
|
2
|
|
|
2
|
|
139
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
|
|
80
|
warnings::warnif deprecated => "Direct hash access is deprecated; use " . __PACKAGE__ . "->properties()"; |
81
|
2
|
|
|
|
|
1053
|
return $$self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# for experimental Cypher type system customisation only |
86
|
|
|
|
|
|
|
sub _private { |
87
|
1
|
|
|
1
|
|
26
|
my ($self) = @_; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
14
|
return $$self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |