Interlinks
Proxy for linking.
Source code in abses/links.py
owning ¶
Links that this object has.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
direction |
Direction
|
The direction of the link ('in' or 'out'). If None, return both out links and in links. |
None
|
Returns:
Type | Description |
---|---|
Tuple[str, ...]
|
The links that this object has. |
Source code in abses/links.py
get ¶
Get the linked nodes.
Source code in abses/links.py
has ¶
Check if the node has the link.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_name |
str
|
The name of the link. |
required |
node |
Optional[LinkingNode]
|
The node to check if it has the link with the current node. If None, check if the current node has any link. |
None
|
Returns:
Name | Type | Description |
---|---|---|
tuple |
Tuple[bool, bool]
|
A tuple of two booleans. The first element is True if the link exists from me to other. The second element is True if the link exists from other to me. |
Source code in abses/links.py
to ¶
Link to another node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
LinkingNode
|
The node to link to. |
required |
link_name |
str
|
The name of the link. |
required |
mutual |
bool
|
If the link is mutual. Defaults to False. |
False
|
Source code in abses/links.py
by ¶
Make this node linked by another node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
LinkingNode
|
The node to link by. |
required |
link_name |
str
|
The name of the link. |
required |
mutual |
bool
|
If the link is mutual. Defaults to False. |
False
|
Source code in abses/links.py
unlink ¶
Remove the link between me and another node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
LinkingNode
|
The node to unlink with. |
required |
link_name |
str
|
The name of the link. |
required |
mutual |
bool
|
If delete link mutually. Defaults to False. |
False
|
Raises:
Type | Description |
---|---|
ABSESpyError
|
If the link from source to target does not exist. |
Source code in abses/links.py
clean ¶
Clean all the related links from this node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
link_name |
Optional[str]
|
The name of the link. If None, clean all related links for the node. |
None
|
direction |
Direction
|
The direction of the link ('in' or 'out'). If None, clean both directions (both out links and in links). |
None
|
Raises:
Type | Description |
---|---|
ValueError
|
If the direction is not 'in' or 'out'. |