line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
323
|
use 5.010; |
|
17
|
|
|
|
|
70
|
|
2
|
17
|
|
|
17
|
|
97
|
use strict; |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
378
|
|
3
|
17
|
|
|
17
|
|
78
|
use warnings; |
|
17
|
|
|
|
|
34
|
|
|
17
|
|
|
|
|
436
|
|
4
|
17
|
|
|
17
|
|
77
|
use utf8; |
|
17
|
|
|
|
|
30
|
|
|
17
|
|
|
|
|
115
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Neo4j::Driver::Type::Node; |
7
|
|
|
|
|
|
|
# ABSTRACT: Describes a node from a Neo4j graph |
8
|
|
|
|
|
|
|
$Neo4j::Driver::Type::Node::VERSION = '0.39'; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
970
|
use parent 'Neo4j::Types::Node'; |
|
17
|
|
|
|
|
31
|
|
|
17
|
|
|
|
|
114
|
|
11
|
17
|
|
|
17
|
|
14898
|
use overload '%{}' => \&_hash, fallback => 1; |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
166
|
|
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
1724
|
use Carp qw(croak); |
|
17
|
|
|
|
|
35
|
|
|
17
|
|
|
|
|
8611
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
20
|
|
|
20
|
1
|
6770
|
my ($self, $property) = @_; |
18
|
|
|
|
|
|
|
|
19
|
20
|
|
|
|
|
161
|
return $$self->{$property}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub labels { |
24
|
19
|
|
|
19
|
1
|
10320
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
19
|
|
100
|
|
|
77
|
$$self->{_meta}->{labels} //= []; |
27
|
19
|
|
|
|
|
27
|
return @{ $$self->{_meta}->{labels} }; |
|
19
|
|
|
|
|
125
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub properties { |
32
|
9
|
|
|
9
|
1
|
5082
|
my ($self) = @_; |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
39
|
my $properties = { %$$self }; |
35
|
9
|
|
|
|
|
21
|
delete $properties->{_meta}; |
36
|
9
|
|
|
|
|
48
|
return $properties; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub element_id { |
41
|
11
|
|
|
11
|
1
|
7477
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
11
|
100
|
|
|
|
66
|
return $$self->{_meta}->{element_id} if defined $$self->{_meta}->{element_id}; |
44
|
5
|
|
|
|
|
19
|
return $$self->{_meta}->{id}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub id { |
49
|
40
|
|
|
40
|
1
|
14253
|
my ($self) = @_; |
50
|
|
|
|
|
|
|
|
51
|
40
|
100
|
|
|
|
211
|
return $$self->{_meta}->{id} if defined $$self->{_meta}->{id}; |
52
|
|
|
|
|
|
|
|
53
|
6
|
|
|
|
|
132
|
warnings::warnif deprecated => "Node->id() is deprecated since Neo4j 5; use element_id()"; |
54
|
6
|
|
|
|
|
2218
|
my ($id) = $$self->{_meta}->{element_id} =~ m/^4:[^:]*:([0-9]+)/; |
55
|
6
|
100
|
|
|
|
24
|
$id = 0 + $id if defined $id; |
56
|
6
|
|
|
|
|
14
|
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
|
4
|
my ($self) = @_; |
71
|
|
|
|
|
|
|
|
72
|
2
|
|
|
|
|
32
|
warnings::warnif deprecated => __PACKAGE__ . "->deleted() is deprecated"; |
73
|
2
|
|
|
|
|
680
|
return $$self->{_meta}->{deleted}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _hash { |
78
|
2
|
|
|
2
|
|
162
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
|
|
104
|
warnings::warnif deprecated => "Direct hash access is deprecated; use " . __PACKAGE__ . "->properties()"; |
81
|
2
|
|
|
|
|
1103
|
return $$self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# for experimental Cypher type system customisation only |
86
|
|
|
|
|
|
|
sub _private { |
87
|
1
|
|
|
1
|
|
36
|
my ($self) = @_; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
6
|
return $$self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |