def setUpClass(cls): print("Running " + cls.__name__) yeastGates_json = 'example/xplan/yeastGates-Q0-v2.json' yeastGates_sbol = 'example/sbol/yeastGates-Q0-v2.xml' om_path = 'example/om/om-2.0.rdf' cls.sbolDoc = Document() cls.sbolDoc.read(yeastGates_sbol) with open(yeastGates_json) as jsonFile: jsonData = json.load(jsonFile) cls.converted_sbol = xbol.convert_xplan_to_sbol(jsonData, SBOLNamespace.HTTPS_HS, om_path, True) cls.xplan_data = XplanDataParser(jsonData)
def setUpClass(cls): print("Running " + cls.__name__) rule30_json = 'example/xplan/yg_t3.json' om_path = 'example/om/om-2.0.rdf' with open(rule30_json) as jsonFile: jsonData = json.load(jsonFile) cls.xplanData = XplanDataParser(jsonData) cls.sbolDoc = xbol.convert_xplan_to_sbol(jsonData, SBOLNamespace.HTTPS_HS, om_path, True) # print(cls.sbolDoc.writeString()) print(cls.sbolDoc) cls.sbol_idDict = SBOLTestUtil(cls.xplanData) cls.attachments_tl = [] cls.experiments_tl = [] cls.experimentalData_tl = [] cls.implementations_tl = [] cls.measures_tl = [] cls.units_tl = [] for topLevel in cls.sbolDoc: if topLevel.type == SBOLNamespace.ATTACHMENT_NS: cls.attachments_tl.append(topLevel) elif topLevel.type == SBOLNamespace.EXPERIMENT_NS: cls.experiments_tl.append(topLevel) elif topLevel.type == SBOLNamespace.EXPERIMENTAL_DATA_NS: cls.experimentalData_tl.append(topLevel) elif topLevel.type == SBOLNamespace.IMPLEMENTATION_NS: cls.implementations_tl.append(topLevel) elif topLevel.type == SBOLNamespace.MEASURE_NS: cls.measures_tl.append(topLevel) elif topLevel.type == SBOLNamespace.UNIT_NS: cls.units_tl.append(topLevel) elif topLevel.type == SBOLNamespace.ACTIVITY_NS: continue #No need to store this when I can directly access through sbolDoc else: print("Warning! Unexpected SBOL object was found: " + topLevel.type)