EnergyDiff

class omexmeta::EnergyDiff : public omexmeta::PropertyBearer

Public Functions

EnergyDiff() = delete

default constructor for EnergyDiff

deliberately deleted. If you try using the builder interface (chaining setter methods) from a default instantiated EnergyDiff you will get an error, because there will be no model assicated with EnergyDiff. Instead, always instantiate a EnergyDiff from the Editor::addEnergyDiff() method.

~EnergyDiff() = default
EnergyDiff(LibrdfModel &model, UriHandler &uriHandler, PhysicalProperty physicalProperty, Sources sources, Sinks sinks)
void free()

Free nodes associated with EnergyDiff.

The EnergyDiff is owned by the caller if the EnergyDiff::toTriples method is NOT used. When toTriples() is used, the nodes that create the EnergyDiff are “given” to the Triples object, which automatically destroys them at the right time.

Most of the time, users will not have to remember to free the EnergyDiff themselves as the toTriples method is always used.

explicit EnergyDiff(LibrdfModel &model, UriHandler &uriHandler)

constructor for instantiating a EnergyDiff type composite annotation

Users do not need to instantiate EnergyDiff manually, since it is done by Editor. This constructor instantiates an empty EnergyDiff object which is filled by

Parameters
  • model. – A librdf_model pass down by Editor.

  • model_uri. – String passed down by Editor. The local uri to use for metaids

std::string createMetaId()

create a metaid for the energy differential annotation

a new metaid for EnergyDiff

const Sources &getSources() const

return vector of Source objects assocated with EnergyDiff

Returns

a vector of SourceParticipants

const Sinks &getSinks() const

return vector of Sink objects assocated with EnergyDiff

Returns

a vector of SinkParticipants

virtual Triples toTriples() override

converts the PhyicalForce object into a Triples object.

When this method is called ownership of all RDF nodes gets transferred from the caller to the returned Triples object.

Returns

a Triples object containing the individual Triple objects of a EnergyDiff.

OMEXMETA_DEPRECATED EnergyDiff & setPhysicalProperty (PhysicalProperty physicalProperty)

sets the physical property of the EnergyDiff @parameter physicalProperty An instance of PhysicalProperty representing the physical property term for the EnergyDiff.

Prefer the other setPhysicalProperty method since it only requires a string input and instantiates the PhysicalProperty for you.

For developers. Consider removing.

Returns

a reference to this EnergyDiff to enable the builder interface.

OMEXMETA_DEPRECATED EnergyDiff & setPhysicalProperty (std::string subject_metaid, const std::string &physical_property)

sets the physical property of the EnergyDiff

Parameters
  • subject_metaid. – The subject portion of the two triples produced by PhysicalProperty. Metaid of a model element.

  • A – string representing the OPB term to use as the physical property. Like “OPB:OPB_1234”

Returns

a reference to this EnergyDiff to enable the builder interface.

EnergyDiff &addSource(const std::string &physical_entity_reference, eUriType type)

add a SourceParticipant to the EnergyDiff.

See SourceParticipant documentation for more details on arguments.

Parameters
  • metaid – the ID for the SourceParticipant.

  • multiplier – The multiplier argument for SourceParticipant

  • physical_entity_reference – The physicalEntityReference argument for the SourceParticipant.

Returns

a reference to this EnergyDiff to enable the builder interface.

EnergyDiff &addSink(const std::string &physical_entity_reference, eUriType type)

add a SinkParticipant to the EnergyDiff.

See SinkParticipant documentation for more details on arguments.

Parameters
  • sink_metaid – the ID for the SinkParticipant.

  • multiplier – The multiplier argument for SinkParticipant

  • physical_entity_reference – The physicalEntityReference argument for the SinkParticipant.

Returns

a reference to this EnergyDiff to enable the builder interface.

int getNumSources()

returns the number of sources associated with the EnergyDiff

Returns

the integer number of sources

int getNumSinks()

returns the number of sinks associated with the EnergyDiff

Returns

the integer number of sinks

bool operator==(const EnergyDiff &rhs) const
bool operator!=(const EnergyDiff &rhs) const
EnergyDiff &isVersionOf(const std::string &property)

set the isVersionOf portion of the EnergyDiff composite annotation

This method will set the LibrdfNode resource_ attribute of the PhysicalProperty associated with the PhysicalProcess.

Parameters

is_version_of – the string to be used as the LibrdfNode portion of the isVersionOf Triple. This should be of the form OPB:OPB_12345 or OPB/OPB_12345.

virtual EnergyDiff &about(const std::string &about, eUriType type) override

set the subject (rdf:about) portion of the EnergyDiff composite annotation

This method will set the LibrdfNode subject_ attribute of the PhysicalProperty associated with the PhysicalProcess.

Parameters

about – the string to be used as the LibrdfNode portion of the isVersionOf Triple. This should be an existing metaid on the model you are annotating. Will error when metaid does not exist.

virtual EnergyDiff &about(const std::string &about) override

Since we can’t have default arguments on a virutal member function we instead have an overload where the absent eUriType parameter is assumed to be the default value of NONE. Note, it may be prudent to figure out which of LOCAL or MODEL uri would be a better default.

EnergyDiff &isPropertyOf(const std::string &is_property_of, eUriType type)
EnergyDiff &propertyIsVersionOf(const std::string &is_version_of)
virtual const std::string &getPropertyMetaidBase() const override
virtual EnergyDiff &hasProperty(const PhysicalProperty &property) override
virtual EnergyDiff &hasProperty(const std::string &property_about, eUriType about_uri_type, const std::string &is_version_of, const std::string &is_property_of, eUriType is_property_of_uri_type) override
virtual EnergyDiff &hasProperty(const std::string &is_version_of) override
virtual EnergyDiff &hasProperty(const std::string &property_about, eUriType about_uri_type, const std::string &is_version_of) override

Private Members

Sources sources_
Sinks sinks_
std::string property_metaid_base_ = "EnergyDiffProperty"