AddBlob
Add a user-defined blob object, and properties associated with the new object. A “blob” is a binary array that is treated as generic object file in ApertureDB.
A binary blob must be provided in the array of blobs.
Parameters
[optional] _ref: reference to be used within the transaction.
[optional] properties
[optional] if_not_found
[optional] connect
Details
properties are key-value pairs associated with the entity. Check properties for more details.
if_not_found can be used to turn this command into “conditional add”. Check if_not_found for more details.
connect can be used to create a connection between the added object and other object(s). Check connect for more details.
Examples
Add a “Blob” representing an audio file using AddBlob command:
[ {
"AddBlob": {
"properties": {
"type": "audio",
"sample_f_Hz": 44000,
"year": 2021
}
}
} ]
# A blob must be passed together with the JSON Query.
Conditionally add a “blob” if the id is not already registered:
[ {
"AddBlob": {
"if_not_found": {
"id": [ "==", 44 ],
},
"properties": {
"type": "audio",
"sample_f_Hz": 44000,
"id": 44
}
}
} ]
# A blob must be passed together with the JSON Query.
Conditionally add a “blob” if the id is not already present, add a “Recording” event, and create a connection between the “Blob” and the “Recording”:
[ {
"AddEntity": {
"_ref": 1,
"class": "Recording",
"properties": {
"start": {"_date": "Mon Aug 7 10:59:24 PDT 2017"}
"end": {"_date": "Mon Aug 7 12:59:24 PDT 2017"}
}
}
}, {
"AddBlob": {
"if_not_found": {
"id": [ "==", 44 ],
},
"properties": {
"type": "audio",
"sample_f_Hz": 44000,
"id": 44
},
"connect": {
"ref": 1,
"class": "taken_in_session",
}
}
} ]
# A blob must be passed together with the JSON Query.