bovine.jsonld
This modules contains some helper functions to deal with json-ld. It realies on the pyld library to perform the actual algorithms on json-ld.
The goal of using with_bovine_context is to achieve simpler access for certain values. With the base ActivityStreams Namespace the value of to can either be a string or a list. With the bovine context, it will always be a list.
bovine.jsonld
bovine_context
module-attribute
bovine_context = [
"https://www.w3.org/ns/activitystreams",
{
"publicKey": {
"@id": "https://w3id.org/security#publicKey",
"@type": "@id",
},
"publicKeyPem": "https://w3id.org/security#publicKeyPem",
"owner": {
"@id": "https://w3id.org/security#owner",
"@type": "@id",
},
"to": {
"@id": "as:to",
"@type": "@id",
"@container": "@set",
},
"cc": {
"@id": "as:cc",
"@type": "@id",
"@container": "@set",
},
"tag": {
"@id": "as:tag",
"@type": "@id",
"@container": "@set",
},
"items": {
"@id": "as:items",
"@type": "@id",
"@container": "@set",
},
"attachment": {
"@id": "as:attachment",
"@type": "@id",
"@container": "@set",
},
"Hashtag": "as:Hashtag",
},
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/multikey/v1",
]
Defines the context about:bovine used internally in the bovine stack
bovine_context_name
module-attribute
Defines the name of the bovine context
default_context
module-attribute
default_context = [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
"https://www.w3.org/ns/did/v1",
"https://w3id.org/security/multikey/v1",
{"Hashtag": "as:Hashtag"},
]
Defines the context used to communicate with other Fediverse software
combine_items
Takes data and replaces ids by the corresponding objects from items
split_into_objects
async
Takes an object with an “id” property and separates out all the subobjects with an id