use of org.jdom.Namespace in project vcell by virtualcell.
the class SEDMLExporter method getSEDMLFile.
public String getSEDMLFile(String sPath) {
// Create an SEDMLDocument and create the SEDMLModel from the document, so that other details can be added to it in translateBioModel()
SEDMLDocument sedmlDocument = new SEDMLDocument();
sedmlDocument.getSedMLModel().setAdditionalNamespaces(Arrays.asList(new Namespace[] { Namespace.getNamespace(SEDMLTags.SBML_NS_PREFIX, SEDMLTags.SBML_NS_L2V4) }));
sedmlModel = sedmlDocument.getSedMLModel();
translateBioModelToSedML(sPath);
// write SEDML document into SEDML writer, so that the SEDML str can be retrieved
return sedmlDocument.writeDocumentToString();
}
use of org.jdom.Namespace in project vcell by virtualcell.
the class PathwayReaderBiopax3 method addObjectBiochemicalReaction.
private BiochemicalReaction addObjectBiochemicalReaction(Element element) {
Namespace bp = Namespace.getNamespace("bp", "http://www.biopax.org/release/biopax-level3.owl#");
if (element.getChild("TransportWithBiochemicalReaction", bp) != null) {
return addObjectTransportWithBiochemicalReaction(element.getChild("TransportWithBiochemicalReaction", bp));
}
BiochemicalReaction biochemicalReaction = new BiochemicalReactionImpl();
addAttributes(biochemicalReaction, element);
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentBiochemicalReaction(biochemicalReaction, element, childElement)) {
showUnexpected(childElement);
}
}
}
pathwayModel.add(biochemicalReaction);
return biochemicalReaction;
}
use of org.jdom.Namespace in project vcell by virtualcell.
the class DataBaseReferenceReader method getReferenceFromUniProt.
private static String getReferenceFromUniProt(String moleculeID, String dbFormat, String dbStyle) throws ServiceException, DbfConnException, DbfNoEntryFoundException, DbfParamsException, DbfException, InputException, RemoteException {
String referenceName = null;
String xmlStr = getXMLFromUniProt(moleculeID, dbFormat, dbStyle);
// get root
Element uniprotRoot = XmlUtil.stringToXML(xmlStr, null).getRootElement();
Namespace uniprotNameSpace = uniprotRoot.getNamespace();
// get entry
Element entryElement = uniprotRoot.getChild(UniProt_EntryTag, uniprotNameSpace);
// get name
if (entryElement == null) {
// not a big deal if we cannot get the uniprot name
return null;
}
Element nameElement = entryElement.getChild(Uniprot_NameTag, uniprotNameSpace);
if (nameElement == null) {
return null;
}
referenceName = nameElement.getText();
return referenceName;
}
use of org.jdom.Namespace in project vcell by virtualcell.
the class DataBaseReferenceReader method getReferenceFromInterpro.
private static String getReferenceFromInterpro(String dbName, String moleculeID, String dbFormat, String dbStyle) throws ServiceException, DbfConnException, DbfNoEntryFoundException, DbfParamsException, DbfException, InputException, RemoteException {
String referenceName = null;
String xmlStr = getXMLFromInterpro(dbName, moleculeID, dbFormat, dbStyle);
// get root
Element root = XmlUtil.stringToXML(xmlStr, null).getRootElement();
Namespace nameSpace = root.getNamespace();
// get entry
Element entryElement = root.getChild(Interpro_EntryTag, nameSpace);
// get name
if (entryElement == null) {
// not a big deal if we cannot get the interpro name
return null;
}
Element nameElement = entryElement.getChild(Interpro_NameTag, nameSpace);
if (nameElement == null) {
return null;
}
referenceName = nameElement.getText();
return referenceName;
}
use of org.jdom.Namespace in project vcell by virtualcell.
the class PathwayReader method addObjectPhysicalEntity.
private PhysicalEntity addObjectPhysicalEntity(Element element) {
PhysicalEntity physicalEntity = new PhysicalEntity();
Namespace rdf = Namespace.getNamespace("rdf", DefaultNameSpaces.RDF.uri);
if (element.getAttributes().size() > 0) {
physicalEntity = new PhysicalEntity();
addAttributes(physicalEntity, element);
}
for (Object child : element.getChildren()) {
if (child instanceof Element) {
Element childElement = (Element) child;
if (!addContentPhysicalEntity(physicalEntity, element, childElement)) {
showUnexpected(childElement, physicalEntity);
}
}
}
pathwayModel.add(physicalEntity);
return physicalEntity;
}
Aggregations