NAME

Neo4j::Types::Node - Describes a node from a Neo4j graph

VERSION

version 1.00

SYNOPSIS

$node_id = $node->id;
@labels  = $node->labels;

$property1  = $node->get('property1');
$property2  = $node->get('property2');
%properties = %{ $node->properties };

DESCRIPTION

Describes a node from a Neo4j graph. A node may be created by executing a Cypher statement against a Neo4j database server. Its description contains the node's properties as well as certain meta data, all accessible by methods that this class provides.

This module makes no assumptions about its internal data structure. While default implementations for all methods are provided, inheritors are free to override these according to their needs. The default implementations assume the data is stored in the format defined for Neo4j::Bolt::Node.

Neo4j::Types::Node objects are typically not in a one-to-one relation with nodes in a Neo4j graph. If the same Neo4j node is fetched multiple times, then multiple distinct Neo4j::Types::Node objects may be created. Refer to the documentation of the Perl module you use to fetch nodes from the Neo4j database for information about how that particular module handles this aspect.

METHODS

Neo4j::Types::Node implements the following methods.

get

$value = $node->get('property_key');

Retrieve the value of this node's property with the given key. If no such key exists, return an undefined value.

id

$id = $node->id;

Return an ID for this node that is unique within a particular context, for example the current driver session or Bolt connection.

Neo4j node IDs are not designed to be persistent. After a node is deleted, its ID may be reused by another node.

IDs are always integer numbers. A node with the ID 0 may exist. Nodes and relationships do not share the same ID space.

labels

@labels = $node->labels;

Return all labels of this node.

properties

$hashref = $node->properties;

Return all properties of this node as a hash reference.

BUGS

The behaviour of the labels() method when called in scalar context has not yet been defined.

The behaviour of the properties() method when called in list context has not yet been defined.

The effect of making changes to the contents of the hash to which a reference is returned from the properties() method has not yet been defined.

SEE ALSO

AUTHOR

Arne Johannessen <ajnn@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2021 by Arne Johannessen.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)