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.
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just tried again with these two print statements included:
for (String s : new File(root).list()) {
if (s.endsWith(".xml")) {
File modelFile = new File(s);
FileModelContent fmc = new FileModelContent(modelFile);
System.out.println(fmc.getName());
System.out.println(fmc.getContents());
models.add(fmc);
}
}
The first one prints:
Leloup1999_CircClock_periodic.xml
The second one prints nothing.
When I unzip the created archive, it includes the SED-ML file and the Leloup file, but the Leloup model file is an empty file. Am I missing something?
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.
Status: pending
Group: 2.3
Created: Wed Jul 13, 2016 09:00 PM UTC by Richard Adams
Last Updated: Wed Jul 27, 2016 07:44 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.
I just tried again with these two print statements included:
for (String s : new File(root).list()) {
if (s.endsWith(".xml")) {
File modelFile = new File(s);
FileModelContent fmc = new FileModelContent(modelFile);
System.out.println(fmc.getName());
System.out.println(fmc.getContents());
models.add(fmc);
}
}
The first one prints:
Leloup1999_CircClock_periodic.xml
The second one prints nothing.
When I unzip the created archive, it includes the SED-ML file and the Leloup file, but the Leloup model file is an empty file. Am I missing something?
Chris
On Jul 31, 2016, at 2:06 PM, Richard Adams otter606@users.sf.net otter606@users.sf.net wrote:
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.
Status: pending
Group: 2.3
Created: Wed Jul 13, 2016 09:00 PM UTC by Richard Adams
Last Updated: Wed Jul 27, 2016 07:44 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.
Status: pending
Group: 2.3
Created: Wed Jul 13, 2016 09:00 PM UTC by Richard Adams
Last Updated: Sun Jul 31, 2016 08:06 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.
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.
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?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);
}
Related
Bugs: #7
I just tried again with these two print statements included:
The first one prints:
Leloup1999_CircClock_periodic.xml
The second one prints nothing.
When I unzip the created archive, it includes the SED-ML file and the Leloup file, but the Leloup model file is an empty file. Am I missing something?
Chris
Related
Bugs: #7
Nevermind. Found the problem. “s” is not a full path. It is only the filename. When I append full path onto s for the file, it picks up the model now.
You can close this one.
Related
Bugs: #7