libSBOL
2.3.3
|
A class which provides an API front-end for online bioparts repositories.
Public Member Functions | |
PartShop (std::string url, std::string spoofed_url="") | |
Construct an interface to an instance of SynBioHub or other parts repository. More... | |
template<class SBOLClass > | |
int | count () |
Return the count of objects contained in a PartShop. More... | |
std::string | sparqlQuery (std::string query) |
Issue a SPARQL query. | |
void | spoof (std::string spoofed_url) |
Specify the URL of a resource that is simulated or spoofed by this PartShop. | |
void | pull (std::string uri, Document &doc, bool recursive=true) |
Retrieve an object from an online resource. More... | |
void | pull (std::vector< std::string > uris, Document &doc, bool recursive=true) |
Retrieve an object from an online resource. More... | |
std::string | searchRootCollections () |
Returns all Collections that are not members of any other Collections. More... | |
std::string | searchSubCollections (std::string uri) |
Returns all Collections that are members of the Collection specified by its URI. More... | |
SearchResponse & | search (std::string search_text, std::string object_type, std::string property_uri, int offset=0, int limit=25) |
An EXACT search. More... | |
SearchResponse & | search (std::string search_text, std::string object_type=SBOL_COMPONENT_DEFINITION, int offset=0, int limit=25) |
A GENERAL search. More... | |
SearchResponse & | search (SearchQuery &q) |
Perform an ADVANCED search using a SearchQuery object. More... | |
int | searchCount (std::string search_text, std::string object_type, std::string property_uri) |
Returns the number of search records for an EXACT search matching the given criteria. More... | |
int | searchCount (std::string search_text, std::string object_type=SBOL_COMPONENT_DEFINITION) |
Returns the number of search records for a general search matching the given criteria. More... | |
int | searchCount (SearchQuery &q) |
Returns the number of search records matching the given criteria for an ADVANCED search. More... | |
std::string | submit (Document &doc, std::string collection="", int overwrite=0) |
Submit an SBOL Document to SynBioHub. More... | |
void | login (std::string user_id, std::string password="") |
In order to submit to a PartShop, you must login first. More... | |
std::string | getURL () |
Returns the network address of the PartShop. More... | |
void | attachFile (std::string topleveluri, std::string filename) |
Upload and attach a file to a TopLevel object in a PartShop. More... | |
void | downloadAttachment (std::string attachment_uri, std::string path=".") |
Download a file attached to a TopLevel object in an online repository. More... | |
|
inline |
Construct an interface to an instance of SynBioHub or other parts repository.
The | URL of the online repository |
void attachFile | ( | std::string | topleveluri, |
std::string | filename | ||
) |
int count | ( | ) |
Return the count of objects contained in a PartShop.
SBOLClass | The type of SBOL object, usually a ComponentDefinition |
void downloadAttachment | ( | std::string | attachment_uri, |
std::string | path = "." |
||
) |
Download a file attached to a TopLevel object in an online repository.
attachment_uri | The full URI of the attached object |
path | The target path to which the file will be downloaded |
string getURL | ( | ) |
Returns the network address of the PartShop.
void login | ( | std::string | user_id, |
std::string | password = "" |
||
) |
void pull | ( | std::string | uri, |
Document & | doc, | ||
bool | recursive = true |
||
) |
Retrieve an object from an online resource.
uri | The identity of the SBOL object you want to retrieve |
doc | A document to add the data to |
void pull | ( | std::vector< std::string > | uris, |
Document & | doc, | ||
bool | recursive = true |
||
) |
Retrieve an object from an online resource.
uris | A vector of URIs for multiple SBOL objects you want to retrieve |
doc | A document to add the data to |
SearchResponse & search | ( | std::string | search_text, |
std::string | object_type, | ||
std::string | property_uri, | ||
int | offset = 0 , |
||
int | limit = 25 |
||
) |
An EXACT search.
Scan the parts repository for objects that exactly match the specified criteria. In most uses of this function, LibSBOL's built-in RDF type constants (see constants.h) will come in handy. For instance, searching for all SBOL_COMPONENT_DEFINITION of type BIOPAX_DNA. (These constants follow a fairly systematic and consistent naming scheme (see constants.h). The number of records returned in the search is specified by offset and limit parameters.
search_text | This may be a literal text value or it may be a URI. |
object_type | The RDF type of an SBOL object. See constants.h. For example, SBOL_COMPONENT_DEFINITION |
property_uri | The RDF type of an SBOL property. Specifies which field of an SBOL object to search. For example, SBOL_ROLES. Refer to constants.h |
offset | The index of the first record to return. This parameter is indexed starting from zero. |
limit | The total count number of records to return |
SearchResponse & search | ( | std::string | search_text, |
std::string | object_type = SBOL_COMPONENT_DEFINITION , |
||
int | offset = 0 , |
||
int | limit = 25 |
||
) |
A GENERAL search.
Search name, description, and displayId properties for a match to the search text, including matches to substrings of the property value. The type of object to search for can be further restricted by use of the second parameter, though this is set to SBOL_COMPONENT_DEFINITION by default. See constants.h for more of libSBOL's built-in RDF type constants. These constants follow a fairly predictable and consistent naming scheme. The number of records returned in the search is specified by offset and limit parameters.
search_text | A snippet of text to search for in a property's value. |
object_type | The RDF type of an SBOL object. See constants.h. For example, SBOL_COMPONENT_DEFINITION by default. |
offset | The index of the first record to return. This parameter is indexed starting from zero. |
limit | The total count number of records to return |
SearchResponse & search | ( | SearchQuery & | q | ) |
Perform an ADVANCED search using a SearchQuery object.
search_query | A map of string key-value pairs. Keys are objectType, sbolTag, collection, dcterms:tag, namespace/tag, offset, limit. |
int searchCount | ( | std::string | search_text, |
std::string | object_type, | ||
std::string | property_uri | ||
) |
Returns the number of search records for an EXACT search matching the given criteria.
int searchCount | ( | std::string | search_text, |
std::string | object_type = SBOL_COMPONENT_DEFINITION |
||
) |
Returns the number of search records for a general search matching the given criteria.
int searchCount | ( | SearchQuery & | q | ) |
Returns the number of search records matching the given criteria for an ADVANCED search.
search_query | A map of string key-value pairs. See SearchQuery for required and optional criteria. |
std::string searchRootCollections | ( | ) |
Returns all Collections that are not members of any other Collections.
doc | A Document to add the Collections to |
std::string searchSubCollections | ( | std::string | uri | ) |
Returns all Collections that are members of the Collection specified by its URI.
uri | The URI of a Collection of Collections |
doc | A Document to add the subcollections to |
std::string submit | ( | Document & | doc, |
std::string | collection = "" , |
||
int | overwrite = 0 |
||
) |
Submit an SBOL Document to SynBioHub.
doc | The Document to submit |
collection | The URI of an SBOL Collection to which the Document contents will be uploaded |
overwrite | An integer code: '0' prevent, '1' overwrite, '2' merge and prevent, '3' merge and overwrite |