line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
17
|
|
|
17
|
|
312
|
use 5.010; |
|
17
|
|
|
|
|
55
|
|
2
|
17
|
|
|
17
|
|
97
|
use strict; |
|
17
|
|
|
|
|
32
|
|
|
17
|
|
|
|
|
344
|
|
3
|
17
|
|
|
17
|
|
79
|
use warnings; |
|
17
|
|
|
|
|
33
|
|
|
17
|
|
|
|
|
400
|
|
4
|
17
|
|
|
17
|
|
79
|
use utf8; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
75
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Neo4j::Driver::Type::Node; |
7
|
|
|
|
|
|
|
# ABSTRACT: Describes a node from a Neo4j graph |
8
|
|
|
|
|
|
|
$Neo4j::Driver::Type::Node::VERSION = '0.38'; |
9
|
|
|
|
|
|
|
|
10
|
17
|
|
|
17
|
|
970
|
use parent 'Neo4j::Types::Node'; |
|
17
|
|
|
|
|
44
|
|
|
17
|
|
|
|
|
82
|
|
11
|
17
|
|
|
17
|
|
14819
|
use overload '%{}' => \&_hash, fallback => 1; |
|
17
|
|
|
|
|
35
|
|
|
17
|
|
|
|
|
176
|
|
12
|
|
|
|
|
|
|
|
13
|
17
|
|
|
17
|
|
1543
|
use Carp qw(croak); |
|
17
|
|
|
|
|
38
|
|
|
17
|
|
|
|
|
8248
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
20
|
|
|
20
|
1
|
8016
|
my ($self, $property) = @_; |
18
|
|
|
|
|
|
|
|
19
|
20
|
|
|
|
|
141
|
return $$self->{$property}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub labels { |
24
|
19
|
|
|
19
|
1
|
10556
|
my ($self) = @_; |
25
|
|
|
|
|
|
|
|
26
|
19
|
|
100
|
|
|
81
|
$$self->{_meta}->{labels} //= []; |
27
|
19
|
|
|
|
|
28
|
return @{ $$self->{_meta}->{labels} }; |
|
19
|
|
|
|
|
118
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub properties { |
32
|
9
|
|
|
9
|
1
|
5951
|
my ($self) = @_; |
33
|
|
|
|
|
|
|
|
34
|
9
|
|
|
|
|
53
|
my $properties = { %$$self }; |
35
|
9
|
|
|
|
|
20
|
delete $properties->{_meta}; |
36
|
9
|
|
|
|
|
44
|
return $properties; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub element_id { |
41
|
11
|
|
|
11
|
1
|
8919
|
my ($self) = @_; |
42
|
|
|
|
|
|
|
|
43
|
11
|
100
|
|
|
|
63
|
return $$self->{_meta}->{element_id} if defined $$self->{_meta}->{element_id}; |
44
|
5
|
|
|
|
|
21
|
return $$self->{_meta}->{id}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub id { |
49
|
40
|
|
|
40
|
1
|
15260
|
my ($self) = @_; |
50
|
|
|
|
|
|
|
|
51
|
40
|
100
|
|
|
|
255
|
return $$self->{_meta}->{id} if defined $$self->{_meta}->{id}; |
52
|
|
|
|
|
|
|
|
53
|
6
|
|
|
|
|
120
|
warnings::warnif deprecated => "Node->id() is deprecated since Neo4j 5; use element_id()"; |
54
|
6
|
|
|
|
|
2098
|
my ($id) = $$self->{_meta}->{element_id} =~ m/^4:[^:]*:([0-9]+)/; |
55
|
6
|
100
|
|
|
|
26
|
$id = 0 + $id if defined $id; |
56
|
6
|
|
|
|
|
21
|
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
|
|
|
|
|
703
|
return $$self->{_meta}->{deleted}; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub _hash { |
78
|
2
|
|
|
2
|
|
153
|
my ($self) = @_; |
79
|
|
|
|
|
|
|
|
80
|
2
|
|
|
|
|
110
|
warnings::warnif deprecated => "Direct hash access is deprecated; use " . __PACKAGE__ . "->properties()"; |
81
|
2
|
|
|
|
|
1112
|
return $$self; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# for experimental Cypher type system customisation only |
86
|
|
|
|
|
|
|
sub _private { |
87
|
1
|
|
|
1
|
|
31
|
my ($self) = @_; |
88
|
|
|
|
|
|
|
|
89
|
1
|
|
|
|
|
6
|
return $$self; |
90
|
|
|
|
|
|
|
} |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |