use of org.vcell.pathway.PathwayModel in project vcell by virtualcell.
the class PathwayIOUtil method extractPathwayFromJDOM.
public static PathwayModel extractPathwayFromJDOM(Document jdomDocument, RDFXMLContext context, ClientTaskStatusSupport statusSupport) {
PathwayModel pathwayModel = null;
Element rootElement = jdomDocument.getRootElement();
@SuppressWarnings("unchecked") List<Namespace> namespaces = rootElement.getAdditionalNamespaces();
boolean itIsLevel3 = false;
for (Namespace namespace : namespaces) {
if (namespace != null && namespace.getURI() != null && namespace.getURI().equals(BioPAX3.ns.uri)) {
itIsLevel3 = true;
break;
}
}
if (itIsLevel3) {
PathwayReaderBiopax3 pathwayReader = new PathwayReaderBiopax3(context);
pathwayModel = pathwayReader.parse(rootElement, true);
} else {
// if it's not level3 we assume it to be level2
// TODO: once biopax version3 becomes dominant change the code to use that as the default
PathwayReader pathwayReader = new PathwayReader(context);
pathwayModel = pathwayReader.parse(rootElement, statusSupport);
}
pathwayModel.reconcileReferences(statusSupport);
pathwayModel.refreshParentMap();
return pathwayModel;
}
Aggregations