dict2graph.Relation
¶
Bases: dict
, TransformerMetaDataMixin
Represantation of a property-graph relationship
Source code in dict2graph/relation.py
end_node: Node
writable
property
¶
The target node of the relationship
Returns:
Name | Type | Description |
---|---|---|
Node |
Node
|
The end node as a Dict2Graph.Node instance |
relation_type: str
writable
property
¶
The name of the relationship. As in Neo4j Relation Type
Defaults to a string with following structure:
<start node first label>_HAS_<end_node_first_label>
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The relationship type as str |
start_node: Node
writable
property
¶
The node from which the relationship is originating
Returns:
Name | Type | Description |
---|---|---|
Node |
Node
|
The start node as a Dict2Graph.Node instance |
__init__(start_node, end_node, relation_type=None, **kwargs)
¶
Create a new relationship
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_node |
Node
|
The node from which the relationship will start |
required |
end_node |
Node
|
The node to which the relationship will go to |
required |
relation_type |
str
|
The name if the relation. Defaults to None. |
None
|
**kwargs |
Any
|
Any further properties of this relationship. Defaults to None. |
{}
|