CompositeAnnotation

A CompositeAnnotation contains two elements: a PhysicalProperty and an Entity. The PhysicalProperty describes the type of quantity being modeled, e.g. molecule concentration (Molar), amount (moles or grams), fluid volume (L), pressure (Pa), etc. A composite annotation always contains exactly one physical property. When the model is exported to RDF, the physical property will be encoded using an isPropertyOf relation (see bqb::isPropertyOf). The following diagram shows a composite annotation and its two most important elements - the physical property and entity.

SVG-Viewer needed.

The Entity describes what the model element is and (optionally) where it is in the physical world. An entity contains a definition URI which describes what it is (e.g. a ChEBI identifier for reaction network models or an FMA identifier for physiological models), and an optional linear chain of descriptor terms which provide further information that describes where the element is in the physical world. See the documentation of the EntityDescriptor class for an example. Expanding the Entity part of a composite annotation yields the following diagram:

SVG-Viewer needed.

class CompositeAnnotation : public semsim::AnnotationBase

Composite annotations allow more precise descriptions of model elements than singular (“plain”) Annotations. Whereas singular annotations specify the chemical identity of an SBML species or the physiological identity of a CellML variable, composite annotations also provide two additional pieces of information: the PhysicalProperty of an element, which specifies the physical quantity the element represents (e.g. concentration or amount of an SBML species; liquid volume or electric current of a CellML variable), and a linear chain of terms (the EntityDescriptor) that describes what the element is (e.g. the chemical identity of an SBML species) and where it is in the physical world.

For example, to describe an SBML species representing the cytosolic glucose concentration in a pancreatic beta cell, one would need to specify that the species represents glucose (CHEBI:17234) inside the cytosolic compartment (GO:0005829) of a pancreatic beta cell (CL:0000169). The following code snippet illustrates how to construct a CompositeAnnotation for this example:

// this example assumes you are using C++11 mode
// (controlled by the SEMSIM_CXX_STANDARD CMake variable)

Public Functions

CompositeAnnotation(const std::string &metaid, const PhysicalProperty &property, const Entity &entity)

Construct a CompositeAnnotation given a physical property (what is the quantity being represented - chemical concentration, fluid volume, etc.?) and a domain descriptor (“what” is the chemical identity and “where” does the entity reside in physical space?)

Parameters
  • property: The physical property of this composite annotation. Always provided.

  • entity: The entity contains all information outside of the physical property. This tells you “what” the element is (e.g. by specifying chemical identity) and “where”. For example, if the annotation describes “cytosolic glucose concentration in a pancreatic beta cell”, the entity would contain a definition (glycose) and two structural relations specifying the entity is occurs in the cytosol, which in turn is part of a pancreatic beta cell.

CompositeAnnotation(const CompositeAnnotation &other)

Copy constructor.

CompositeAnnotation(const SingularAnnotation &other, const PhysicalProperty &property)

Construct from a singular annotation. Copy all definitions and terms.

Parameters
  • other: The singular annotation to copy.

  • property: The physical property to assign to the composite annotation.

bool isEntityEmpty() const

This function returns true if the physical entity descriptor is empty. This should not be the case for any useful annotation.

Return

Whether the physical entity descriptor is empty.

Return

The EntityDescriptor describing the physical entity of this annotation. This function returns true if the Entity element of this composite annotation is empty. The entity describes “what” the model element is and “where” the it is located. IGNORE: It is typically empty for annotations read in from SBML models, since SBML has no way of expressing the “where” part of a composite annotation. However, if the SBML entity is a species that resides in a compartment, SemSim may automatically insert a domain descriptor encoding the species/compartment relationship ( and this function will return false).

Return

Whether the physical domain descriptor is empty.

const Entity &getEntity() const

Return

The EntityDescriptor describing the physical entity of this annotation.

Entity &getEntity()

Return

The EntityDescriptor describing the physical entity of this annotation.

void addTerm(const Relation &relation, const Resource &resource)

Shortcut for adding a descriptor term to the last entity descriptor (often, there is just one entity descriptor). Create a new EntityDescriptor if none exist.

Parameters
  • relation: The relation that the new term should use.

  • resource: The resource that the term should point to.

virtual AnnotationBase *clone() const

Create a copy of this object using the correct derived class’s type.

This function returns true if this annotation can be encoded in an SBML model (i.e. its domain descriptor must be empty). The only exception to this is when the domain descriptor consists of a single term, and that term describes the compartment that the entity resides in.

Return

[description]

virtual void serializeToRDF(const URI &sbml_base_uri, raptor_world *world, raptor_serializer *serializer) const

Serialize this annotation to RDF using the Raptor library. The RDF serialization format is chosen when initializing the raptor_serializer, and must be done before calling this function.

Parameters
  • world: Raptor world object. Must be initialized prior to calling this function.

  • serializer: Raptor serializer object. Must be initialized prior to calling this function.

const std::string &getMetaId() const

Return

the URI for this element (usually a local identifier).

void setMetaId(const std::string &metaid)

Set the meta id for this annotation.

Parameters
  • metaid: The meta id.

AnnotationPtr makeComposite(const PhysicalProperty &prop) const

Convert singular annotations to composite annotations by copying their definitions and terms. Effect when called on an instance of CompositeAnnotation is to create a clone.

Return

A new composite annotation

std::string humanize() const

Return a humanreadable representation of the annotation information. Ontology terms will be replaced with human-readable names.