openalea.rsml.metadata#

Manage rsml metadata attributes

The metadata element in rsml contains some mandatory content and optional ones. In the IO operation from openalea.rsml file to&from mtg, these metadata are looked for in the ‘metadata’ graph property of the mtg:

mtg.graph_properties()['metadata']
Mandatory metadata:
  • version: set 1.0

  • unit: default is ‘pixel’

  • resolution: default is 1

  • software: default is ‘openalea’

  • user: default is ‘’

  • file-key: default is a random unique identifier (uuid4)

Optional metadata:
  • property_definition: ….

  • function_definition: ….

  • time_sequence: …

set_metadata can be used to retrieve the metadata dictionary. This function also fill missing items, folowing the specified behavior describe in the function documentation.

Functions

add_property_definition(g, label, type[, ...])

add a rsml property definition to mtg g

filter_literal(obj[, default])

return given obj with only "literal" types

rsml_type(python_type)

Automatically select rsml type for the given python_type

set_metadata(g)

Set the rsml 'metadata' element from the graph-properties of mtg g