bovine.jsonld
This modules contains some helper functions to deal with json-ld <https://json-ld.org/>
. It realies on the pyld <https://github.com/digitalbazaar/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 <https://www.w3.org/ns/activitystreams>
_ the value of to
can either be a string or a list. With the bovine context, it will always be a list.
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']
module-attribute
Defines the context about:bovine used internally in the bovine stack
bovine_context_name = 'about:bovine'
module-attribute
Defines the name of the bovine context
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'}]
module-attribute
Defines the context used to communicate with other Fediverse software
jsonld_cache = JsonLDCache()
module-attribute
Stores the cached contexts
combine_items(data, items)
Takes data and replaces ids by the corresponding objects from items
split_into_objects(input_data)
async
Takes an object with an “id” property and separates out all the subobjects with an id