Skip to content

Commit

Permalink
Merge pull request #115 from NeuroML/feat/sed-ml-id-fix
Browse files Browse the repository at this point in the history
sedml fixes for biosimulations
  • Loading branch information
pgleeson authored Apr 18, 2024
2 parents aa62f9b + ce395cf commit 62cfdc8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/org/lemsml/export/sedml/SEDMLWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ else if(modelFormat == Format.CELLML)
}

String genId = prefix + id + "_" + lineOrColumnComp.getID().replace(" ","_");
String varFull = pop + "_" + num+segid + "_" + var;
String varFull = genId + "_" + pop + "_" + num+segid + "_" + var;

startElement(main, "dataGenerator", "id=" + genId, "name=" + genId);
startElement(main, "listOfVariables");
Expand Down Expand Up @@ -212,12 +212,13 @@ else if(modelFormat == Format.CELLML)
if(dispOrOutputComp.getTypeName().equals("OutputFile"))
{
String reportName = dispOrOutputComp.getStringValue("fileName").replace(".dat","");
String reportId = reportName.replaceAll("[\\W]", "_");
String ofId = dispOrOutputComp.getID().replace(" ","_");

startElement(main, "report", "id=" + reportName);
startElement(main, "report", "id=" + reportId);
startElement(main, "listOfDataSets");

startEndElement(main, "dataSet", "id=time", "name=time", "dataReference=time", "label=time");
startEndElement(main, "dataSet", "id=" + reportId + "_time", "name=time", "dataReference=time", "label=time");

for(Component ocComp : dispOrOutputComp.getAllChildren())
{
Expand All @@ -227,7 +228,7 @@ else if(modelFormat == Format.CELLML)
String ocid = ocComp.getID().replace(" ","_");

String genId = OUTPUT_PREFIX + ofId + "_" + ocid;
startEndElement(main, "dataSet", "id=" + ocid, "name=" + genId, "dataReference=" + genId, "label=" + genId);
startEndElement(main, "dataSet", "id=" + reportId + "_" + ocid, "name=" + genId, "dataReference=" + genId, "label=" + genId);
}
}
endElement(main, "listOfDataSets");
Expand Down

0 comments on commit 62cfdc8

Please sign in to comment.