Entity¶
-
class
Entity
: public semsim::EntityBase¶ An Entity is one of the two parts of a composite annotation. The entity describes “what” a model element is and “where” it is located in the physical world through a linear chain of descriptor terms contained in the EntityDescriptor element.
An Entity contains one or more definition terms (i.e. ontology resource URIs) that define what the entity is. A valid definition term could be CHEBI:17234, which represents glucose (in the case of a chemical reaction network model) or FMA:9670, which represents blood (in the case of a physiological model). SemSim allows multiple definition URIs, but it is general best practice to annotate a model element with a single definition URI that best captures the model element, i.e. a single ChEBI entity (for molecules) or a single FMA entity (for physiological variables).
An Entity also has EntityDescriptors, which serve to refine the entity by describing “where” it is in the physical world. Currently, an Entity can have zero or one EntityDescriptor elements. In the future, this may be extended to allow multiple EntityDescriptor elements.
Public Types
-
typedef std::vector<EntityDescriptor>
Descriptors
¶ The type used to store the list of entity descriptors. Treat as opaque.
Public Functions
-
Entity
(const std::string &metaid)¶ Empty constructot.
-
Entity
(const std::string &metaid, const Resource &definition, const EntityDescriptor &d)¶ Construct from an EntityDescriptor.
-
Entity
(const SingularAnnotation &annotation)¶ Construct from a singular annotation. Copy all definitions and terms.
-
std::size_t
getNumDescriptors
() const¶ Get the number of EntityDescriptor elements contained in this Entity.
-
const Descriptors &
getDescriptors
() const¶ Get an iterable range of entity descriptors. Treat the return type as opaque, as it may change to some other iterable in a future release.
Entity e(); // C++11 range-based for for(const EntityDescriptor& d : e.getDescriptors()) { // do something with d }
- Return
An iterable of EntityDescriptor elements.
-
Descriptors &
getDescriptors
()¶ Get an iterable range of entity descriptors. Treat the return type as opaque, as it may change to some other iterable in a future release.
Entity e(); // C++11 range-based for for(const EntityDescriptor& d : e.getDescriptors()) { // do something with d }
- Return
An iterable of EntityDescriptor elements.
-
void
addDescriptor
(const EntityDescriptor &d)¶ Add an EntityDescriptor to this Entity (copy).
- Parameters
d
: The descriptor to add.
-
const EntityDescriptor &
getDescriptor
(std::size_t k) const¶ Get the EntityDescriptor at index
k
.
-
EntityDescriptor &
getDescriptor
(std::size_t k)¶ Get the EntityDescriptor reference at index
k
.
-
void
serializeToRDF
(const URI &sbml_base_uri, raptor_world *world, raptor_serializer *serializer) const¶ Serialize this entity 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.- Return
the URI for this entity.
- Parameters
base_uri
: The base URI of this object (usually the metaid of the component this is attached to).world
: Raptor world object. Must be initialized prior to calling this function.serializer
: Raptor serializer object. Must be initialized prior to calling this function.
-
typedef std::vector<EntityDescriptor>