Show
Ignore:
Timestamp:
03/02/10 11:24:34 (6 months ago)
Author:
martijn
Message:

Convert embedded biopax from level 2 to level 3. Fixes #1129

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/core/org/pathvisio/model/GpmlFormat2010a.java

    r3130 r3131  
    2828 
    2929import org.bridgedb.DataSource; 
     30import org.jdom.Attribute; 
    3031import org.jdom.Document; 
    3132import org.jdom.Element; 
     
    788789        } 
    789790 
     791        protected void mapBiopax(PathwayElement o, Element e) throws ConverterException 
     792        { 
     793                //this method clones all content, 
     794                //getContent will leave them attached to the parent, which we don't want 
     795                //We can safely remove them, since the JDOM element isn't used anymore after this method 
     796                Element root = new Element("RDF", GpmlFormat.RDF); 
     797                root.addNamespaceDeclaration(GpmlFormat.RDFS); 
     798                root.addNamespaceDeclaration(GpmlFormat.RDF); 
     799                root.addNamespaceDeclaration(GpmlFormat.OWL); 
     800                root.addNamespaceDeclaration(GpmlFormat.BIOPAX); 
     801                root.setAttribute(new Attribute("base", getGpmlNamespace().getURI() + "#", Namespace.XML_NAMESPACE)); 
     802                //Element owl = new Element("Ontology", OWL); 
     803                //owl.setAttribute(new Attribute("about", "", RDF)); 
     804                //Element imp = new Element("imports", OWL); 
     805                //imp.setAttribute(new Attribute("resource", BIOPAX.getURI(), RDF)); 
     806                //owl.addContent(imp); 
     807                //root.addContent(owl); 
     808 
     809                root.addContent(e.cloneContent()); 
     810                Document bp = new Document(root); 
     811 
     812                o.setBiopax(bp); 
     813        } 
     814 
    790815}