libSBOL
2.3.3
|
An SBOLObject converts a C++ class data structure into an RDF triple store and contains methods for serializing and parsing RDF triples.
Public Attributes | |
URIProperty | identity |
The identity property is REQUIRED by all Identified objects and has a data type of URI. A given Identified object’s identity URI MUST be globally unique among all other identity URIs. The identity of a compliant SBOL object MUST begin with a URI prefix that maps to a domain over which the user has control. Namely, the user can guarantee uniqueness of identities within this domain. For other best practices regarding URIs see Section 11.2 of the SBOL specification doucment. | |
Public Member Functions | |
virtual rdf_type | getTypeURI () |
std::string | getClassName (std::string type) |
SBOLObject * | find (std::string uri) |
Search this object recursively to see if an object or any child object with URI already exists. More... | |
SBOLObject * | find_property (std::string uri) |
Search this object recursively to see if it contains a member property with the given RDF type. More... | |
std::vector< SBOLObject * > | find_property_value (std::string uri, std::string value, std::vector< SBOLObject *> matches={}) |
Search this object recursively to see if it contains a member property with the given RDF type and indicated property value. More... | |
std::vector< SBOLObject * > | find_reference (std::string uri) |
Search this object recursively to see if it contains a member property with the given RDF type and indicated property value. More... | |
int | compare (SBOLObject *comparand) |
Compare two SBOL objects or Documents. More... | |
std::string | getPropertyValue (std::string property_uri) |
Get the value of a custom annotation property by its URI. More... | |
std::vector< std::string > | getPropertyValues (std::string property_uri) |
Get all values of a custom annotation property by its URI. More... | |
std::vector< std::string > | getProperties () |
Gets URIs for all properties contained by this object. More... | |
void | setPropertyValue (std::string property_uri, std::string val) |
Set and overwrite the value for a user-defined annotation property. More... | |
void | addPropertyValue (std::string property_uri, std::string val) |
Append a value to a user-defined annotation property. More... | |
void | setAnnotation (std::string property_uri, std::string val) |
Set the value for a user-defined annotation property. More... | |
std::string | getAnnotation (std::string property_uri) |
Get the value of a custom annotation property by its URI. More... | |
virtual void | close () |
Use this method to destroy an SBOL object that is not contained by a parent Document. More... | |
Protected Member Functions | |
template<class ExtensionClass > | |
void | register_extension_class (std::string ns, std::string ns_prefix, std::string class_name) |
Register an extension class and its namespace, so custom data can be embedded into and read from SBOL files. More... | |
void addPropertyValue | ( | std::string | property_uri, |
std::string | val | ||
) |
Append a value to a user-defined annotation property.
Either a literal or URI value
|
virtual |
int compare | ( | SBOLObject * | comparand | ) |
Compare two SBOL objects or Documents.
The behavior is currently undefined for objects with custom annotations or extension classes.
comparand | A pointer to the object being compared to this one. |
SBOLObject * find | ( | std::string | uri | ) |
Search this object recursively to see if an object or any child object with URI already exists.
uri | The URI to search for. |
SBOLObject * find_property | ( | std::string | uri | ) |
Search this object recursively to see if it contains a member property with the given RDF type.
uri | The RDF type of the property to search for. |
vector< SBOLObject * > find_property_value | ( | std::string | uri, |
std::string | value, | ||
std::vector< SBOLObject *> | matches = {} |
||
) |
Search this object recursively to see if it contains a member property with the given RDF type and indicated property value.
uri | The RDF type of the property to search for. |
value | The property value to match |
vector< SBOLObject * > find_reference | ( | std::string | uri | ) |
Search this object recursively to see if it contains a member property with the given RDF type and indicated property value.
uri | A URI, either an ontology term or an object reference, to search for |
std::string getAnnotation | ( | std::string | property_uri | ) |
Get the value of a custom annotation property by its URI.
Synonymous with getPropertyValue
property_uri | The URI for the property |
std::string getClassName | ( | std::string | type | ) |
std::vector< std::string > getProperties | ( | ) |
Gets URIs for all properties contained by this object.
This includes SBOL core properties as well as custom annotations. Use this to find custom extension data in an SBOL file.
std::string getPropertyValue | ( | std::string | property_uri | ) |
Get the value of a custom annotation property by its URI.
property_uri | The URI for the property |
std::vector< std::string > getPropertyValues | ( | std::string | property_uri | ) |
Get all values of a custom annotation property by its URI.
property_uri | The URI for the property |
|
virtual |
|
protected |
Register an extension class and its namespace, so custom data can be embedded into and read from SBOL files.
ExtensionClass | The new class |
ns | The extension namespace, eg, http://myhome.org/my_extension#. It's important that the namespace ends in a forward-slash or hash |
ns_prefix | A shorthand symbol for the full namespace as it will appear in the output file, eg, my_extension |
void setAnnotation | ( | std::string | property_uri, |
std::string | val | ||
) |
Set the value for a user-defined annotation property.
Synonymous with setPropertyValue If the value is a URI, it should be surrounded by angle brackets, else it will be interpreted as a literal value
void setPropertyValue | ( | std::string | property_uri, |
std::string | val | ||
) |
Set and overwrite the value for a user-defined annotation property.
Either a literal or URI value