libSBOL  2.3.3
Public Attributes | Public Member Functions | Protected Member Functions | List of all members
SBOLObject Class Reference

Detailed Description

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)
 
SBOLObjectfind (std::string uri)
 Search this object recursively to see if an object or any child object with URI already exists. More...
 
SBOLObjectfind_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...
 

Member Function Documentation

◆ addPropertyValue()

void addPropertyValue ( std::string  property_uri,
std::string  val 
)

Append a value to a user-defined annotation property.

Either a literal or URI value

◆ close()

void close ( )
virtual

Use this method to destroy an SBOL object that is not contained by a parent Document.

If the object does have a parent Document, instead use doc.close() with the object's URI identity as an argument. Recurse through child objects and delete them.

◆ compare()

int compare ( SBOLObject comparand)

Compare two SBOL objects or Documents.

The behavior is currently undefined for objects with custom annotations or extension classes.

Parameters
comparandA pointer to the object being compared to this one.
Returns
1 if the objects are identical, 0 if they are different

◆ find()

SBOLObject * find ( std::string  uri)

Search this object recursively to see if an object or any child object with URI already exists.

Parameters
uriThe URI to search for.
Returns
A pointer to theobject with this URI if it exists, NULL otherwise

◆ find_property()

SBOLObject * find_property ( std::string  uri)

Search this object recursively to see if it contains a member property with the given RDF type.

Parameters
uriThe RDF type of the property to search for.
Returns
A pointer to the object that contains a member property with the specified RDF type, NULL otherwise

◆ find_property_value()

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.

Parameters
uriThe RDF type of the property to search for.
valueThe property value to match
Returns
A vector containing all objects found that contain a member property with the specified RDF type

◆ find_reference()

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.

Parameters
uriA URI, either an ontology term or an object reference, to search for
Returns
A vector containing all objects found that contain the URI in a property value

◆ getAnnotation()

std::string getAnnotation ( std::string  property_uri)

Get the value of a custom annotation property by its URI.

Synonymous with getPropertyValue

Parameters
property_uriThe URI for the property
Returns
The value of the property or SBOL_ERROR_NOT_FOUND

◆ getClassName()

std::string getClassName ( std::string  type)
Returns
Parses a local class name from the RDF-type of this SBOL Object

◆ getProperties()

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.

Returns
A vector of URIs that identify the properties contained in this object

◆ getPropertyValue()

std::string getPropertyValue ( std::string  property_uri)

Get the value of a custom annotation property by its URI.

Parameters
property_uriThe URI for the property
Returns
The value of the property or SBOL_ERROR_NOT_FOUND

◆ getPropertyValues()

std::vector< std::string > getPropertyValues ( std::string  property_uri)

Get all values of a custom annotation property by its URI.

Parameters
property_uriThe URI for the property
Returns
A vector of property values or SBOL_ERROR_NOT_FOUND

◆ getTypeURI()

rdf_type getTypeURI ( )
virtual
Returns
The uniform resource identifier that describes the RDF-type of this SBOL Object

◆ register_extension_class()

void register_extension_class ( std::string  ns,
std::string  ns_prefix,
std::string  class_name 
)
protected

Register an extension class and its namespace, so custom data can be embedded into and read from SBOL files.

Template Parameters
ExtensionClassThe new class
Parameters
nsThe extension namespace, eg, http://myhome.org/my_extension#. It's important that the namespace ends in a forward-slash or hash
ns_prefixA shorthand symbol for the full namespace as it will appear in the output file, eg, my_extension

◆ setAnnotation()

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

◆ setPropertyValue()

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


The documentation for this class was generated from the following files:
Inheritance diagram for SBOLObject:
Inheritance graph