metadata Package

metadata Package

Package with metadata datastructures

metadata_data Module

Define infrastructure for describing metadata (in memory)

class omsi.datastructures.metadata.metadata_data.metadata_dict

Bases: dict

Dictionary’s for storing metadata information. The values in the dict must be of type omsi_metadata_value and the keys must be strings.

get_metadata_descriptions()

Get a list of all metadata descriptions

get_metadata_units()

Get a list of all metadata units

get_metadata_values()

Get a list of all metadata values.

class omsi.datastructures.metadata.metadata_data.metadata_value(name, value, description, unit=None, ontology=None)

Bases: dict

A single metadata value

  • name The name of the metadata value
  • value The actual value associated with the metadata object
  • description The text description of the metadata object
  • unit The unit string
  • ontology Optional ontology
Parameters:
  • name – The name of the metadata value. Name may be None if the metadata_value is added to a metadata_dict as it will be set (if missing) when adding it to the metadata_dict
  • value – The actual value associated with the metadata object
  • description – The text description of the metadata object
  • unit – The unit string
  • ontology – Optional ontology

metadata_ontologies Module

Define ontologies for metadata

var METADATA_ONTOLOGIES:
 
Description of simple ontologies for metadata. This is a dict where the

values are the descriptions of the ontologies and the key is the commonly used name of the variable associated with the ontology, however, in practice an ontology may be associated with many different metadata values (the purpose of th ontology is to standardize the values not the names of metadata variables). Available ontologies include:

  • polarity : Description of the polarity of the instrument
  • msn_value_of_n : Numeric level of mass spectrometry used (e.g., 1 for MS1 etc).

An ontology can be many things. In general an ontology is a mechanism to formally name and define the types, properties, and interrelationships of entities. We here refer broadly to the concept of ontologies as a means to standardize the names of things. To define an ontology we use simple dicts with the following key/value entries:

  • name: The name of the ontology
  • value : Python dict describing the actual ontology. Often this is simply a dict where the the keys are the allowed values and the value is the textual description of the meaning of that value. In many cases this may be a more complete description of an ontology.
  • unit : The standard unit associated with the values (or None if not unit is available)
  • description : Human-readable textual description of the ontology
  • version : The version of the ontology used
  • ‘uri` : The Universal Remote Identifier (often a URL) associated with the ontology (or None)

Ontologies are stored in the OpenMSI data format as JSON attributes associated with the metadata, i.e., one main restriction is that ontologies should be JSON serializable (which in most cases should be a problem).

class omsi.datastructures.metadata.metadata_ontologies.metadata_ontologies

Bases: dict

Helper class for interacting with ontologies