|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
An object used to correlate 2 Records. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/develop/src/axom/sina/core/Relationship.hpp>
Public Member Functions | |
| Relationship (ID subject, std::string predicate, ID object) | |
| Create a new relationship. More... | |
| Relationship (conduit::Node const &asNode) | |
| Create a Relationship object from its representation as a conduit Node. More... | |
| ID const & | getSubject () const noexcept |
| Get the subject. More... | |
| ID const & | getObject () const noexcept |
| Get the object. More... | |
| std::string const & | getPredicate () const noexcept |
| Get the predicate. More... | |
| conduit::Node | toNode () const |
| Convert this Relationship to its Node representation. More... | |
An object used to correlate 2 Records.
A Relationship consists of three parts: a subject, an object, and a predicate. It describes a relationship between two Records (and/or Record inheritors, e.g. Run). The subject and object must be IDs referring to valid records, while the predicate may be any string.
In describing the connection between objects, a Relationship is read as "<subject> <predicate> <object>". For example, in the relationship "Alice knows Bob", "Alice" is the subject, "knows" is the predicate, and "Bob" is the object. For further examples:
Note that Relationships are described in the active voice. Avoiding the passive voice in predicates is recommended, as this keeps the "direction" of the relationship constant. An example of a passively-voiced Relationship is "Dani is emailed by Carlos". Instead, this should be phrased as "Carlos emails Dani".
If assembling Relationships programatically, it may be useful to reference the ID documentation.
This would output:
As with any other Sina ID, the subject or object may be either local (uniquely refer to one object in a Sina file) or global (uniquely refer to one object in a database). Local IDs are replaced with global ones upon ingestion; all Relationships referring to that Local ID (as well as the Record possessing that ID) will be updated to use the same global ID.
In the above code, "my_local_run" would be replaced by a global ID on ingestion. If this new global ID was, for example, "5Aed-BCds-23G1", then "my_local_run" would automatically be replaced by "5Aed-BCds-23G1" in both the Record and Relationship entries.
Create a new relationship.
| subject | the subject of the relationship |
| predicate | the predicate describing the relationship from the subject to the object |
| object | the object of the relationship |
|
explicit |
Create a Relationship object from its representation as a conduit Node.
| asNode | the relationship as a Node |
|
inlinenoexcept |
|
inlinenoexcept |
Get the object.
|
inlinenoexcept |
Get the predicate.
| conduit::Node axom::sina::Relationship::toNode | ( | ) | const |
Convert this Relationship to its Node representation.