Commit 2686a5dd authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch 'merge-15.0.2' into 'master'

Merge 15.0.2

See merge request !1218
parents 12b6559f 32c68b14
Pipeline #29296 failed with stage
in 61 minutes and 15 seconds
......@@ -36,6 +36,34 @@ minerva (15.1.0) unstable; urgency=medium
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 18 Jun 2020 16:00:00 +0200
minerva (15.0.2) stable; urgency=medium
* Bug fix: annotations using identifiers.org urls sometimes required http and
sometimes required https url (#1297)
* Bug fix: map notes were not exported to GPML
* Bug fix: reaction notes were not imported from GPML
* Bug fix: export of notes could create invalid GPML file (#1299)
* Bug fix: there was an issue with exporting color and line type of reaction
additional reactant/product (#1303)
* Bug fix: coordinates of children in compact complexes in CellDesigner were
wrong (#1304)
* Bug fix: user data overlays were not removed when user was deleted (#1301)
* Bug fix: kinetic parameters exported to SBML created invalid SBML file
(#1305)
* Bug fix: text area were not converted to GPML using conversion API (#1306)
* Bug fix: name provided by user in comment dialog was not visible in admin
panel (#1245)
* Bug fix: bqmodel:isInstanceOf and bqmodel:hasInstance relation types were
not handled properly (#1281)
* Bug fix: "bqmodel:isInstanceOf", "bqmodel:hasInstance",
"bqbiol:hasProperty", "bqbiol:isPropertyOf" and "bqbiol:hasTaxon" relation
types are not supported by CellDedigner and are now transformed during
export into something readable by CellDesigner (#1281)
* Bug fix: at random time points there was an issue with cached data (#1323)
* Bug fix: connection to DAPI timeouted sometimes which resulted in error
when checking for all chemicals for specfific protein (#1324)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 29 Jun 2020 11:00:00 +0200
minerva (15.0.1) stable; urgency=medium
* Bug fix: when there was problem with DAPI minerva threw unexpected error
(#1316)
......
......@@ -145,9 +145,9 @@ public class WebPageDownloader {
try {
int timeout = HTTP_CONNECTION_TIMEOUT_SEC;
// dapi is slow for now - double timout
// dapi is slow for now
if (accessUrl.indexOf("dapi.lcsb.uni.lu") >= 0) {
timeout *= 3;
timeout *= 10;
}
String result = future.get(timeout, TimeUnit.SECONDS);
executor.shutdownNow();
......
......@@ -98,8 +98,6 @@ public class XmlSerializer<T> {
}
try {
return (T) jaxbUnmarshaller.unmarshal(node);
} catch (JAXBException e) {
throw new SerializationException(e);
} catch (Exception e) { // the library can throw NPE sometimes...
logger.error(e, e);
return null;
......
......@@ -54,6 +54,10 @@ public class CommonXmlParser {
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER = new HashSet<>();
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.addAll(Arrays.asList(MiriamRelationType.values()));
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.remove(MiriamRelationType.BQ_MODEL_IS_DERIVED_FROM);
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.remove(MiriamRelationType.BQ_BIOL_HAS_PROPERTY);
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.remove(MiriamRelationType.BQ_BIOL_IS_PROPERTY_OF);
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.remove(MiriamRelationType.BQ_MODEL_IS_INSTANCE_OF);
RELATION_TYPES_SUPPORTED_BY_CELL_DESIGNER.remove(MiriamRelationType.BQ_MODEL_HAS_INSTANCE);
}
private DocumentBuilderFactory dbFactory;
......
......@@ -152,6 +152,10 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
result.setHeight(view.getBoxSize().getHeight());
result.setLineWidth(view.getSingleLine().getWidth());
result.setFillColor(view.getColor());
if (view.getInnerPosition() != null && state.equalsIgnoreCase("brief")) {
result.setX(result.getX() + view.getInnerPosition().getX());
result.setY(result.getY() + view.getInnerPosition().getY());
}
} else if (!state.equalsIgnoreCase("complexnoborder")) {
throw new InvalidXmlSchemaException("No view (" + state + ") in ComplexAlias for " + result.getElementId());
}
......@@ -235,14 +239,14 @@ public class ComplexAliasXmlParser extends AbstractAliasXmlParser<Complex> {
sb.append("<celldesigner:view state=\"usual\"/>\n");
sb.append("<celldesigner:usualView>");
sb.append("<celldesigner:innerPosition x=\"" + complex.getX() + "\" y=\"" + complex.getY() + "\"/>");
sb.append("<celldesigner:innerPosition x=\"0\" y=\"0\"/>");
sb.append("<celldesigner:boxSize width=\"" + complex.getWidth() + "\" height=\"" + complex.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + complex.getLineWidth() + "\"/>");
sb.append(
"<celldesigner:paint color=\"" + XmlParser.colorToString(complex.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:usualView>\n");
sb.append("<celldesigner:briefView>");
sb.append("<celldesigner:innerPosition x=\"" + complex.getX() + "\" y=\"" + complex.getY() + "\"/>");
sb.append("<celldesigner:innerPosition x=\"0\" y=\"0\"/>");
sb.append("<celldesigner:boxSize width=\"" + complex.getWidth() + "\" height=\"" + complex.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + complex.getWidth() + "\"/>");
sb.append(
......
......@@ -16,7 +16,8 @@ import lcsb.mapviewer.model.map.compartment.Compartment;
import lcsb.mapviewer.model.map.compartment.PathwayCompartment;
import lcsb.mapviewer.model.map.model.Model;
import lcsb.mapviewer.model.map.model.ModelData;
import lcsb.mapviewer.model.map.species.*;
import lcsb.mapviewer.model.map.species.Complex;
import lcsb.mapviewer.model.map.species.Species;
/**
* Parser of CellDesigner xml used for parsing SpeciesAlias.
......@@ -124,6 +125,10 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
result.setHeight(view.getBoxSize().getHeight());
result.setLineWidth(view.getSingleLine().getWidth());
result.setFillColor(view.getColor());
if (view.getInnerPosition() != null && state.equalsIgnoreCase("brief")) {
result.setX(result.getX() + view.getInnerPosition().getX());
result.setY(result.getY() + view.getInnerPosition().getY());
}
} else {
throw new InvalidXmlSchemaException(errorPrefix + "No view in Alias");
}
......@@ -220,16 +225,18 @@ public class SpeciesAliasXmlParser extends AbstractAliasXmlParser<Species> {
// TODO to be improved
sb.append("<celldesigner:view state=\"usual\"/>\n");
sb.append("<celldesigner:usualView>");
sb.append("<celldesigner:innerPosition x=\"" + species.getX() + "\" y=\"" + species.getY() + "\"/>");
sb.append("<celldesigner:innerPosition x=\"0\" y=\"0\"/>");
sb.append("<celldesigner:boxSize width=\"" + species.getWidth() + "\" height=\"" + species.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + species.getLineWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append(
"<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:usualView>\n");
sb.append("<celldesigner:briefView>");
sb.append("<celldesigner:innerPosition x=\"" + species.getX() + "\" y=\"" + species.getY() + "\"/>");
sb.append("<celldesigner:innerPosition x=\"0\" y=\"0\"/>");
sb.append("<celldesigner:boxSize width=\"" + species.getWidth() + "\" height=\"" + species.getHeight() + "\"/>");
sb.append("<celldesigner:singleLine width=\"" + species.getLineWidth() + "\"/>");
sb.append("<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append(
"<celldesigner:paint color=\"" + XmlParser.colorToString(species.getFillColor()) + "\" scheme=\"Color\"/>");
sb.append("</celldesigner:briefView>\n");
if (species.getStateLabel() != null || species.getStatePrefix() != null) {
sb.append("<celldesigner:info state=\"open\" prefix=\"" + species.getStatePrefix() + "\" label=\""
......
......@@ -324,4 +324,11 @@ public class ComplexParserTests extends CellDesignerTestFunctions {
testXmlSerialization(model);
}
@Test
public void testParseCompactComplex() throws Exception {
Model model = getModelForFile("testFiles/complex_compact.xml");
assertTrue(model.getElementByElementId("sa6").getX()>218);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" xmlns:celldesigner="http://www.sbml.org/2001/ns/celldesigner" level="2" version="4">
<model metaid="untitled" id="untitled">
<annotation>
<celldesigner:extension>
<celldesigner:modelVersion>4.0</celldesigner:modelVersion>
<celldesigner:modelDisplay sizeX="600" sizeY="400"/>
<celldesigner:listOfIncludedSpecies>
<celldesigner:species id="s2" name="s2">
<celldesigner:notes>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body/>
</html>
</celldesigner:notes>
<celldesigner:annotation>
<celldesigner:complexSpecies>s1</celldesigner:complexSpecies>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr1</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:annotation>
</celldesigner:species>
<celldesigner:species id="s3" name="s3">
<celldesigner:notes>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body/>
</html>
</celldesigner:notes>
<celldesigner:annotation>
<celldesigner:complexSpecies>s1</celldesigner:complexSpecies>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr2</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:annotation>
</celldesigner:species>
<celldesigner:species id="s4" name="s4">
<celldesigner:notes>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body/>
</html>
</celldesigner:notes>
<celldesigner:annotation>
<celldesigner:complexSpecies>s1</celldesigner:complexSpecies>
<celldesigner:speciesIdentity>
<celldesigner:class>PROTEIN</celldesigner:class>
<celldesigner:proteinReference>pr3</celldesigner:proteinReference>
</celldesigner:speciesIdentity>
</celldesigner:annotation>
</celldesigner:species>
<celldesigner:species id="s5" name="s5">
<celldesigner:notes>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body/>
</html>
</celldesigner:notes>
<celldesigner:annotation>
<celldesigner:complexSpecies>s1</celldesigner:complexSpecies>
<celldesigner:speciesIdentity>
<celldesigner:class>ION</celldesigner:class>
<celldesigner:name>s5</celldesigner:name>
</celldesigner:speciesIdentity>
</celldesigner:annotation>
</celldesigner:species>
</celldesigner:listOfIncludedSpecies>
<celldesigner:listOfCompartmentAliases/>
<celldesigner:listOfComplexSpeciesAliases>
<celldesigner:complexSpeciesAlias id="csa2" species="s1">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="218.5" y="140.0" w="80.0" h="60.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="brief"/>
<celldesigner:backupSize w="0.0" h="0.0"/>
<celldesigner:backupView state="none"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="221.0" height="186.0"/>
<celldesigner:singleLine width="2.0"/>
<celldesigner:paint color="fff7f7f7" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="2.0"/>
<celldesigner:paint color="fff7f7f7" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:complexSpeciesAlias>
</celldesigner:listOfComplexSpeciesAliases>
<celldesigner:listOfSpeciesAliases>
<celldesigner:speciesAlias id="sa3" species="s2" complexSpeciesAlias="csa2">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="218.0" y="140.0" w="80.0" h="60.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="brief"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="20.0" y="28.0"/>
<celldesigner:boxSize width="80.0" height="40.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ffccffcc" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
<celldesigner:speciesAlias id="sa4" species="s3" complexSpeciesAlias="csa2">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="218.0" y="140.0" w="80.0" h="60.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="brief"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="119.0" y="27.0"/>
<celldesigner:boxSize width="80.0" height="50.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ffffffcc" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
<celldesigner:speciesAlias id="sa5" species="s4" complexSpeciesAlias="csa2">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="218.0" y="140.0" w="80.0" h="60.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="brief"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="21.0" y="104.0"/>
<celldesigner:boxSize width="80.0" height="40.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ffccffcc" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
<celldesigner:speciesAlias id="sa6" species="s5" complexSpeciesAlias="csa2">
<celldesigner:activity>inactive</celldesigner:activity>
<celldesigner:bounds x="218.0" y="140.0" w="80.0" h="60.0"/>
<celldesigner:font size="12"/>
<celldesigner:view state="brief"/>
<celldesigner:usualView>
<celldesigner:innerPosition x="147.5" y="114.5"/>
<celldesigner:boxSize width="25.0" height="25.0"/>
<celldesigner:singleLine width="1.0"/>
<celldesigner:paint color="ff9999ff" scheme="Color"/>
</celldesigner:usualView>
<celldesigner:briefView>
<celldesigner:innerPosition x="0.0" y="0.0"/>
<celldesigner:boxSize width="80.0" height="60.0"/>
<celldesigner:singleLine width="0.0"/>
<celldesigner:paint color="3fff0000" scheme="Color"/>
</celldesigner:briefView>
<celldesigner:info state="empty" angle="-1.5707963267948966"/>
</celldesigner:speciesAlias>
</celldesigner:listOfSpeciesAliases>
<celldesigner:listOfGroups/>
<celldesigner:listOfProteins>
<celldesigner:protein id="pr1" name="s2" type="GENERIC"/>
<celldesigner:protein id="pr2" name="s3" type="RECEPTOR"/>
<celldesigner:protein id="pr3" name="s4" type="GENERIC"/>
</celldesigner:listOfProteins>
<celldesigner:listOfGenes/>
<celldesigner:listOfRNAs/>
<celldesigner:listOfAntisenseRNAs/>
<celldesigner:listOfLayers/>
<celldesigner:listOfBlockDiagrams/>
</celldesigner:extension>
</annotation>
<listOfUnitDefinitions>
<unitDefinition metaid="substance" id="substance" name="substance">
<listOfUnits>
<unit metaid="CDMT00001" kind="mole"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="volume" id="volume" name="volume">
<listOfUnits>
<unit metaid="CDMT00002" kind="litre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="area" id="area" name="area">
<listOfUnits>
<unit metaid="CDMT00003" kind="metre" exponent="2"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="length" id="length" name="length">
<listOfUnits>
<unit metaid="CDMT00004" kind="metre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="time" id="time" name="time">
<listOfUnits>
<unit metaid="CDMT00005" kind="second"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment metaid="default" id="default" size="1" units="volume"/>
</listOfCompartments>
<listOfSpecies>
<species metaid="s1" id="s1" name="s1" compartment="default" initialAmount="0">
<annotation>
<celldesigner:extension>
<celldesigner:positionToCompartment>inside</celldesigner:positionToCompartment>
<celldesigner:speciesIdentity>
<celldesigner:class>COMPLEX</celldesigner:class>
<celldesigner:name>s1</celldesigner:name>
</celldesigner:speciesIdentity>
</celldesigner:extension>
</annotation>
</species>
</listOfSpecies>
</model>
</sbml>
......@@ -17,19 +17,20 @@ public class SbmlParameterExporter {
}
public void exportParameter(org.sbml.jsbml.Model result) {
for (SbmlParameter unit : minervaModel.getParameters()) {
result.addParameter(createParameter(unit));
for (SbmlParameter parameter : minervaModel.getParameters()) {
result.addParameter(createParameter(parameter));
}
}
private Parameter createParameter(SbmlParameter unit) {
private Parameter createParameter(SbmlParameter parameter) {
Parameter result = new Parameter();
result.setName(unit.getName());
result.setValue(unit.getValue());
result.setId(unit.getParameterId());
if (unit.getUnits() != null) {
result.setUnits(unit.getUnits().getUnitId());
result.setName(parameter.getName());
result.setValue(parameter.getValue());
result.setId(parameter.getParameterId());
if (parameter.getUnits() != null) {
result.setUnits(parameter.getUnits().getUnitId());
}
result.setConstant(true);
return result;
}
......
......@@ -29,6 +29,7 @@ public class SbmlValidationTests extends SbmlTestFunctions {
result.add(new Object[] { "testFiles/small/empty.xml" });
result.add(new Object[] { "testFiles/small/problematic_notes.xml" });
result.add(new Object[] { "testFiles/small/reaction/dissociation.xml" });
result.add(new Object[] { "testFiles/cell_designer_problems/kinetics.xml" });
return result;
}
......
<?xml version="1.0" encoding="UTF-8"?>
<sbml xmlns="http://www.sbml.org/sbml/level2/version4" xmlns:celldesigner="http://www.sbml.org/2001/ns/celldesigner" level="2" version="4">
<model metaid="untitled" id="untitled">
<annotation>
<celldesigner:extension>
<celldesigner:modelVersion>4.0</celldesigner:modelVersion>
<celldesigner:modelDisplay sizeX="600" sizeY="400"/>
<celldesigner:listOfIncludedSpecies>
</celldesigner:listOfIncludedSpecies>
<celldesigner:listOfCompartmentAliases/>
<celldesigner:listOfComplexSpeciesAliases>
</celldesigner:listOfComplexSpeciesAliases>
<celldesigner:listOfSpeciesAliases>
</celldesigner:listOfSpeciesAliases>
<celldesigner:listOfGroups/>
<celldesigner:listOfProteins>
</celldesigner:listOfProteins>
<celldesigner:listOfGenes/>
<celldesigner:listOfRNAs/>
<celldesigner:listOfAntisenseRNAs/>
<celldesigner:listOfLayers/>
<celldesigner:listOfBlockDiagrams/>
</celldesigner:extension>
</annotation>
<listOfUnitDefinitions>
<unitDefinition metaid="substance" id="substance" name="substance">
<listOfUnits>
<unit metaid="CDMT00008" kind="mole"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="volume" id="volume" name="volume">
<listOfUnits>
<unit metaid="CDMT00009" kind="litre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="area" id="area" name="area">
<listOfUnits>
<unit metaid="CDMT00010" kind="metre" exponent="2"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="length" id="length" name="length">
<listOfUnits>
<unit metaid="CDMT00011" kind="metre"/>
</listOfUnits>
</unitDefinition>
<unitDefinition metaid="time" id="time" name="time">
<listOfUnits>
<unit metaid="CDMT00012" kind="second"/>
</listOfUnits>
</unitDefinition>
</listOfUnitDefinitions>
<listOfCompartments>
<compartment metaid="default" id="default" size="1" units="volume"/>
</listOfCompartments>
<listOfSpecies>
</listOfSpecies>
<listOfParameters>
<parameter metaid="kc1" id="kc1" name="kinetik_c1" value="1" units="substance"/>
<parameter metaid="kc2" id="kc2" name="kinetic_test" value="1" units="substance" constant="false"/>
</listOfParameters>
<listOfReactions>
</listOfReactions>
</model>
</sbml>
......@@ -25,7 +25,7 @@ function Comment(javaObject) {
this.setTitle(javaObject.title);
this.setContent(javaObject.content);
}
this.setAuthor(javaObject.owner);
this.setAuthor(javaObject.author);
this.setEmail(javaObject.email);
}
......
......@@ -79,6 +79,10 @@ public enum MiriamRelationType {
BQ_BIOL_OCCURS_IN("bqbiol:occursIn"),
BQ_MODEL_IS_DERIVED_FROM("bqmodel:isDerivedFrom"),
BQ_MODEL_IS_INSTANCE_OF("bqmodel:isInstanceOf"),
BQ_MODEL_HAS_INSTANCE("bqmodel:hasInstance"),
;
/**
......
......@@ -91,6 +91,24 @@ public class MiriamTypeGenericTest extends ModelTestFunctions {
}
}
@Test
public void httpAndHttpsForIdentifiersOrg() {
if (!deprecated) {
boolean httpIdentifiersOrgUriExists = false;
boolean httpsIdentifiersOrgUriExists = false;
for (String uri : miriamType.getUris()) {
if (uri.toLowerCase().startsWith("http://identifiers.org/") && uri.endsWith("/")) {
httpIdentifiersOrgUriExists = true;
}
if (uri.toLowerCase().startsWith("https://identifiers.org/") && uri.endsWith("/")) {
httpsIdentifiersOrgUriExists = true;
}
}
assertTrue("Http identifiers.org url does not exists for: " + miriamType, httpIdentifiersOrgUriExists);
assertTrue("Https identifiers.org url does not exists for: " + miriamType, httpsIdentifiersOrgUriExists);
}
}
@Test
public void testGetMiriamByIncompleteUri() throws Exception {
for (String uri : miriamType.getUris()) {
......
......@@ -131,12 +131,16 @@ public class ModelContructor {
species.setHypothetical(true);
}
species.setName(dataNode.getName());
StringBuilder notes = new StringBuilder();
species.setNotes(getComments(dataNode));
return species;
}
private String getComments(PathwayElement dataNode) {
StringBuilder notes = new StringBuilder("");
for (String comment : dataNode.getComments()) {
notes.append(comment + "\n\n");
}
species.setNotes(notes.toString());
return species;
return notes.toString();
}