Example #1
0
SBOLObject* createSBOLObject(Document* doc, const char* uri) {
	if (!doc || !uri || isSBOLObjectURI(doc, uri))
		return NULL;
	SBOLObject* obj = malloc(sizeof(SBOLObject));
	obj->uri = createURIProperty(doc);
	obj->xml_annotations = createPointerArray();
	setSBOLObjectURI(obj, uri);
	return obj;
}
Example #2
0
Collection* createCollection(Document* doc, const char* uri) {
	if (!doc || !uri || isSBOLObjectURI(doc, uri))
	    return NULL;
	Collection* col  = malloc(sizeof(Collection));
	col->doc         = doc;
	col->base        = createSBOLCompoundObject(doc, uri);
	col->components  = createPointerArray();
	registerCollection(col);
	return col;
}
Example #3
0
SBOLCompoundObject* createSBOLCompoundObject(Document* doc, const char* uri) {
	if (!doc || !uri || isSBOLObjectURI(doc, uri))
		return NULL;
	SBOLCompoundObject* obj = malloc(sizeof(SBOLCompoundObject));
	obj->base        = createSBOLObject(doc, uri);
	obj->displayID   = createTextProperty();
	obj->name        = createTextProperty();
	obj->description = createTextProperty();
	return obj;
}
SequenceAnnotation* createSequenceAnnotation(Document* doc, const char* uri) {
	if (!doc || !uri || isSBOLObjectURI(doc, uri))
	    return NULL;
	SequenceAnnotation* ann = malloc(sizeof(SequenceAnnotation));
	ann->doc          = doc;
	ann->base         = createSBOLObject(doc, uri);
	ann->genbankStart = createPositionProperty();
	ann->genbankEnd   = createPositionProperty();
	//ann->strand       = 1;
	ann->strand       = createPolarityProperty();
	ann->subComponent = NULL;
	ann->precedes = createPointerArray();
	registerSequenceAnnotation(ann);
	return ann;
}
Example #5
0
char* randomUniqueURI(Document* doc) {
    char* uri = randomString();
    while (isSBOLObjectURI(doc, uri))
        uri = randomString();
    return uri;
}
Example #6
0
void setURIProperty(URIProperty* pro, const char* uri) {
	if (pro && pro->doc && uri && !isSBOLObjectURI(pro->doc, uri))
		setTextProperty(pro->uri, uri);
}