Annotations

Annotations are arbitrary metadata attached to Synapse entities. They can be accessed like ordinary object properties or like dictionary keys:

entity.my_annotation = 'This is one way to do it'
entity['other_annotation'] = 'This is another'

Annotations can be given in the constructor for Synapse Entities:

entity = File('data.xyz', parent=my_project, rating=9.1234)

Annotate the entity with location data:

entity.lat_long = [47.627477, -122.332154]

Record when we collected the data:

from datetime import datetime as Datetime
entity.collection_date = Datetime.now()

See:

Annotating data sources

Data sources are best recorded using Synapse’s provenance tools.

Implementation details

In Synapse, entities have both properties and annotations. Properties are used by the system, whereas annotations are completely user defined. In the Python client, we try to present this situation as a normal object, with one set of properties.

For more on the implementation and a few gotchas, see the documentation on synapseclient.entity.

See also: