Skip to main content

AddConnection

Add a connection between two referenced objects, and properties associated with the new connection.

Parameters

  • class: Name of the class for the connection.
  • src: Reference to the object that is the source of the connection.
  • dst: Reference to the object that is the destination of the connection.
  • [optional] properties
  • [optional] if_not_found

Details

The source and destination references (src and dst) correspond to references created with the another command within the transaction.

The properties are key-value pairs associated with the connection. Check properties for more details.

Examples

Add an Entity of the class "Person" and an image, and create a Connection between the two objects:


[{
"AddEntity": {
"class": "Person",
"_ref": 1,
"properties": {
"name": "Jane Polansky",
"gender": "F",
"email": "jane.p@xyz.com"
}
}
}, {
"AddEntity": {
"class": "Person",
"_ref": 2,
"properties": {
"name": "Jon Doe",
"gender": "M",
"email": "jon.doe@xyz.com"
}
}
}, {
"AddConnection": {
"class": "BestFriendsForever",
"src": 1,
"dst": 2,
"properties": {
"place_met": "Fake Street 123",
"date": {
"_date": "Mon Apr 10 10:59:24 PDT 1970"
}
}
}
}]


[{
"AddEntity": {
"status": 0
}
}, {
"AddEntity": {
"status": 0
}
}, {
"AddConnection": {
"status": 0
}
}]