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; }
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; }
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; }
char* randomUniqueURI(Document* doc) { char* uri = randomString(); while (isSBOLObjectURI(doc, uri)) uri = randomString(); return uri; }
void setURIProperty(URIProperty* pro, const char* uri) { if (pro && pro->doc && uri && !isSBOLObjectURI(pro->doc, uri)) setTextProperty(pro->uri, uri); }