Menu

#7 SEDML archive not include model files

2.3
pending
None
7
2016-07-31
2016-07-13
No

From Chris Myers
When I write a SEDML archive, it seems to not include the body of the model files. Granted this is low priority as I should likely move to COMBINE archive, but I thought it might be nice to use if it worked.

Related

Bugs: #7

Discussion

  • Richard Adams

    Richard Adams - 2016-07-13

    I've got a project on Github https://github.com/otter606/sedml-validator/tree/master/Omex which uses the SEMS Omex library and jlibsedml to handle Combine archives.
    No guarantees, just experimental code, just in case it's any use.

     
  • Richard Adams

    Richard Adams - 2016-07-27
    • status: open --> accepted
    • assigned_to: Richard Adams
     
  • Richard Adams

    Richard Adams - 2016-07-27

    There is a unit test
    public void testCreateWriteReadRoundTrip() throws Exception
    in LibSEDMLTest that creates an archive then asserts the model is present. Please could you supply some more details of how you generate the archive, how it differs from the code in the test. Is the model file actually missing from the the zip file?

     
    • Chris Myers

      Chris Myers - 2016-07-28

      Below is the code. When I unzip the SED-ML archive, it only has the SED-ML file and not the models.

      List<IModelContent> models = new ArrayList<IModelContent>();
      for (String s : new File(root).list()) {
      if (s.endsWith(".xml")) {
      File modelFile = new File(s);
      FileModelContent fmc = new FileModelContent(modelFile);
      models.add(fmc);
      }
      }
      try {
      byte [] sedx = Libsedml.writeSEDMLArchive(new ArchiveComponents(models,sedmlDocument),sedmlName);
      File file = new File(exportPath);
      FileOutputStream fos = new FileOutputStream(file);
      fos.write(sedx);
      fos.flush();
      fos.close();
      }
      catch (Exception e) {
      JOptionPane.showMessageDialog(frame, "Unable to export SED-ML file.", "Error", JOptionPane.ERROR_MESSAGE);
      }

      On Jul 27, 2016, at 1:44 PM, Richard Adams otter606@users.sf.net wrote:

      There is a unit test
      public void testCreateWriteReadRoundTrip() throws Exception
      in LibSEDMLTest that creates an archive then asserts the model is present. Please could you supply some more details of how you generate the archive, how it differs from the code in the test. Is the model file actually missing from the the zip file?

      [bugs:#7] https://sourceforge.net/p/jlibsedml/bugs/7/ SEDML archive not include model files

      Status: accepted
      Group: 2.3
      Created: Wed Jul 13, 2016 09:00 PM UTC by Richard Adams
      Last Updated: Wed Jul 27, 2016 07:35 PM UTC
      Owner: Richard Adams

      From Chris Myers
      When I write a SEDML archive, it seems to not include the body of the model files. Granted this is low priority as I should likely move to COMBINE archive, but I thought it might be nice to use if it worked.

      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/jlibsedml/bugs/7/ https://sourceforge.net/p/jlibsedml/bugs/7/
      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/ https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #7

  • Richard Adams

    Richard Adams - 2016-07-27
    • status: accepted --> pending
     
  • Richard Adams

    Richard Adams - 2016-07-31

    Hi Chris I put your code into a unit test 'testExportBugReport' in Libsedml test and it works fine.
    Are you sure there are model files in your root folder? I.e is new File(testDataFolder).list() empty?
    I'm sorry, I can't reproduce this.