You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(121) |
Aug
(343) |
Sep
(98) |
Oct
(55) |
Nov
(158) |
Dec
(219) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(278) |
Feb
(170) |
Mar
(286) |
Apr
(32) |
May
(83) |
Jun
(140) |
Jul
(212) |
Aug
(242) |
Sep
(52) |
Oct
(29) |
Nov
(132) |
Dec
(259) |
2010 |
Jan
(251) |
Feb
(147) |
Mar
(76) |
Apr
(140) |
May
(43) |
Jun
(66) |
Jul
(273) |
Aug
(205) |
Sep
(260) |
Oct
(100) |
Nov
(58) |
Dec
(264) |
2011 |
Jan
(219) |
Feb
(344) |
Mar
(320) |
Apr
(334) |
May
(125) |
Jun
(131) |
Jul
(195) |
Aug
(155) |
Sep
(55) |
Oct
(261) |
Nov
(286) |
Dec
(216) |
2012 |
Jan
(188) |
Feb
(177) |
Mar
(39) |
Apr
(179) |
May
(148) |
Jun
(43) |
Jul
(229) |
Aug
(104) |
Sep
(76) |
Oct
(82) |
Nov
(93) |
Dec
(180) |
2013 |
Jan
(323) |
Feb
(335) |
Mar
(35) |
Apr
(220) |
May
(238) |
Jun
(122) |
Jul
(316) |
Aug
(73) |
Sep
(135) |
Oct
(515) |
Nov
(320) |
Dec
(185) |
2014 |
Jan
(81) |
Feb
(146) |
Mar
(337) |
Apr
(234) |
May
(112) |
Jun
(239) |
Jul
(323) |
Aug
(123) |
Sep
(83) |
Oct
(285) |
Nov
(321) |
Dec
(96) |
2015 |
Jan
(77) |
Feb
(79) |
Mar
(124) |
Apr
(71) |
May
(35) |
Jun
(45) |
Jul
(77) |
Aug
(44) |
Sep
(22) |
Oct
(84) |
Nov
(120) |
Dec
(37) |
2016 |
Jan
(38) |
Feb
(74) |
Mar
(242) |
Apr
(153) |
May
(59) |
Jun
(44) |
Jul
(67) |
Aug
(74) |
Sep
(150) |
Oct
(35) |
Nov
(69) |
Dec
(43) |
2017 |
Jan
(43) |
Feb
(9) |
Mar
(274) |
Apr
(40) |
May
(81) |
Jun
(81) |
Jul
(87) |
Aug
(46) |
Sep
(98) |
Oct
(50) |
Nov
(220) |
Dec
(66) |
2018 |
Jan
(110) |
Feb
(22) |
Mar
(20) |
Apr
(147) |
May
(148) |
Jun
(30) |
Jul
(83) |
Aug
(63) |
Sep
(40) |
Oct
(53) |
Nov
(51) |
Dec
(104) |
2019 |
Jan
(14) |
Feb
(81) |
Mar
(80) |
Apr
(102) |
May
(16) |
Jun
(5) |
Jul
(34) |
Aug
(24) |
Sep
(9) |
Oct
(12) |
Nov
(42) |
Dec
(76) |
2020 |
Jan
(15) |
Feb
(11) |
Mar
(12) |
Apr
(7) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <luc...@us...> - 2019-10-25 23:52:13
|
Revision: 26145 http://sourceforge.net/p/sbml/code/26145 Author: luciansmith Date: 2019-10-25 23:52:06 +0000 (Fri, 25 Oct 2019) Log Message: ----------- Add spatial validation rule 23457. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-05.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-06.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-07.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-08.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-09.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-10.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-11.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-12.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-pass-00-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-pass-00-05.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-25 00:48:36 UTC (rev 26144) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-25 23:52:06 UTC (rev 26145) @@ -275,6 +275,7 @@ , SpatialDiffusionCoefficientCoordinateReferenceDifference = 1223454 , SpatialDiffusionCoefficientCoordinateReferenceNoYIn1D = 1223455 , SpatialDiffusionCoefficientCoordinateReferenceNoZIn2D = 1223456 +, SpatialNoDiffusionCoefficientOverlap = 1223457 , SpatialAdvectionCoefficientAllowedCoreAttributes = 1223501 , SpatialAdvectionCoefficientAllowedCoreElements = 1223502 , SpatialAdvectionCoefficientAllowedAttributes = 1223503 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-25 00:48:36 UTC (rev 26144) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-25 23:52:06 UTC (rev 26145) @@ -2558,7 +2558,7 @@ "Coordinate references must be different from each other.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "The attribute 'spatial:coordinateReference2' of a <diffusionCoefficient>, if defined, must have a value different from that of the attribute 'spatial:coordinateReference1'.", + "The <diffusionCoefficient> attribute 'spatial:coordinateReference2', if defined, must have a value different from that of the attribute 'spatial:coordinateReference1'.", { "L3V1 Spatial V1 Section" } }, @@ -2573,7 +2573,7 @@ } }, - // 1223455 + // 1223456 { SpatialDiffusionCoefficientCoordinateReferenceNoZIn2D, "Coordinate references must not be 'cartesianZ' in 1- or 2-D geometries.", LIBSBML_CAT_GENERAL_CONSISTENCY, @@ -2583,6 +2583,16 @@ } }, + // 1223457 + { SpatialNoDiffusionCoefficientOverlap, + "No overlapping diffusion coefficients for the same species.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "Any <species> may only have a single <diffusionCoefficient> that applies to any given axis or plane. A <diffusionCoefficient> of type 'anisotropic' applies to the axis it references, and any plane in the <geometry> that contains that axis. A <diffusionCoefficient> of type 'tensor' applies to the plane defined by the two axes it references. A <diffusionCoefficient> of type 'isotropic' applies to all axes and planes in the <geometry>.", + { "L3V1 Spatial V1 Section" + } + }, + { SpatialAdvectionCoefficientAllowedCoreAttributes, "Core attributes allowed on <advectionCoefficient>.", LIBSBML_CAT_GENERAL_CONSISTENCY, Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.cpp (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.cpp 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,220 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialUniqueDiffusionCoefficientsCheck.cpp +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2009-2013 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* Copyright (C) 2006-2008 by the California Institute of Technology, +* Pasadena, CA, USA +* +* Copyright (C) 2002-2005 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. Japan Science and Technology Agency, Japan +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#include "SpatialUniqueDiffusionCoefficientsCheck.h" +#include <sbml/packages/spatial/extension/SpatialParameterPlugin.h> + +#include <set> +#include <map> + +/** @cond doxygenIgnored */ +using namespace std; +/** @endcond */ + +LIBSBML_CPP_NAMESPACE_BEGIN +#ifdef __cplusplus + + +/* +* Creates a new Constraint with the given constraint id. +*/ +SpatialUniqueDiffusionCoefficientsCheck::SpatialUniqueDiffusionCoefficientsCheck(unsigned int id, SpatialValidator & v): + TConstraint<Model>(id, v) +{ +} + +/* +* Destroys this Constraint. +*/ +SpatialUniqueDiffusionCoefficientsCheck::~SpatialUniqueDiffusionCoefficientsCheck () +{ +} + + +/* +* Checks that all ids on the following Model objects are unique: +* event assignments and assignment rules. +*/ +void +SpatialUniqueDiffusionCoefficientsCheck::check_ (const Model& m, const Model&) +{ + if (m.getLevel() < 3) { + return; + } + map<string, string> xaxis, yaxis, zaxis, xyplane, xzplane, yzplane; + for (unsigned long p = 0; p < m.getNumParameters(); p++) { + const Parameter* param = m.getParameter(p); + const SpatialParameterPlugin* spp = static_cast<const SpatialParameterPlugin*>(param->getPlugin("spatial")); + if (spp == NULL) { + continue; + } + if (spp->isSetDiffusionCoefficient()) { + const DiffusionCoefficient* diff = spp->getDiffusionCoefficient(); + if (!diff->isSetVariable()) { + continue; + } + string var = diff->getVariable(); + string difftype = "<diffusionCoefficient>"; + if (diff->isSetId()) { + difftype += " (id '" + diff->getId() + "')"; + } + switch(diff->getType()) { + case SPATIAL_DIFFUSIONKIND_ISOTROPIC: + difftype += " with a 'type' of 'isotropic'"; + if (addVariableToAxisAndCheck(xaxis, var, difftype, "X axis", xyplane, xzplane, diff, m)) break; + if (addVariableToAxisAndCheck(yaxis, var, difftype, "Y axis", xyplane, yzplane, diff, m)) break; + if (addVariableToAxisAndCheck(zaxis, var, difftype, "Z axis", yzplane, xzplane, diff, m)) break; + break; + case SPATIAL_DIFFUSIONKIND_ANISOTROPIC: + difftype += " with a 'type' of 'anisotropic'"; + switch (diff->getCoordinateReference1()) { + case SPATIAL_COORDINATEKIND_CARTESIAN_X: + addVariableToAxisAndCheck(xaxis, var, difftype, "X axis", xyplane, xzplane, diff, m); + break; + case SPATIAL_COORDINATEKIND_CARTESIAN_Y: + addVariableToAxisAndCheck(yaxis, var, difftype, "Y axis", xyplane, yzplane, diff, m); + break; + case SPATIAL_COORDINATEKIND_CARTESIAN_Z: + addVariableToAxisAndCheck(zaxis, var, difftype, "Z axis", yzplane, xzplane, diff, m); + break; + } + break; + case SPATIAL_DIFFUSIONKIND_TENSOR: + difftype += " with a 'type' of 'tensor'"; + switch (diff->getCoordinateReference1()) { + case SPATIAL_COORDINATEKIND_CARTESIAN_X: + switch (diff->getCoordinateReference2()) { + case SPATIAL_COORDINATEKIND_CARTESIAN_Y: + addVariableToPlaneAndCheck(xyplane, var, difftype, "XY plane", xaxis, yaxis, diff, m); + break; + case SPATIAL_COORDINATEKIND_CARTESIAN_Z: + addVariableToPlaneAndCheck(xzplane, var, difftype, "XZ plane", xaxis, zaxis, diff, m); + break; + } + break; + + case SPATIAL_COORDINATEKIND_CARTESIAN_Y: + switch (diff->getCoordinateReference2()) { + case SPATIAL_COORDINATEKIND_CARTESIAN_X: + addVariableToPlaneAndCheck(xyplane, var, difftype, "XY plane", xaxis, yaxis, diff, m); + break; + case SPATIAL_COORDINATEKIND_CARTESIAN_Z: + addVariableToPlaneAndCheck(yzplane, var, difftype, "YZ plane", yaxis, zaxis, diff, m); + break; + } + break; + + case SPATIAL_COORDINATEKIND_CARTESIAN_Z: + switch (diff->getCoordinateReference2()) { + case SPATIAL_COORDINATEKIND_CARTESIAN_X: + addVariableToPlaneAndCheck(xzplane, var, difftype, "XZ plane", xaxis, zaxis, diff, m); + break; + case SPATIAL_COORDINATEKIND_CARTESIAN_Y: + addVariableToPlaneAndCheck(yzplane, var, difftype, "YZ plane", yaxis, zaxis, diff, m); + break; + } + break; + + } + } + } + } +} + +bool +SpatialUniqueDiffusionCoefficientsCheck::addVariableToAxisAndCheck(map<string, string>& axismap, const string& var, const string& difftype, const string& axisOrPlane, map<string, string>& planemap1, map<string, string>& planemap2, const DiffusionCoefficient* diff, const Model& m) +{ + if (axismap.find(var) != axismap.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + axismap[var] + " with the same variable."; + logFailure(m); + return true; + } + if (planemap1.find(var) != planemap1.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + planemap1[var] + " with the same variable."; + logFailure(m); + return true; + } + if (planemap2.find(var) != planemap2.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + planemap2[var] + " with the same variable."; + logFailure(m); + return true; + } + axismap[var] = difftype; + return false; +} + + +bool +SpatialUniqueDiffusionCoefficientsCheck::addVariableToPlaneAndCheck(map<string, string>& planemap, const string& var, const string& difftype, const string& axisOrPlane, map<string, string>& axismap1, map<string, string>& axismap2, const DiffusionCoefficient* diff, const Model& m) +{ + if (planemap.find(var) != planemap.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + planemap[var] + " with the same variable."; + logFailure(m); + return true; + } + if (axismap1.find(var) != axismap1.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + axismap1[var] + " with the same variable."; + logFailure(m); + return true; + } + if (axismap2.find(var) != axismap2.end()) { + msg = "A "; + msg += difftype; + msg += " defines diffusion for the variable '" + diff->getVariable() + "' in the " + axisOrPlane + ", but diffusion here for this variable was already covered by a different " + axismap2[var] + " with the same variable."; + logFailure(m); + return true; + } + planemap[var] = difftype; + return false; +} + + +#endif /* __cplusplus */ + +LIBSBML_CPP_NAMESPACE_END +/** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.h (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.h 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,88 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialUniqueDiffusionCoefficientsCheck.h +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright 2011-2012 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#ifndef SpatialUniqueDiffusionCoefficientsCheck_h +#define SpatialUniqueDiffusionCoefficientsCheck_h + + +#ifdef __cplusplus + +#include <sbml/validator/VConstraint.h> +#include <sbml/packages/spatial/validator/SpatialValidator.h> + +class DiffusionCoefficient; + +LIBSBML_CPP_NAMESPACE_BEGIN + +class SpatialUniqueDiffusionCoefficientsCheck: public TConstraint<Model> +{ +public: + + /** + * Creates a new Constraint with the given constraint id. + */ + SpatialUniqueDiffusionCoefficientsCheck (unsigned int id, SpatialValidator& v); + + /** + * Destroys this Constraint. + */ + virtual ~SpatialUniqueDiffusionCoefficientsCheck (); + + +protected: + + virtual void check_ (const Model& m, const Model& object); + + bool addVariableToAxisAndCheck(std::map<std::string, std::string>& axismap, + const std::string & var, + const std::string & difftype, + const std::string & axisOrPlane, + std::map<std::string, std::string>& planemap1, + std::map<std::string, std::string>& planemap2, + const DiffusionCoefficient * diff, + const Model & m); + + bool addVariableToPlaneAndCheck(std::map<std::string, std::string>& planemap, + const std::string & var, + const std::string & difftype, + const std::string & axisOrPlane, + std::map<std::string, std::string>& axismap1, + std::map<std::string, std::string>& axismap2, + const DiffusionCoefficient * diff, + const Model & m); + +}; + +LIBSBML_CPP_NAMESPACE_END + +#endif /* __cplusplus */ +#endif /* SpatialUniqueDiffusionCoefficientsCheck_h */ +/** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-25 00:48:36 UTC (rev 26144) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-25 23:52:06 UTC (rev 26145) @@ -46,6 +46,7 @@ #include <sbml/packages/spatial/sbml/Geometry.h> #include <sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h> #include <sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h> +#include <sbml/packages/spatial/validator/SpatialUniqueDiffusionCoefficientsCheck.h> #include <sbml/Species.h> #endif /* AddingConstraintsToValidator */ @@ -56,6 +57,7 @@ EXTERN_CONSTRAINT(ErrorEnumValue, SpatialCompartmentMappingUnitSizesCheck); EXTERN_CONSTRAINT(ErrorEnumValue, SpatialSpatialSymbolReferenceUniqueRefCheck); +EXTERN_CONSTRAINT(ErrorEnumValue, SpatialUniqueDiffusionCoefficientsCheck); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-25 00:48:36 UTC (rev 26144) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-25 23:52:06 UTC (rev 26145) @@ -40,6 +40,7 @@ #include "sbml\packages\spatial\validator\SpatialCompartmentMappingUnitSizesCheck.h" #include "sbml\packages\spatial\validator\SpatialSpatialSymbolReferenceUniqueRefCheck.h" +#include "sbml\packages\spatial\validator\SpatialUniqueDiffusionCoefficientsCheck.h" //Constraints declared in SpatialConsistencyConstraints.cpp addConstraint(new VConstraintDomainSpatialDomainDomainTypeMustBeDomainType(*this)); @@ -72,6 +73,7 @@ //Constraints defined in their own class ('global constraints') addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); addConstraint(new SpatialSpatialSymbolReferenceUniqueRefCheck(SpatialSpatialSymbolReferenceUniqueRef, *this)); +addConstraint(new SpatialUniqueDiffusionCoefficientsCheck(SpatialNoDiffusionCoefficientOverlap, *this)); /** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-01.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-02.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianZ" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-03.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-03.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianZ" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-04.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-04.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-05.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-05.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-05.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianY" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-06.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-06.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-06.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianZ" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-07.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-07.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-07.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-08.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-08.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-08.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianY" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-09.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-09.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-09.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianZ" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianZ" spatial:type="anisotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-10.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-10.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223457-fail-01-10.xml 2019-10-25 23:52:06 UTC (rev 26145) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + ... [truncated message content] |
From: <luc...@us...> - 2019-10-25 00:48:38
|
Revision: 26144 http://sourceforge.net/p/sbml/code/26144 Author: luciansmith Date: 2019-10-25 00:48:36 +0000 (Fri, 25 Oct 2019) Log Message: ----------- Implement spatial validation rules 23450, 23451, 23452, 23454, 23455, and 23456. 23453 skipped because it's a units validation warning. Again, old tests updated so they don't fail the new tests. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223452-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223452-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223452-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223452-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223454-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223454-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223455-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223455-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223455-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223456-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223456-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223456-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223456-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223456-pass-00-02.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-25 00:48:36 UTC (rev 26144) @@ -271,6 +271,10 @@ , SpatialDiffusionCoefficientNoCoordinateReferencesForIsotropic = 1223450 , SpatialDiffusionCoefficientTwoCoordinateReferencesForTensor = 1223451 , SpatialDiffusionCoefficientOneCoordinateReferencesForAnisotropic = 1223452 +, SpatialDiffusionCoefficientUnits = 1223453 +, SpatialDiffusionCoefficientCoordinateReferenceDifference = 1223454 +, SpatialDiffusionCoefficientCoordinateReferenceNoYIn1D = 1223455 +, SpatialDiffusionCoefficientCoordinateReferenceNoZIn2D = 1223456 , SpatialAdvectionCoefficientAllowedCoreAttributes = 1223501 , SpatialAdvectionCoefficientAllowedCoreElements = 1223502 , SpatialAdvectionCoefficientAllowedAttributes = 1223503 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-25 00:48:36 UTC (rev 26144) @@ -787,7 +787,7 @@ // 1221352 { SpatialCompartmentMappingUnitConsistency, "The units of a compartmentMapping should be compartment units over domain units.", - LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_CAT_UNITS_CONSISTENCY, LIBSBML_SEV_WARNING, "If a <parameter> has a child <spatialSymbolReference> that points to a <compartmentMapping>, the units of that <parameter> should be equivalent to the units of the parent <compartment> of the <compartmentMapping>, divided by the units of the <domainType> referenced by the <compartmentMapping>.", { "L3V1 Spatial V1 Section" @@ -2538,12 +2538,51 @@ "One coordinate references for 'anisotropic' type.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <diffusionCoefficient> with an attribute 'type' value of 'anisotropic\x94 must define the attribute 'spatial:coordinateReference1', and must not define the attribute 'spatial:coordinateReference2'.", + "A <diffusionCoefficient> with an attribute 'type' value of 'anisotropic' must define the attribute 'spatial:coordinateReference1', and must not define the attribute 'spatial:coordinateReference2'.", { "L3V1 Spatial V1 Section" } }, - // 1223501 + // 1223453 + { SpatialDiffusionCoefficientUnits, + "Diffusion coefficient units should be length^2/time.", + LIBSBML_CAT_UNITS_CONSISTENCY, + LIBSBML_SEV_WARNING, + "The units of a <parameter> with a <diffusionCoefficient> child should be length^2/time.", + { "L3V1 Spatial V1 Section" + } + }, + + // 1223454 + { SpatialDiffusionCoefficientCoordinateReferenceDifference, + "Coordinate references must be different from each other.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "The attribute 'spatial:coordinateReference2' of a <diffusionCoefficient>, if defined, must have a value different from that of the attribute 'spatial:coordinateReference1'.", + { "L3V1 Spatial V1 Section" + } + }, + + // 1223455 + { SpatialDiffusionCoefficientCoordinateReferenceNoYIn1D, + "Coordinate references must not be 'cartesianY' in 1D geometries.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "The <diffusionCoefficient> attributes 'spatial:coordinateReference1' and 'spatial:coordinateReference2' may not have a value of 'cartesianY' if the <geometry> has exactly one <coordinateComponent> child.", + { "L3V1 Spatial V1 Section" + } + }, + + // 1223455 + { SpatialDiffusionCoefficientCoordinateReferenceNoZIn2D, + "Coordinate references must not be 'cartesianZ' in 1- or 2-D geometries.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "The <diffusionCoefficient> attributes 'spatial:coordinateReference1' and 'spatial:coordinateReference2' may not have a value of 'cartesianZ' if the <geometry> has exactly one or two <coordinateComponent> children.", + { "L3V1 Spatial V1 Section" + } + }, + { SpatialAdvectionCoefficientAllowedCoreAttributes, "Core attributes allowed on <advectionCoefficient>.", LIBSBML_CAT_GENERAL_CONSISTENCY, Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-25 00:48:36 UTC (rev 26144) @@ -662,15 +662,9 @@ pre(species.isSetCompartment()); const SpatialSpeciesPlugin* ssp = static_cast<const SpatialSpeciesPlugin*>(species.getPlugin("spatial")); - pre(ssp != NULL); - pre(ssp->isSetIsSpatial()); - pre(ssp->getIsSpatial()); - pre(species.getParentSBMLObject() != NULL); + pre(ssp->isSetIsSpatial() && ssp->getIsSpatial()); - const Model* model = static_cast<const Model*>(species.getParentSBMLObject()->getParentSBMLObject()); - pre(model != NULL); - - const Compartment* compartment = model->getCompartment(species.getCompartment()); + const Compartment* compartment = m.getCompartment(species.getCompartment()); pre(compartment != NULL); const SpatialCompartmentPlugin* scp = static_cast<const SpatialCompartmentPlugin*>(compartment->getPlugin("spatial")); @@ -701,15 +695,7 @@ msg += " has a 'spatialRef' value of '" + ssr.getSpatialRef() + "'"; bool fail = false; - const SBase* parent = ssr.getParentSBMLObject(); //The Parameter - pre(parent != NULL); - parent = parent->getParentSBMLObject(); //The ListOfParameters - pre(parent != NULL); - parent = parent->getParentSBMLObject(); //The Model - pre(parent != NULL); - SBase* ncparent = const_cast<SBase*>(parent); //Need non-const version for 'getElementBySId'. - Model* model = static_cast<Model*>(ncparent); - pre(model != NULL); + Model* model = const_cast<Model*>(&m); const SBase* ref = model->getElementBySId(ssr.getSpatialRef()); if (ref == NULL) { fail = true; @@ -733,7 +719,217 @@ } END_CONSTRAINT +// 1223450 +START_CONSTRAINT(SpatialDiffusionCoefficientNoCoordinateReferencesForIsotropic, DiffusionCoefficient, dc) +{ + bool fail = false; + pre(dc.getType() == SPATIAL_DIFFUSIONKIND_ISOTROPIC); + if (dc.isSetCoordinateReference1() && dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'isotropic', but defines both 'coordinateReference1' and 'coordinateReference2'."; + } + else if (dc.isSetCoordinateReference1()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'isotropic', but defines 'coordinateReference1'."; + } + else if (dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'isotropic', but defines 'coordinateReference2'."; + } + inv(fail == false); +} +END_CONSTRAINT +// 1223451 +START_CONSTRAINT(SpatialDiffusionCoefficientTwoCoordinateReferencesForTensor, DiffusionCoefficient, dc) +{ + bool fail = false; + pre(dc.getType() == SPATIAL_DIFFUSIONKIND_TENSOR); + if (!dc.isSetCoordinateReference1() && !dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'tensor', but doesn't define 'coordinateReference1' or 'coordinateReference2'."; + } + else if (!dc.isSetCoordinateReference1()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'tensor', but doesn't define 'coordinateReference1'."; + } + else if (!dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'tensor', but doesn't define 'coordinateReference2'."; + } + + inv(fail == false); +} +END_CONSTRAINT + +// 1223452 +START_CONSTRAINT(SpatialDiffusionCoefficientOneCoordinateReferencesForAnisotropic, DiffusionCoefficient, dc) +{ + bool fail = false; + pre(dc.getType() == SPATIAL_DIFFUSIONKIND_ANISOTROPIC); + if (!dc.isSetCoordinateReference1() && dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'anisotropic', but defines 'coordinateReference2' instead of 'coordinateReference2'."; + } + else if (!dc.isSetCoordinateReference1()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'anisotropic', but doesn't define 'coordinateReference1'."; + } + else if (dc.isSetCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a 'type' of 'anisotropic', but defines 'coordinateReference2'."; + } + + inv(fail == false); +} +END_CONSTRAINT + +// 1223454 +START_CONSTRAINT(SpatialDiffusionCoefficientCoordinateReferenceDifference, DiffusionCoefficient, dc) +{ + bool fail = false; + pre(dc.isSetCoordinateReference1()); + pre(dc.isSetCoordinateReference2()); + if (dc.getCoordinateReference1() == dc.getCoordinateReference2()) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a value of '" + dc.getCoordinateReference1AsString() + "' for both 'coordinateReference1' and 'coordinateReference2'."; + } + + inv(fail == false); +} +END_CONSTRAINT + +// 1223455 +START_CONSTRAINT(SpatialDiffusionCoefficientCoordinateReferenceNoYIn1D, DiffusionCoefficient, dc) +{ + bool fail = false; + + SpatialModelPlugin *mplug = (SpatialModelPlugin*)(m.getPlugin("spatial")); + pre(mplug != NULL); + Geometry* geom = mplug->getGeometry(); + pre(geom != NULL); + pre(geom->getNumCoordinateComponents()==1); + + if (dc.isSetCoordinateReference1() && dc.getCoordinateReference1() == SPATIAL_COORDINATEKIND_CARTESIAN_Y) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a value of 'cartesianY' for 'coordinateReference1', but the <geometry> only has one <coordinateComponent> child."; + } + + else if (dc.isSetCoordinateReference2() && dc.getCoordinateReference2() == SPATIAL_COORDINATEKIND_CARTESIAN_Y) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a value of 'cartesianY' for 'coordinateReference2', but the <geometry> only has one <coordinateComponent> child."; + } + + + inv(fail == false); +} +END_CONSTRAINT + +// 1223455 +START_CONSTRAINT(SpatialDiffusionCoefficientCoordinateReferenceNoZIn2D, DiffusionCoefficient, dc) +{ + bool fail = false; + + SpatialModelPlugin *mplug = (SpatialModelPlugin*)(m.getPlugin("spatial")); + pre(mplug != NULL); + Geometry* geom = mplug->getGeometry(); + pre(geom != NULL); + pre(geom->getNumCoordinateComponents()<3); + stringstream ncc; + ncc << geom->getNumCoordinateComponents(); + + if (dc.isSetCoordinateReference1() && dc.getCoordinateReference1() == SPATIAL_COORDINATEKIND_CARTESIAN_Z) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a value of 'cartesianZ' for 'coordinateReference1', but the <geometry> only has " + ncc.str() + " <coordinateComponent> child"; + if (geom->getNumCoordinateComponents() == 2) { + msg += "ren"; + } + msg += "."; + } + + else if (dc.isSetCoordinateReference2() && dc.getCoordinateReference2() == SPATIAL_COORDINATEKIND_CARTESIAN_Z) { + fail = true; + msg = "A <diffusionCoefficient>"; + if (dc.isSetId()) { + msg += " with the id '" + dc.getId() + "'"; + } + msg += " has a value of 'cartesianZ' for 'coordinateReference2', but the <geometry> only has " + ncc.str() + " <coordinateComponent> child"; + if (geom->getNumCoordinateComponents() == 2) { + msg += "ren"; + } + msg += "."; + } + + + inv(fail == false); +} +END_CONSTRAINT + + +// 122__ +//START_CONSTRAINT(Spatial, Class, class) +//{ +// bool fail = false; +// +// inv(fail == false); +//} +//END_CONSTRAINT + + + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-25 00:48:36 UTC (rev 26144) @@ -41,6 +41,7 @@ #include "sbml\packages\spatial\validator\SpatialCompartmentMappingUnitSizesCheck.h" #include "sbml\packages\spatial\validator\SpatialSpatialSymbolReferenceUniqueRefCheck.h" +//Constraints declared in SpatialConsistencyConstraints.cpp addConstraint(new VConstraintDomainSpatialDomainDomainTypeMustBeDomainType(*this)); addConstraint(new VConstraintAdjacentDomainsSpatialAdjacentDomainsDomain1MustBeDomain(*this)); addConstraint(new VConstraintAdjacentDomainsSpatialAdjacentDomainsDomain2MustBeDomain(*this)); @@ -61,8 +62,14 @@ addConstraint(new VConstraintCompartmentMappingSpatialCompartmentMappingUnitSizeMustBeFraction(*this)); addConstraint(new VConstraintSpeciesSpatialCompartmentsMustHaveCompartmentMapping(*this)); addConstraint(new VConstraintSpatialSymbolReferenceSpatialSpatialSymbolReferenceSpatialRefMustReferenceMath(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientNoCoordinateReferencesForIsotropic(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientTwoCoordinateReferencesForTensor(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientOneCoordinateReferencesForAnisotropic(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientCoordinateReferenceDifference(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientCoordinateReferenceNoYIn1D(*this)); +addConstraint(new VConstraintDiffusionCoefficientSpatialDiffusionCoefficientCoordinateReferenceNoZIn2D(*this)); - +//Constraints defined in their own class ('global constraints') addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); addConstraint(new SpatialSpatialSymbolReferenceUniqueRefCheck(SpatialSpatialSymbolReferenceUniqueRef, *this)); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -68,8 +68,8 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -69,7 +69,7 @@ <listOfParameters> <parameter constant="false" id="id_3"> <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -69,7 +69,7 @@ <listOfParameters> <parameter constant="false" id="id_3"> <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -69,7 +69,7 @@ <listOfParameters> <parameter constant="false" id="id_3"> <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-24 20:39:24 UTC (rev 26143) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -68,7 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-01.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianY" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-02.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:coordinateReference1="cartesianX" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-03.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-fail-01-03.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:coordinateReference2="cartesianY" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223450-pass-00-01.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-01.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference2="cartesianY" spatial:type="tensor" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223451-fail-01-02.xml 2019-10-25 00:48:36 UTC (rev 26144) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + ... [truncated message content] |
From: <luc...@us...> - 2019-10-24 20:39:28
|
Revision: 26143 http://sourceforge.net/p/sbml/code/26143 Author: luciansmith Date: 2019-10-24 20:39:24 +0000 (Thu, 24 Oct 2019) Log Message: ----------- Add modified spatial validation rule 23304. Also fix a lot of old files so they don't fail the new rule. Also also, actually call validation for spatial parameters. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SpatialSymbolReference.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220802-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220802-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220802-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220803-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220803-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220803-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220803-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220804-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220804-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220805-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220805-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220806-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220806-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220806-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220807-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220807-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220808-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220808-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220808-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220808-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220901-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220901-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220901-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220901-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220902-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220902-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220902-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220903-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220903-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220903-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220903-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220903-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220904-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220904-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220905-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220905-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220906-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220906-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221101-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221101-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221101-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221101-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221102-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221102-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221102-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221103-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221103-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221103-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221103-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221103-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221104-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221104-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221105-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221105-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-02-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-pass-00-01.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-05.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223304-pass-00-06.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SpatialSymbolReference.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SpatialSymbolReference.cpp 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/sbml/SpatialSymbolReference.cpp 2019-10-24 20:39:24 UTC (rev 26143) @@ -638,7 +638,7 @@ msg += " is '" + mSpatialRef + "', which does not conform to the " "syntax."; log->logPackageError("spatial", - SpatialSpatialSymbolReferenceSpatialRefMustBeGeometry, pkgVersion, level, + SpatialSpatialSymbolReferenceSpatialRefMustReferenceMath, pkgVersion, level, version, msg, getLine(), getColumn()); } } Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-24 20:39:24 UTC (rev 26143) @@ -259,7 +259,7 @@ , SpatialSpatialSymbolReferenceAllowedCoreAttributes = 1223301 , SpatialSpatialSymbolReferenceAllowedCoreElements = 1223302 , SpatialSpatialSymbolReferenceAllowedAttributes = 1223303 -, SpatialSpatialSymbolReferenceSpatialRefMustBeGeometry = 1223304 +, SpatialSpatialSymbolReferenceSpatialRefMustReferenceMath = 1223304 , SpatialSpatialSymbolReferenceUniqueRef = 1223350 , SpatialDiffusionCoefficientAllowedCoreAttributes = 1223401 , SpatialDiffusionCoefficientAllowedCoreElements = 1223402 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-24 20:39:24 UTC (rev 26143) @@ -2399,13 +2399,13 @@ }, // 1223304 - { SpatialSpatialSymbolReferenceSpatialRefMustBeGeometry, - "The attribute 'spatialRef' must point to Geometry object.", + { SpatialSpatialSymbolReferenceSpatialRefMustReferenceMath, + "The attribute 'spatialRef' must point to a spatial object with mathematical meaning.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, "The value of the attribute 'spatial:spatialRef' of a " "<spatialSymbolReference> object must be the identifier of an existing " - "<geometry> object defined in the enclosing <model> object.", + "<compartmentMapping>, <coordinateComponent>, <boundary>, <domainType>, <domain>, or <sampledField> object defined in the enclosing <model> object.", { "L3V1 Spatial V1 Section" } }, Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-10-24 20:39:24 UTC (rev 26143) @@ -1018,6 +1018,16 @@ m->getReaction(i)->accept(vv); } } + + for (i = 0; i < m->getNumParameters(); i++) + { + const SpatialParameterPlugin* spPlug = static_cast<const + SpatialParameterPlugin*>(m->getParameter(i)->getPlugin("spatial")); + if (spPlug != NULL) + { + spPlug->accept(vv); + } + } } return (unsigned int)(mFailures.size()); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-24 20:39:24 UTC (rev 26143) @@ -659,24 +659,20 @@ START_CONSTRAINT(SpatialCompartmentsMustHaveCompartmentMapping, Species, species) { bool fail = false; - if (!species.isSetCompartment()) { - return; - } + pre(species.isSetCompartment()); + const SpatialSpeciesPlugin* ssp = static_cast<const SpatialSpeciesPlugin*>(species.getPlugin("spatial")); - if (ssp == NULL || !ssp->isSetIsSpatial() || !ssp->getIsSpatial()) { - return; - } - if (species.getParentSBMLObject() == NULL) { - return; - } + pre(ssp != NULL); + pre(ssp->isSetIsSpatial()); + pre(ssp->getIsSpatial()); + pre(species.getParentSBMLObject() != NULL); + const Model* model = static_cast<const Model*>(species.getParentSBMLObject()->getParentSBMLObject()); - if (model == NULL) { - return; - } + pre(model != NULL); + const Compartment* compartment = model->getCompartment(species.getCompartment()); - if (compartment == NULL) { - return; - } + pre(compartment != NULL); + const SpatialCompartmentPlugin* scp = static_cast<const SpatialCompartmentPlugin*>(compartment->getPlugin("spatial")); if (scp == NULL || scp->isSetCompartmentMapping() == false) { fail = true; @@ -694,6 +690,50 @@ } END_CONSTRAINT +// 1223304 +START_CONSTRAINT(SpatialSpatialSymbolReferenceSpatialRefMustReferenceMath, SpatialSymbolReference, ssr) +{ + pre(ssr.isSetSpatialRef()); + msg = "A <spatialSymbolReference>"; + if (ssr.isSetId()) { + msg += " with the id '" + ssr.getId() + "'"; + } + msg += " has a 'spatialRef' value of '" + ssr.getSpatialRef() + "'"; + bool fail = false; + const SBase* parent = ssr.getParentSBMLObject(); //The Parameter + pre(parent != NULL); + parent = parent->getParentSBMLObject(); //The ListOfParameters + pre(parent != NULL); + parent = parent->getParentSBMLObject(); //The Model + pre(parent != NULL); + SBase* ncparent = const_cast<SBase*>(parent); //Need non-const version for 'getElementBySId'. + Model* model = static_cast<Model*>(ncparent); + pre(model != NULL); + const SBase* ref = model->getElementBySId(ssr.getSpatialRef()); + if (ref == NULL) { + fail = true; + msg += ", but no object with that ID could be found."; + } + else { + switch (ref->getTypeCode()) { + case SBML_SPATIAL_COMPARTMENTMAPPING: + case SBML_SPATIAL_COORDINATECOMPONENT: + case SBML_SPATIAL_BOUNDARY: + case SBML_SPATIAL_DOMAINTYPE: + case SBML_SPATIAL_DOMAIN: + case SBML_SPATIAL_SAMPLEDFIELD: + return; + } + fail = true; + msg += ", which is not a spatial element with mathematical meaning."; + } + + inv(fail == false); +} +END_CONSTRAINT + + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-24 20:39:24 UTC (rev 26143) @@ -60,7 +60,9 @@ addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeSampledValueMinMax(*this)); addConstraint(new VConstraintCompartmentMappingSpatialCompartmentMappingUnitSizeMustBeFraction(*this)); addConstraint(new VConstraintSpeciesSpatialCompartmentsMustHaveCompartmentMapping(*this)); +addConstraint(new VConstraintSpatialSymbolReferenceSpatialSpatialSymbolReferenceSpatialRefMustReferenceMath(*this)); + addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); addConstraint(new SpatialSpatialSymbolReferenceUniqueRefCheck(SpatialSpatialSymbolReferenceUniqueRef, *this)); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> @@ -68,8 +68,8 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> @@ -68,7 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> @@ -68,7 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> @@ -68,7 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> @@ -68,7 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_2"/> </parameter> </listOfParameters> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-fail-01-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-fail-01-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-01.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-01.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_3" spatial:type="cartesianZ" spatial:unit="dimensionless"> <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> </spatial:coordinateComponent> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-02.xml 2019-10-24 18:57:07 UTC (rev 26142) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220801-pass-00-02.xml 2019-10-24 20:39:24 UTC (rev 26143) @@ -7,11 +7,11 @@ <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> </spatial:coordinateComponent> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:coordinateComponent spatial:id="coordinateComponent_2" spatial:type="cartesianY" spatial:unit="dimensi... [truncated message content] |
From: <luc...@us...> - 2019-10-24 18:57:09
|
Revision: 26142 http://sourceforge.net/p/sbml/code/26142 Author: luciansmith Date: 2019-10-24 18:57:07 +0000 (Thu, 24 Oct 2019) Log Message: ----------- Add spatial validation rule 23350. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-02-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-24 17:25:24 UTC (rev 26141) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-24 18:57:07 UTC (rev 26142) @@ -260,6 +260,7 @@ , SpatialSpatialSymbolReferenceAllowedCoreElements = 1223302 , SpatialSpatialSymbolReferenceAllowedAttributes = 1223303 , SpatialSpatialSymbolReferenceSpatialRefMustBeGeometry = 1223304 +, SpatialSpatialSymbolReferenceUniqueRef = 1223350 , SpatialDiffusionCoefficientAllowedCoreAttributes = 1223401 , SpatialDiffusionCoefficientAllowedCoreElements = 1223402 , SpatialDiffusionCoefficientAllowedAttributes = 1223403 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-24 17:25:24 UTC (rev 26141) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-24 18:57:07 UTC (rev 26142) @@ -2410,6 +2410,16 @@ } }, + // 1223350 + { SpatialSpatialSymbolReferenceUniqueRef, + "Every <spatialSymbolReference> must point to unique object.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "Every <spatialSymbolReference> in a <model> must reference a unique spatial element.", + { "L3V1 Spatial V1 Section" + } + }, + // 1223401 { SpatialDiffusionCoefficientAllowedCoreAttributes, "Core attributes allowed on <diffusionCoefficient>.", Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.cpp (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.cpp 2019-10-24 18:57:07 UTC (rev 26142) @@ -0,0 +1,107 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialSpatialSymbolReferenceUniqueRefCheck.cpp +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2009-2013 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* Copyright (C) 2006-2008 by the California Institute of Technology, +* Pasadena, CA, USA +* +* Copyright (C) 2002-2005 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. Japan Science and Technology Agency, Japan +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#include "SpatialSpatialSymbolReferenceUniqueRefCheck.h" +#include <sbml/packages/spatial/extension/SpatialParameterPlugin.h> + +#include <set> + +/** @cond doxygenIgnored */ +using namespace std; +/** @endcond */ + +LIBSBML_CPP_NAMESPACE_BEGIN +#ifdef __cplusplus + + +/* +* Creates a new Constraint with the given constraint id. +*/ +SpatialSpatialSymbolReferenceUniqueRefCheck::SpatialSpatialSymbolReferenceUniqueRefCheck(unsigned int id, SpatialValidator & v): + TConstraint<Model>(id, v) +{ +} + +/* +* Destroys this Constraint. +*/ +SpatialSpatialSymbolReferenceUniqueRefCheck::~SpatialSpatialSymbolReferenceUniqueRefCheck () +{ +} + + +/* +* Checks that all ids on the following Model objects are unique: +* event assignments and assignment rules. +*/ +void +SpatialSpatialSymbolReferenceUniqueRefCheck::check_ (const Model& m, const Model&) +{ + if (m.getLevel() < 3) { + return; + } + set<string> referencedIDs; + set<string> duplicates; + for (unsigned long p = 0; p < m.getNumParameters(); p++) { + const Parameter* param = m.getParameter(p); + const SpatialParameterPlugin* spp = static_cast<const SpatialParameterPlugin*>(param->getPlugin("spatial")); + if (spp == NULL) { + continue; + } + if (spp->isSetSpatialSymbolReference()) { + const SpatialSymbolReference* ssr = spp->getSpatialSymbolReference(); + if (ssr->isSetSpatialRef()) { + string ref = ssr->getSpatialRef(); + if (referencedIDs.find(ref) != referencedIDs.end()) { + duplicates.insert(ref); + } + referencedIDs.insert(ref); + } + } + } + for (set<string>::iterator dup = duplicates.begin(); dup != duplicates.end(); dup++) { + msg = "Multiple <spatialSymbolReference> objects were found with the same spatialRef value, '"; + msg += *dup + "'."; + logFailure(m); + } +} + +#endif /* __cplusplus */ + +LIBSBML_CPP_NAMESPACE_END +/** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h 2019-10-24 18:57:07 UTC (rev 26142) @@ -0,0 +1,69 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialSpatialSymbolReferenceUniqueRefCheck.h +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright 2011-2012 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#ifndef SpatialSpatialSymbolReferenceUniqueRefSum_h +#define SpatialSpatialSymbolReferenceUniqueRefSum_h + + +#ifdef __cplusplus + +#include <sbml/validator/VConstraint.h> +#include <sbml/packages/spatial/validator/SpatialValidator.h> + + +LIBSBML_CPP_NAMESPACE_BEGIN + +class SpatialSpatialSymbolReferenceUniqueRefCheck: public TConstraint<Model> +{ +public: + + /** + * Creates a new Constraint with the given constraint id. + */ + SpatialSpatialSymbolReferenceUniqueRefCheck (unsigned int id, SpatialValidator& v); + + /** + * Destroys this Constraint. + */ + virtual ~SpatialSpatialSymbolReferenceUniqueRefCheck (); + + +protected: + + virtual void check_ (const Model& m, const Model& object); + +}; + +LIBSBML_CPP_NAMESPACE_END + +#endif /* __cplusplus */ +#endif /* SpatialSpatialSymbolReferenceUniqueRefSum_h */ +/** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-24 17:25:24 UTC (rev 26141) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-24 18:57:07 UTC (rev 26142) @@ -45,6 +45,7 @@ #include <sbml/packages/spatial/common/SpatialExtensionTypes.h> #include <sbml/packages/spatial/sbml/Geometry.h> #include <sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h> +#include <sbml/packages/spatial/validator/SpatialSpatialSymbolReferenceUniqueRefCheck.h> #include <sbml/Species.h> #endif /* AddingConstraintsToValidator */ @@ -54,6 +55,7 @@ using namespace std; EXTERN_CONSTRAINT(ErrorEnumValue, SpatialCompartmentMappingUnitSizesCheck); +EXTERN_CONSTRAINT(ErrorEnumValue, SpatialSpatialSymbolReferenceUniqueRefCheck); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-24 17:25:24 UTC (rev 26141) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-24 18:57:07 UTC (rev 26142) @@ -39,6 +39,7 @@ */ #include "sbml\packages\spatial\validator\SpatialCompartmentMappingUnitSizesCheck.h" +#include "sbml\packages\spatial\validator\SpatialSpatialSymbolReferenceUniqueRefCheck.h" addConstraint(new VConstraintDomainSpatialDomainDomainTypeMustBeDomainType(*this)); addConstraint(new VConstraintAdjacentDomainsSpatialAdjacentDomainsDomain1MustBeDomain(*this)); @@ -61,6 +62,7 @@ addConstraint(new VConstraintSpeciesSpatialCompartmentsMustHaveCompartmentMapping(*this)); addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); +addConstraint(new SpatialSpatialSymbolReferenceUniqueRefCheck(SpatialSpatialSymbolReferenceUniqueRef, *this)); /** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-01-01.xml 2019-10-24 18:57:07 UTC (rev 26142) @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-02-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-02-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-fail-02-02.xml 2019-10-24 18:57:07 UTC (rev 26142) @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_1"/> + </parameter> + <parameter constant="false" id="id_5"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + </parameter> + <parameter constant="false" id="id_6"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1223350-pass-00-01.xml 2019-10-24 18:57:07 UTC (rev 26142) @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + </parameter> + <parameter constant="false" id="id_4"> + <spatial:spatialSymbolReference spatial:spatialRef="coordinateComponent_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + |
From: <luc...@us...> - 2019-10-24 17:25:26
|
Revision: 26141 http://sourceforge.net/p/sbml/code/26141 Author: luciansmith Date: 2019-10-24 17:25:24 +0000 (Thu, 24 Oct 2019) Log Message: ----------- More spatial 20501 example failures. Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-05.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-06.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-07.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-08.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> + <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-09.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-10.xml 2019-10-24 17:25:24 UTC (rev 26141) @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + |
From: <luc...@us...> - 2019-10-24 00:40:08
|
Revision: 26140 http://sourceforge.net/p/sbml/code/26140 Author: luciansmith Date: 2019-10-24 00:40:06 +0000 (Thu, 24 Oct 2019) Log Message: ----------- Change the "comp elements with both 'comp:id' and 'id'" to only be a warning when the two IDs are the same. This turned out to be a lot more involved than it seemed, and included having to introduce a new libsbml severity 'unknown' to use in the default error constructor. Modified Paths: -------------- trunk/libsbml/src/sbml/SBMLError.cpp trunk/libsbml/src/sbml/SBMLError.h trunk/libsbml/src/sbml/SBMLErrorLog.h trunk/libsbml/src/sbml/packages/comp/sbml/CompBase.cpp trunk/libsbml/src/sbml/packages/comp/sbml/test/TestAttributeNamespaces.cpp trunk/libsbml/src/sbml/validator/VConstraint.cpp trunk/libsbml/src/sbml/xml/XMLError.cpp Modified: trunk/libsbml/src/sbml/SBMLError.cpp =================================================================== --- trunk/libsbml/src/sbml/SBMLError.cpp 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/SBMLError.cpp 2019-10-24 00:40:06 UTC (rev 26140) @@ -386,7 +386,12 @@ unsigned int index = sbext->getErrorTableIndex(mErrorId); if (index > 0) { - mSeverity = sbext->getSeverity(index, pkgVersion); + if (severity == LIBSBML_SEV_UNKNOWN) { + mSeverity = sbext->getSeverity(index, pkgVersion); + } + else { + mSeverity = severity; + } mCategory = sbext->getCategory(index); mMessage = sbext->getMessage(index, pkgVersion, details); mShortMessage = sbext->getShortMessage(index); @@ -406,7 +411,12 @@ // filled in all the relevant additional data. (If they didn't, the // following merely assigns the defaults.) mMessage = details; - mSeverity = severity; + if (severity == LIBSBML_SEV_UNKNOWN) { + mSeverity = LIBSBML_SEV_ERROR; + } + else { + mSeverity = severity; + } mCategory = category; mSeverityString = stringForSeverity(mSeverity); mCategoryString = stringForCategory(mCategory); Modified: trunk/libsbml/src/sbml/SBMLError.h =================================================================== --- trunk/libsbml/src/sbml/SBMLError.h 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/SBMLError.h 2019-10-24 00:40:06 UTC (rev 26140) @@ -1075,6 +1075,9 @@ * for errors that have relevance to some * versions of SBML but not others. */ + , LIBSBML_SEV_UNKNOWN + /*!< This error code is used as the default argument to the SBMLError constructor, so the constructor can know if the caller deliberately set the severity or not. */ + /** @endcond **/ } SBMLErrorSeverity_t; @@ -1205,7 +1208,7 @@ , const std::string details = "" , const unsigned int line = 0 , const unsigned int column = 0 - , const unsigned int severity = LIBSBML_SEV_ERROR + , const unsigned int severity = LIBSBML_SEV_UNKNOWN , const unsigned int category = LIBSBML_CAT_SBML , const std::string package = "core" , const unsigned int pkgVersion = 1 Modified: trunk/libsbml/src/sbml/SBMLErrorLog.h =================================================================== --- trunk/libsbml/src/sbml/SBMLErrorLog.h 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/SBMLErrorLog.h 2019-10-24 00:40:06 UTC (rev 26140) @@ -265,7 +265,7 @@ , const std::string details = "" , const unsigned int line = 0 , const unsigned int column = 0 - , const unsigned int severity = LIBSBML_SEV_ERROR + , const unsigned int severity = LIBSBML_SEV_UNKNOWN , const unsigned int category = LIBSBML_CAT_SBML ); @@ -280,7 +280,7 @@ , const std::string details = "" , const unsigned int line = 0 , const unsigned int column = 0 - , const unsigned int severity = LIBSBML_SEV_ERROR + , const unsigned int severity = LIBSBML_SEV_UNKNOWN , const unsigned int category = LIBSBML_CAT_SBML ); Modified: trunk/libsbml/src/sbml/packages/comp/sbml/CompBase.cpp =================================================================== --- trunk/libsbml/src/sbml/packages/comp/sbml/CompBase.cpp 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/packages/comp/sbml/CompBase.cpp 2019-10-24 00:40:06 UTC (rev 26140) @@ -216,12 +216,17 @@ else if (!coreid.empty()) { //Both core and comp id's + unsigned int severity = LIBSBML_SEV_ERROR; + if (coreid == compid) { + severity = LIBSBML_SEV_WARNING; + } string details = "The <comp:"; details += getElementName() + "> element with the 'id' with value '" + coreid + "' and the 'comp:id' with value '" + compid + "' must only use the 'comp:id' attribute."; log->logPackageError("comp", errcode, - pkgVersion, sbmlLevel, sbmlVersion, details, getLine(), getColumn()); + pkgVersion, sbmlLevel, sbmlVersion, details, getLine(), getColumn(), severity); + //log->getError(log->getNumErrors() - 1)->setSeverity(severity); } if (assigned && !SyntaxChecker::isValidSBMLSId(mId)) { @@ -241,12 +246,16 @@ else if (!corename.empty()) { //Both core and comp name's + unsigned int severity = LIBSBML_SEV_ERROR; + if (corename == compname) { + severity = LIBSBML_SEV_WARNING; + } string details = "The <comp:"; details += getElementName() + "> element with the 'name' with value '" + corename + "' and the 'comp:name' with value '" + compname + "' must only use the 'comp:name' attribute."; log->logPackageError("comp", errcode, - pkgVersion, sbmlLevel, sbmlVersion, details, getLine(), getColumn()); + pkgVersion, sbmlLevel, sbmlVersion, details, getLine(), getColumn(), severity); } if (assigned && mName.empty()) { logInvalidId("comp:name", mName); Modified: trunk/libsbml/src/sbml/packages/comp/sbml/test/TestAttributeNamespaces.cpp =================================================================== --- trunk/libsbml/src/sbml/packages/comp/sbml/test/TestAttributeNamespaces.cpp 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/packages/comp/sbml/test/TestAttributeNamespaces.cpp 2019-10-24 00:40:06 UTC (rev 26140) @@ -99,7 +99,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_submod_id_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_submod_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -121,6 +121,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompSubmodelAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); fail_unless( !strcmp(error->getMessage().c_str(), "A <submodel> object must have the attributes 'comp:id' and 'comp:modelRef' because they are required, and may also have the optional attributes 'comp:name', 'comp:timeConversionFactor, and/or 'comp:extentConversionFactor'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <submodel> object.\nReference: L3V1 Comp V1 Section 3.5\n The <comp:submodel> element with the 'id' with value 'A' and the 'comp:id' with value 'A2' must only use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -127,6 +128,35 @@ END_TEST +START_TEST (test_comp_AttributeNamespaces_submod_id_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel id=\"A\" comp:id=\"A\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompSubmodelAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); + fail_unless( !strcmp(error->getMessage().c_str(), "A <submodel> object must have the attributes 'comp:id' and 'comp:modelRef' because they are required, and may also have the optional attributes 'comp:name', 'comp:timeConversionFactor, and/or 'comp:extentConversionFactor'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <submodel> object.\nReference: L3V1 Comp V1 Section 3.5\n The <comp:submodel> element with the 'id' with value 'A' and the 'comp:id' with value 'A' must only use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + START_TEST (test_comp_AttributeNamespaces_submod_name_coreNotComp) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" @@ -155,7 +185,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_submod_name_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_submod_name_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -177,6 +207,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompSubmodelAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); fail_unless( !strcmp(error->getMessage().c_str(), "A <submodel> object must have the attributes 'comp:id' and 'comp:modelRef' because they are required, and may also have the optional attributes 'comp:name', 'comp:timeConversionFactor, and/or 'comp:extentConversionFactor'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <submodel> object.\nReference: L3V1 Comp V1 Section 3.5\n The <comp:submodel> element with the 'name' with value 'Aname' and the 'comp:name' with value 'A2name' must only use the 'comp:name' attribute.\n"), NULL); delete doc; } @@ -183,6 +214,35 @@ END_TEST +START_TEST (test_comp_AttributeNamespaces_submod_name_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"A\" name=\"Aname\" comp:name=\"Aname\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompSubmodelAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); + fail_unless( !strcmp(error->getMessage().c_str(), "A <submodel> object must have the attributes 'comp:id' and 'comp:modelRef' because they are required, and may also have the optional attributes 'comp:name', 'comp:timeConversionFactor, and/or 'comp:extentConversionFactor'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <submodel> object.\nReference: L3V1 Comp V1 Section 3.5\n The <comp:submodel> element with the 'name' with value 'Aname' and the 'comp:name' with value 'Aname' must only use the 'comp:name' attribute.\n"), NULL); + delete doc; +} +END_TEST + + START_TEST (test_comp_AttributeNamespaces_port_id_coreNotComp) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" @@ -214,7 +274,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_port_id_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_port_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -229,6 +289,38 @@ " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" " </listOfParameters>" " <comp:listOfPorts>" + " <comp:port comp:idRef=\"a\" id=\"a\" comp:id=\"a2\"/>" + " </comp:listOfPorts>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompPortAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <port> object must have a value for the required attribute 'comp:id', and one, and only one, of the attributes 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <port> object.\nReference: L3V1 Comp V1 Section 3.4.3\n The <comp:port> element with the 'id' with value 'a' and the 'comp:id' with value 'a2' must only use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_port_id_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"A\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " <comp:listOfPorts>" " <comp:port comp:idRef=\"a\" id=\"a\" comp:id=\"a\"/>" " </comp:listOfPorts>" " </comp:modelDefinition>" @@ -239,6 +331,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompPortAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "A <port> object must have a value for the required attribute 'comp:id', and one, and only one, of the attributes 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <port> object.\nReference: L3V1 Comp V1 Section 3.4.3\n The <comp:port> element with the 'id' with value 'a' and the 'comp:id' with value 'a' must only use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -276,7 +369,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_port_name_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_port_name_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -291,6 +384,38 @@ " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" " </listOfParameters>" " <comp:listOfPorts>" + " <comp:port comp:idRef=\"a\" comp:id=\"a\" name=\"a2\" comp:name=\"a\"/>" + " </comp:listOfPorts>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompPortAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <port> object must have a value for the required attribute 'comp:id', and one, and only one, of the attributes 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <port> object.\nReference: L3V1 Comp V1 Section 3.4.3\n The <comp:port> element with the 'name' with value 'a2' and the 'comp:name' with value 'a' must only use the 'comp:name' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_port_name_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"A\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " <comp:listOfPorts>" " <comp:port comp:idRef=\"a\" comp:id=\"a\" name=\"a\" comp:name=\"a\"/>" " </comp:listOfPorts>" " </comp:modelDefinition>" @@ -301,6 +426,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompPortAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "A <port> object must have a value for the required attribute 'comp:id', and one, and only one, of the attributes 'comp:idRef', 'comp:unitRef', or 'comp:metaIdRef'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <port> object.\nReference: L3V1 Comp V1 Section 3.4.3\n The <comp:port> element with the 'name' with value 'a' and the 'comp:name' with value 'a' must only use the 'comp:name' attribute.\n"), NULL); delete doc; } @@ -339,7 +465,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_deletion_id_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_deletion_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -347,6 +473,39 @@ " <comp:listOfSubmodels>" " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\">" " <comp:listOfDeletions>" + " <comp:deletion id=\"del1b\" comp:id=\"del1\" comp:idRef=\"a\"/>" + " </comp:listOfDeletions>" + " </comp:submodel>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompDeletionAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <deletion> object must have a value for one, and only one, of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', and 'comp:metaIdRef'. It may also have the optional attributes 'comp:id' and 'comp:name'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <deletion> object.\nReference: L3V1 Comp V1 Section 3.5.3\n The <comp:deletion> element with the 'id' with value 'del1b' and the 'comp:id' with value 'del1' must only use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_deletion_id_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\">" + " <comp:listOfDeletions>" " <comp:deletion id=\"del1\" comp:id=\"del1\" comp:idRef=\"a\"/>" " </comp:listOfDeletions>" " </comp:submodel>" @@ -365,6 +524,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompDeletionAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "A <deletion> object must have a value for one, and only one, of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', and 'comp:metaIdRef'. It may also have the optional attributes 'comp:id' and 'comp:name'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <deletion> object.\nReference: L3V1 Comp V1 Section 3.5.3\n The <comp:deletion> element with the 'id' with value 'del1' and the 'comp:id' with value 'del1' must only use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -403,7 +563,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_deletion_name_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_deletion_name_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -411,6 +571,39 @@ " <comp:listOfSubmodels>" " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\">" " <comp:listOfDeletions>" + " <comp:deletion name=\"del1b\" comp:name=\"del1\" comp:idRef=\"a\"/>" + " </comp:listOfDeletions>" + " </comp:submodel>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompDeletionAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <deletion> object must have a value for one, and only one, of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', and 'comp:metaIdRef'. It may also have the optional attributes 'comp:id' and 'comp:name'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <deletion> object.\nReference: L3V1 Comp V1 Section 3.5.3\n The <comp:deletion> element with the 'name' with value 'del1b' and the 'comp:name' with value 'del1' must only use the 'comp:name' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_deletion_name_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\">" + " <comp:listOfDeletions>" " <comp:deletion name=\"del1\" comp:name=\"del1\" comp:idRef=\"a\"/>" " </comp:listOfDeletions>" " </comp:submodel>" @@ -429,6 +622,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompDeletionAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "A <deletion> object must have a value for one, and only one, of the attributes 'comp:portRef', 'comp:idRef', 'comp:unitRef', and 'comp:metaIdRef'. It may also have the optional attributes 'comp:id' and 'comp:name'. No other attributes from the Hierarchical Model Composition namespace are permitted on a <deletion> object.\nReference: L3V1 Comp V1 Section 3.5.3\n The <comp:deletion> element with the 'name' with value 'del1' and the 'comp:name' with value 'del1' must only use the 'comp:name' attribute.\n"), NULL); delete doc; } @@ -459,7 +653,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_extmod_id_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_extmod_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -469,6 +663,31 @@ " </comp:listOfSubmodels>" " </model>" " <comp:listOfExternalModelDefinitions>" + " <comp:externalModelDefinition id=\"EM1\" comp:id=\"EM1b\" comp:source=\"new_aggregate.xml\" />" + " </comp:listOfExternalModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompExtModDefAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "An <externalModelDefinition> object must have the attributes 'comp:id' and 'comp:source', and may have the optional attributes 'comp:name', 'comp:modelRef', and 'comp:md5'. No other attributes from the Hierarchical Model Composition namespace are permitted on an <externalModelDefinition> object.\nReference: L3V1 Comp V1 Section 3.3.2\n The <comp:externalModelDefinition> element with the 'id' with value 'EM1' and the 'comp:id' with value 'EM1b' must only use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_extmod_id_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"EM1\" />" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfExternalModelDefinitions>" " <comp:externalModelDefinition id=\"EM1\" comp:id=\"EM1\" comp:source=\"new_aggregate.xml\" />" " </comp:listOfExternalModelDefinitions>" "</sbml>"; @@ -477,6 +696,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompExtModDefAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "An <externalModelDefinition> object must have the attributes 'comp:id' and 'comp:source', and may have the optional attributes 'comp:name', 'comp:modelRef', and 'comp:md5'. No other attributes from the Hierarchical Model Composition namespace are permitted on an <externalModelDefinition> object.\nReference: L3V1 Comp V1 Section 3.3.2\n The <comp:externalModelDefinition> element with the 'id' with value 'EM1' and the 'comp:id' with value 'EM1' must only use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -507,7 +727,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_extmod_name_coreAndComp) +START_TEST (test_comp_AttributeNamespaces_extmod_name_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -517,6 +737,31 @@ " </comp:listOfSubmodels>" " </model>" " <comp:listOfExternalModelDefinitions>" + " <comp:externalModelDefinition name=\"EM1b\" comp:name=\"EM1\" comp:id=\"EM1\" comp:source=\"new_aggregate.xml\" />" + " </comp:listOfExternalModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompExtModDefAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "An <externalModelDefinition> object must have the attributes 'comp:id' and 'comp:source', and may have the optional attributes 'comp:name', 'comp:modelRef', and 'comp:md5'. No other attributes from the Hierarchical Model Composition namespace are permitted on an <externalModelDefinition> object.\nReference: L3V1 Comp V1 Section 3.3.2\n The <comp:externalModelDefinition> element with the 'name' with value 'EM1b' and the 'comp:name' with value 'EM1' must only use the 'comp:name' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_extmod_name_coreAndComp_warning) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"EM1\" />" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfExternalModelDefinitions>" " <comp:externalModelDefinition name=\"EM1\" comp:name=\"EM1\" comp:id=\"EM1\" comp:source=\"new_aggregate.xml\" />" " </comp:listOfExternalModelDefinitions>" "</sbml>"; @@ -525,6 +770,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompExtModDefAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_WARNING); fail_unless( !strcmp(error->getMessage().c_str(), "An <externalModelDefinition> object must have the attributes 'comp:id' and 'comp:source', and may have the optional attributes 'comp:name', 'comp:modelRef', and 'comp:md5'. No other attributes from the Hierarchical Model Composition namespace are permitted on an <externalModelDefinition> object.\nReference: L3V1 Comp V1 Section 3.3.2\n The <comp:externalModelDefinition> element with the 'name' with value 'EM1' and the 'comp:name' with value 'EM1' must only use the 'comp:name' attribute.\n"), NULL); delete doc; } @@ -566,7 +812,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_replacedElement_id_compAndCore) +START_TEST (test_comp_AttributeNamespaces_replacedElement_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -574,6 +820,42 @@ " <listOfParameters>" " <parameter id=\"a\" value=\"3\" constant=\"true\">" " <comp:listOfReplacedElements>" + " <comp:replacedElement comp:id=\"re1b\" id=\"re1\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" + " </comp:listOfReplacedElements>" + " </parameter>" + " </listOfParameters>" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompReplacedElementAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedElement> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef', 'comp:metaIdRef', or 'comp:deletion'. It may also have a value for the optional attribute 'comp:conversionFactor'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedElement> object.\nReference: L3V1 Comp V1 Section 3.6.2\n The <comp:replacedElement> element with the 'comp:id' with value 're1b' and the 'id' with value 're1' must not use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_replacedElement_id_coreAndComp_error2) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\">" + " <comp:listOfReplacedElements>" " <comp:replacedElement comp:id=\"re1\" id=\"re1\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" " </comp:listOfReplacedElements>" " </parameter>" @@ -595,6 +877,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompReplacedElementAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedElement> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef', 'comp:metaIdRef', or 'comp:deletion'. It may also have a value for the optional attribute 'comp:conversionFactor'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedElement> object.\nReference: L3V1 Comp V1 Section 3.6.2\n The <comp:replacedElement> element with the 'comp:id' with value 're1' and the 'id' with value 're1' must not use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -634,7 +917,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_replacedBy_id_compAndCore) +START_TEST (test_comp_AttributeNamespaces_replacedBy_id_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -641,6 +924,40 @@ " <model id=\"bar\" name=\"bar\">" " <listOfParameters>" " <parameter id=\"a\" value=\"3\" constant=\"true\">" + " <comp:replacedBy comp:id=\"re1b\" id=\"re1\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" + " </parameter>" + " </listOfParameters>" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompReplacedByAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedBy> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedBy> object.\nReference: L3V1 Comp V1 Section 3.6.4\n The <comp:replacedBy> element with the 'comp:id' with value 're1b' and the 'id' with value 're1' must not use the 'comp:id' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_replacedBy_id_coreAndComp_error2) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\">" " <comp:replacedBy comp:id=\"re1\" id=\"re1\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" " </parameter>" " </listOfParameters>" @@ -661,6 +978,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompReplacedByAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedBy> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedBy> object.\nReference: L3V1 Comp V1 Section 3.6.4\n The <comp:replacedBy> element with the 'comp:id' with value 're1' and the 'id' with value 're1' must not use the 'comp:id' attribute.\n"), NULL); delete doc; } @@ -700,7 +1018,7 @@ END_TEST -START_TEST (test_comp_AttributeNamespaces_replacedBy_name_compAndCore) +START_TEST (test_comp_AttributeNamespaces_replacedBy_name_coreAndComp_error) { string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" @@ -707,6 +1025,40 @@ " <model id=\"bar\" name=\"bar\">" " <listOfParameters>" " <parameter id=\"a\" value=\"3\" constant=\"true\">" + " <comp:replacedBy comp:name=\"re1\" name=\"re1b\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" + " </parameter>" + " </listOfParameters>" + " <comp:listOfSubmodels>" + " <comp:submodel comp:id=\"S1\" comp:modelRef=\"foo\"/>" + " </comp:listOfSubmodels>" + " </model>" + " <comp:listOfModelDefinitions>" + " <comp:modelDefinition id=\"foo\" name=\"foo\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\"/>" + " </listOfParameters>" + " </comp:modelDefinition>" + " </comp:listOfModelDefinitions>" + "</sbml>"; + SBMLDocument* doc = readSBMLFromString(input.c_str()); + SBMLErrorLog* errors = doc->getErrorLog(); + fail_unless(errors->getNumErrors() == 1); + const SBMLError* error = errors->getError(0); + fail_unless(error->getErrorId() == CompReplacedByAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); + fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedBy> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedBy> object.\nReference: L3V1 Comp V1 Section 3.6.4\n The <comp:replacedBy> element with the 'comp:name' with value 're1' and the 'name' with value 're1b' must not use the 'comp:name' attribute.\n"), NULL); + delete doc; +} +END_TEST + + +START_TEST (test_comp_AttributeNamespaces_replacedBy_name_coreAndComp_error2) +{ + string input = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<sbml xmlns:comp=\"http://www.sbml.org/sbml/level3/version1/comp/version1\" xmlns=\"http://www.sbml.org/sbml/level3/version2/core\" level=\"3\" version=\"2\" comp:required=\"true\">" + " <model id=\"bar\" name=\"bar\">" + " <listOfParameters>" + " <parameter id=\"a\" value=\"3\" constant=\"true\">" " <comp:replacedBy comp:name=\"re1\" name=\"re1\" comp:idRef=\"a\" comp:submodelRef=\"S1\"/>" " </parameter>" " </listOfParameters>" @@ -727,6 +1079,7 @@ fail_unless(errors->getNumErrors() == 1); const SBMLError* error = errors->getError(0); fail_unless(error->getErrorId() == CompReplacedByAllowedAttributes); + fail_unless(error->getSeverity() == LIBSBML_SEV_ERROR); fail_unless( !strcmp(error->getMessage().c_str(), "A <replacedBy> object must have a value for the required attribute 'comp:submodelRef', and a value for one, and only one, of the following attributes: 'comp:portRef', 'comp:idRef', 'comp:unitRef' or 'comp:metaIdRef'. No other attributes from the HierarchicalModel Composition namespace are permitted on a <replacedBy> object.\nReference: L3V1 Comp V1 Section 3.6.4\n The <comp:replacedBy> element with the 'comp:name' with value 're1' and the 'name' with value 're1' must not use the 'comp:name' attribute.\n"), NULL); delete doc; } @@ -784,27 +1137,38 @@ tcase_add_test(tcase, test_comp_AttributeNamespaces_good); tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_id_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_id_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_id_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_name_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_name_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_name_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_submod_name_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_port_id_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_port_id_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_port_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_port_id_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_port_name_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_port_name_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_port_name_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_port_name_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_id_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_id_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_id_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_name_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_name_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_name_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_deletion_name_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_id_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_id_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_id_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_name_coreNotComp); - tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_name_coreAndComp); + tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_name_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_extmod_name_coreAndComp_warning); tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedElement_id_compNotCore); - tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedElement_id_compAndCore); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedElement_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedElement_id_coreAndComp_error2); tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_id_compNotCore); - tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_id_compAndCore); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_id_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_id_coreAndComp_error2); tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_name_compNotCore); - tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_name_compAndCore); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_name_coreAndComp_error); + tcase_add_test(tcase, test_comp_AttributeNamespaces_replacedBy_name_coreAndComp_error2); tcase_add_test(tcase, test_comp_AttributeNamespaces_moddef_id_compNotCore); tcase_add_test(tcase, test_comp_AttributeNamespaces_model_extraCompAtt); Modified: trunk/libsbml/src/sbml/validator/VConstraint.cpp =================================================================== --- trunk/libsbml/src/sbml/validator/VConstraint.cpp 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/validator/VConstraint.cpp 2019-10-24 00:40:06 UTC (rev 26140) @@ -158,7 +158,7 @@ SBMLError error = SBMLError( mId, level, version, message, object.getLine(), object.getColumn(), - LIBSBML_SEV_ERROR, LIBSBML_CAT_SBML, pkg, pkgVersion); + LIBSBML_SEV_UNKNOWN, LIBSBML_CAT_SBML, pkg, pkgVersion); if (error.getSeverity() != LIBSBML_SEV_NOT_APPLICABLE) mValidator.logFailure(error); Modified: trunk/libsbml/src/sbml/xml/XMLError.cpp =================================================================== --- trunk/libsbml/src/sbml/xml/XMLError.cpp 2019-10-23 22:11:35 UTC (rev 26139) +++ trunk/libsbml/src/sbml/xml/XMLError.cpp 2019-10-24 00:40:06 UTC (rev 26140) @@ -42,6 +42,7 @@ #include <sbml/xml/XMLError.h> #include <sbml/xml/XMLAttributes.h> #include <sbml/xml/XMLConstructorException.h> +#include <sbml/SBMLError.h> /** @cond doxygenIgnored */ using namespace std; @@ -396,8 +397,8 @@ mCategoryString = stringForCategory(mCategory); mValidError = false; + return; - } // It's not an error code in the XML layer, so assume the caller has @@ -413,7 +414,12 @@ // Other initializations. - mSeverity = severity; + if (severity == LIBSBML_SEV_UNKNOWN) { + mSeverity = LIBSBML_SEV_ERROR; + } + else { + mSeverity = severity; + } mSeverityString = stringForSeverity(severity); mCategory = category; |
From: <luc...@us...> - 2019-10-23 22:11:37
|
Revision: 26139 http://sourceforge.net/p/sbml/code/26139 Author: luciansmith Date: 2019-10-23 22:11:35 +0000 (Wed, 23 Oct 2019) Log Message: ----------- Add validation rule 1220450, and the hooks necessary to actually check it. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-23 19:19:32 UTC (rev 26138) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-23 22:11:35 UTC (rev 26139) @@ -73,6 +73,7 @@ , SpatialCompartmentAllowedElements = 1220301 , SpatialSpeciesAllowedAttributes = 1220401 , SpatialSpeciesIsSpatialMustBeBoolean = 1220402 +, SpatialCompartmentsMustHaveCompartmentMapping = 1220450 , SpatialParameterAllowedElements = 1220501 , SpatialReactionAllowedAttributes = 1220601 , SpatialReactionIsLocalMustBeBoolean = 1220602 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-23 19:19:32 UTC (rev 26138) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-23 22:11:35 UTC (rev 26139) @@ -189,6 +189,16 @@ } }, + // 1220450 + { SpatialCompartmentsMustHaveCompartmentMapping, + "Spatial species compartments must have compartment mapping.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "The <compartment> of any <species> that has a value of 'true' for the 'spatial:isSpatial' attribute must have a child <compartmentMapping>.", + { "L3V1 Spatial V1 Section" + } + }, + // 1220501 { SpatialParameterAllowedElements, "Elements allowed on <parameter>.", Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-10-23 19:19:32 UTC (rev 26138) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-10-23 22:11:35 UTC (rev 26139) @@ -143,6 +143,7 @@ ConstraintSet<SBMLDocument> mSBMLDocument; ConstraintSet<Model> mModel; ConstraintSet<Reaction> mReaction; + ConstraintSet<Species> mSpecies; ConstraintSet<DomainType> mDomainType; ConstraintSet<Domain> mDomain; ConstraintSet<InteriorPoint> mInteriorPoint; @@ -234,6 +235,12 @@ return; } + if (dynamic_cast< TConstraint<Species>* >(c) != NULL) + { + mSpecies.add(static_cast< TConstraint<Species>* >(c) ); + return; + } + if (dynamic_cast< TConstraint<DomainType>* >(c) != NULL) { mDomainType.add(static_cast< TConstraint<DomainType>* >(c) ); @@ -747,6 +754,14 @@ } + bool + visit(const Species& x) + { + v.mSpatialConstraints->mSpecies.applyTo(m, x); + return !v.mSpatialConstraints->mSpecies.empty(); + } + + virtual void visit (const Model &x) { v.mSpatialConstraints->mModel.applyTo(m, x); Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-23 19:19:32 UTC (rev 26138) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-23 22:11:35 UTC (rev 26139) @@ -45,6 +45,7 @@ #include <sbml/packages/spatial/common/SpatialExtensionTypes.h> #include <sbml/packages/spatial/sbml/Geometry.h> #include <sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h> +#include <sbml/Species.h> #endif /* AddingConstraintsToValidator */ @@ -652,5 +653,45 @@ END_CONSTRAINT +// 1220450 +START_CONSTRAINT(SpatialCompartmentsMustHaveCompartmentMapping, Species, species) +{ + bool fail = false; + if (!species.isSetCompartment()) { + return; + } + const SpatialSpeciesPlugin* ssp = static_cast<const SpatialSpeciesPlugin*>(species.getPlugin("spatial")); + if (ssp == NULL || !ssp->isSetIsSpatial() || !ssp->getIsSpatial()) { + return; + } + if (species.getParentSBMLObject() == NULL) { + return; + } + const Model* model = static_cast<const Model*>(species.getParentSBMLObject()->getParentSBMLObject()); + if (model == NULL) { + return; + } + const Compartment* compartment = model->getCompartment(species.getCompartment()); + if (compartment == NULL) { + return; + } + const SpatialCompartmentPlugin* scp = static_cast<const SpatialCompartmentPlugin*>(compartment->getPlugin("spatial")); + if (scp == NULL || scp->isSetCompartmentMapping() == false) { + fail = true; + stringstream ss_msg; + ss_msg << "A species"; + if (species.isSetId()) + { + ss_msg << " with id '" << species.getId() << "'"; + } + ss_msg << " is set 'isSpatial=true', but its compartment ('" << species.getCompartment() << "') does not have a child <compartmentMapping>."; + msg = ss_msg.str(); + } + + inv(fail == false); +} +END_CONSTRAINT + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-23 19:19:32 UTC (rev 26138) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-23 22:11:35 UTC (rev 26139) @@ -58,6 +58,7 @@ addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeSampledValueMinMax(*this)); addConstraint(new VConstraintCompartmentMappingSpatialCompartmentMappingUnitSizeMustBeFraction(*this)); +addConstraint(new VConstraintSpeciesSpatialCompartmentsMustHaveCompartmentMapping(*this)); addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-01.xml 2019-10-23 22:11:35 UTC (rev 26139) @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="true"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + </spatial:listOfGeometryDefinitions> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"/> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-fail-01-02.xml 2019-10-23 22:11:35 UTC (rev 26139) @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <listOfCompartments> + <compartment constant="false" id="compartment"/> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220450-pass-00-01.xml 2019-10-23 22:11:35 UTC (rev 26139) @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="true"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + </spatial:listOfGeometryDefinitions> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="true"/> + </listOfSpecies> + </model> +</sbml> + |
From: <luc...@us...> - 2019-10-23 19:19:34
|
Revision: 26138 http://sourceforge.net/p/sbml/code/26138 Author: luciansmith Date: 2019-10-23 19:19:32 +0000 (Wed, 23 Oct 2019) Log Message: ----------- Update wording to match Mike's suggested edits. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-23 17:52:27 UTC (rev 26137) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-23 19:19:32 UTC (rev 26138) @@ -229,7 +229,7 @@ "Local spatial reactions must define compartment.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the attribute 'spatial:isLocal' on a <reaction> is 'true', it must also have a defined 'compartment' attribute.", + "If the attribute 'spatial:isLocal' of a <reaction> has the value 'true', the <reaction> must also define a value for the 'compartment' attribute.", { "L3V1 Spatial V1 Section" } }, @@ -298,7 +298,7 @@ "Dimensions of domainType must match 3D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly three <coordinateComponent> children, the 'spatial:spatialDimensions' attribute of a <domainType> may only have a value of '2' or '3'.", + "If the <geometry> of the <model> has exactly three <coordinateComponent> children, the attribute 'spatial:spatialDimensions' of a <domainType> may only have a value of '2' or '3'.", { "L3V1 Spatial V1 Section" } }, @@ -308,7 +308,7 @@ "Dimensions of domainType must match 2D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly two <coordinateComponent> children, the 'spatial:spatialDimensions' attribute of a <domainType> may only have a value of '1' or '2'.", + "If the <geometry> of the <model> has exactly two <coordinateComponent> children, the attribute 'spatial:spatialDimensions' of a <domainType> may only have a value of '1' or '2'.", { "L3V1 Spatial V1 Section" } }, @@ -318,7 +318,7 @@ "Dimensions of domainType must match 1D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly one <coordinateComponent> childr, the 'spatial:spatialDimensions' attribute of a <domainType> may only have a value of '0' or '1'.", + "If the <geometry> of the <model> has exactly one <coordinateComponent> childr, the attribute 'spatial:spatialDimensions' of a <domainType> may only have a value of '0' or '1'.", { "L3V1 Spatial V1 Section" } }, @@ -1109,7 +1109,7 @@ "Only one 'numSamples' attribute in 1D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly one <coordinateComponent> child, a <sampledField> object must define the 'spatial:numSamples1' attribute, and must not define the 'spatial:numSamples2' and 'spatial:numSamples3' attributes.", + "If the <geometry> of the <model> has exactly one <coordinateComponent> child, a <sampledField> object must define the attribute 'spatial:numSamples1', and must not define the attributes 'spatial:numSamples2' nor 'spatial:numSamples3'.", { "L3V1 Spatial V1 Section" } }, @@ -1119,7 +1119,7 @@ "Two 'numSamples' attributes in 2D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly two <coordinateComponent> children, a <sampledField> object must define the 'spatial:numSamples1' and 'spatial:numSamples2' attributes, and must not define the 'spatial:numSamples3' attribute.", + "If the <geometry> of the <model> has exactly two <coordinateComponent> children, a <sampledField> object must define the attributes 'spatial:numSamples1' and 'spatial:numSamples2', and must not define the attribute 'spatial:numSamples3'.", { "L3V1 Spatial V1 Section" } }, @@ -1129,7 +1129,7 @@ "Three 'numSamples' attributes in 3D geometry.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the <geometry> of the <model> has exactly three <coordinateComponent> children, a <sampledField> object must define the 'spatial:numSamples1', 'spatial:numSamples2', and 'spatial:numSamples3' attributes.", + "If the <geometry> of the <model> has exactly three <coordinateComponent> children, a <sampledField> object must define the attributes 'spatial:numSamples1', 'spatial:numSamples2', and 'spatial:numSamples3'.", { "L3V1 Spatial V1 Section" } }, @@ -2337,7 +2337,7 @@ "Need two components for 'difference' type.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the 'spatial:operationType' attribute of a <csgSetOperator> has the value 'difference', it must also define the 'spatial:componentA' and 'spatial:componentB' attributes.", + "If the attribute 'spatial:operationType' of a <csgSetOperator> has the value 'difference', it must also define values for the attributes 'spatial:componentA' and 'spatial:componentB'.", { "L3V1 Spatial V1 Section" } }, @@ -2347,7 +2347,7 @@ "No components for 'union' or 'intersection' types.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If the 'spatial:operationType' attribute of a <csgSetOperator> has the value 'union' or 'intersection', it must not define the 'spatial:componentA' nor the 'spatial:componentB' attributes", + "If the attribute 'spatial:operationType' of a <csgSetOperator> has the value 'union' or 'intersection', it must not define values for the attributes 'spatial:componentA' nor 'spatial:componentB'.", { "L3V1 Spatial V1 Section" } }, @@ -2498,7 +2498,7 @@ "No coordinate references for 'isotropic' type.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <diffusionCoefficient> with an attribute 'type' with the value 'isotropic' may not define the 'spatial:coordinateReference1' nor 'spatial:coordinateReference2' attributes.", + "A <diffusionCoefficient> with an attribute 'type' value of 'isotropic' may not define the attributes 'spatial:coordinateReference1' nor 'spatial:coordinateReference2'.", { "L3V1 Spatial V1 Section" } }, @@ -2508,7 +2508,7 @@ "Two coordinate references for 'tensor' type.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <diffusionCoefficient> with an attribute 'type' with the value 'tensor' must define the 'spatial:coordinateReference1' and 'spatial:coordinateReference2' attributes.", + "A <diffusionCoefficient> with an attribute 'type' value of 'tensor' must define the attributes 'spatial:coordinateReference1' and 'spatial:coordinateReference2'.", { "L3V1 Spatial V1 Section" } }, @@ -2518,7 +2518,7 @@ "One coordinate references for 'anisotropic' type.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <diffusionCoefficient> with an attribute 'type' with the value 'anisotropic\x94 must define the 'spatial:coordinateReference1' attribute, and must not define the 'spatial:coordinateReference2' attribute.", + "A <diffusionCoefficient> with an attribute 'type' value of 'anisotropic\x94 must define the attribute 'spatial:coordinateReference1', and must not define the attribute 'spatial:coordinateReference2'.", { "L3V1 Spatial V1 Section" } }, @@ -2680,7 +2680,7 @@ "A BoundaryCondition must have 'boundaryDomainType' or 'coordinateBoundary' attribute.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <boundaryCondition> must have a defined 'spatial:coordinateBoundary' or 'spatial:boundaryDomainType' attribute, but may not define both.", + "A <boundaryCondition> must define a value for either the attribute 'spatial:coordinateBoundary' or 'spatial:boundaryDomainType', but not both.", { "L3V1 Spatial V1 Section" } }, @@ -2920,7 +2920,7 @@ "Solitary <coordinateComponents> must be 'cartesianX'.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If a <listOfCoordinateComponents> object has exactly one <coordinateComponents> child, that child must have a 'spatial:type' with the value 'cartesianX'.", + "If a <listOfCoordinateComponents> object has exactly one <coordinateComponents> child, that child must have a 'spatial:type' attribute with the value 'cartesianX'.", { "L3V1 Spatial V1 Section" } }, @@ -2930,7 +2930,7 @@ "Paired <coordinateComponents> must be 'cartesianX' and 'cartesianY'.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If a <listOfCoordinateComponents> object has exactly two <coordinateComponents> children, one of them must have a 'spatial:type' with the value 'cartesianX', and the other must have a 'spatial:type' with the value 'cartesianY'.", + "If a <listOfCoordinateComponents> object has exactly two <coordinateComponents> children, one of them must have a 'spatial:type' attribute with the value 'cartesianX', and the other must have a 'spatial:type' attribute with the value 'cartesianY'.", { "L3V1 Spatial V1 Section" } }, @@ -2940,7 +2940,7 @@ "Three <coordinateComponents> must be cartesian X, Y, and Z.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "If a <listOfCoordinateComponents> object has exactly three <coordinateComponents> children, one of them must have a 'spatial:type' with the value 'cartesianX', one must have a 'spatial:type' with the value 'cartesianY', and one must have a 'spatial:type' with the value 'cartesianZ'", + "If a <listOfCoordinateComponents> object has exactly three <coordinateComponents> children, one of them must have a 'spatial:type' attribute with the value 'cartesianX', one must have a 'spatial:type' attribute with the value 'cartesianY', and one must have a 'spatial:type' attribute with the value 'cartesianZ'", { "L3V1 Spatial V1 Section" } }, @@ -3036,7 +3036,7 @@ "Mixed geometry children are not active.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "Every <geometryDefinition> child of a <mixedGeometry> must have a 'spatial:isActive' attribute with a value of 'false'.", + "Every <geometryDefinition> child of a <mixedGeometry> must have a 'spatial:isActive' attribute value of 'false'.", { "L3V1 Spatial V1 Section" } }, |
From: <luc...@us...> - 2019-10-23 17:52:28
|
Revision: 26137 http://sourceforge.net/p/sbml/code/26137 Author: luciansmith Date: 2019-10-23 17:52:27 +0000 (Wed, 23 Oct 2019) Log Message: ----------- Fix docs for new files. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp 2019-10-23 17:41:42 UTC (rev 26136) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp 2019-10-23 17:52:27 UTC (rev 26137) @@ -2,8 +2,8 @@ * @cond doxygenLibsbmlInternal * * @file SpatialCompartmentMappingUnitSizesCheck.cpp -* @brief Ensures unique variables assigned by rules and events -* @author Sarah Keating +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith * * <!-------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more @@ -36,14 +36,8 @@ * and also available online as http://sbml.org/software/libsbml/license.html * ---------------------------------------------------------------------- -->*/ -#include <sbml/Model.h> -#include <sbml/Rule.h> -#include <sbml/Event.h> -#include <sbml/EventAssignment.h> - #include "SpatialCompartmentMappingUnitSizesCheck.h" #include <sbml/packages/spatial/extension/SpatialCompartmentPlugin.h> -#include <sbml/util/IdList.h> #include <set> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h 2019-10-23 17:41:42 UTC (rev 26136) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h 2019-10-23 17:52:27 UTC (rev 26137) @@ -2,8 +2,8 @@ * @cond doxygenLibsbmlInternal * * @file SpatialCompartmentMappingUnitSizesCheck.h -* @brief Ensures the appropriate ids within a Model are unique -* @author Sarah Keating +* @brief Ensure that spatial compartment mappings' unit sizes sum to one. +* @author Sarah Keating, Lucian Smith * * <!-------------------------------------------------------------------------- * This file is part of libSBML. Please visit http://sbml.org for more |
From: <luc...@us...> - 2019-10-23 17:41:46
|
Revision: 26136 http://sourceforge.net/p/sbml/code/26136 Author: luciansmith Date: 2019-10-23 17:41:42 +0000 (Wed, 23 Oct 2019) Log Message: ----------- Add validation warning 21351. Fix old models so they don't fail this. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221305-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-02.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01-1221351.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02-1221351.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03-1221351.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04-1221351.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221351-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221351-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221351-pass-00-01.xml Removed Paths: ------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.cpp 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,125 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialCompartmentMappingUnitSizesCheck.cpp +* @brief Ensures unique variables assigned by rules and events +* @author Sarah Keating +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2009-2013 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* Copyright (C) 2006-2008 by the California Institute of Technology, +* Pasadena, CA, USA +* +* Copyright (C) 2002-2005 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. Japan Science and Technology Agency, Japan +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#include <sbml/Model.h> +#include <sbml/Rule.h> +#include <sbml/Event.h> +#include <sbml/EventAssignment.h> + +#include "SpatialCompartmentMappingUnitSizesCheck.h" +#include <sbml/packages/spatial/extension/SpatialCompartmentPlugin.h> +#include <sbml/util/IdList.h> + +#include <set> + +/** @cond doxygenIgnored */ +using namespace std; +/** @endcond */ + +LIBSBML_CPP_NAMESPACE_BEGIN +#ifdef __cplusplus + + +/* +* Creates a new Constraint with the given constraint id. +*/ +SpatialCompartmentMappingUnitSizesCheck::SpatialCompartmentMappingUnitSizesCheck (unsigned int id, SpatialValidator& v) : + TConstraint<Model>(id, v) +{ +} + + +/* +* Destroys this Constraint. +*/ +SpatialCompartmentMappingUnitSizesCheck::~SpatialCompartmentMappingUnitSizesCheck () +{ +} + + +/* +* Checks that all ids on the following Model objects are unique: +* event assignments and assignment rules. +*/ +void +SpatialCompartmentMappingUnitSizesCheck::check_ (const Model& m, const Model&) +{ + if (m.getLevel() < 3) { + return; + } + set<string> domainTypes; + set<const CompartmentMapping*> compartmentMappings; + for (unsigned long c = 0; c < m.getNumCompartments(); c++) { + const Compartment* comp = m.getCompartment(c); + const SpatialCompartmentPlugin* scp = static_cast<const SpatialCompartmentPlugin*>(comp->getPlugin("spatial")); + if (scp == NULL) { + continue; + } + if (scp->isSetCompartmentMapping()) { + const CompartmentMapping* cm = scp->getCompartmentMapping(); + if (cm->isSetDomainType() && cm->isSetUnitSize()) { + domainTypes.insert(cm->getDomainType()); + compartmentMappings.insert(cm); + } + } + } + + double epsilon = 0.001; + for (set<string>::iterator dti = domainTypes.begin(); dti != domainTypes.end(); dti++) { + string domainType = *dti; + double sum = 0; + for (set<const CompartmentMapping*>::iterator cmi = compartmentMappings.begin(); cmi != compartmentMappings.end(); cmi++) { + if ((*cmi)->getDomainType() == domainType) { + sum += (*cmi)->getUnitSize(); + } + } + if (sum > 1 + epsilon || sum < 1 - epsilon) { + stringstream ss; + ss << "The unitSize values of the <compartmentMapping> elements that have '" << domainType; + ss << "' as their domainType add up to " << sum << "."; + msg = ss.str(); + + logFailure(m); + } + } +} + +#endif /* __cplusplus */ + +LIBSBML_CPP_NAMESPACE_END +/** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,69 @@ +/** +* @cond doxygenLibsbmlInternal +* +* @file SpatialCompartmentMappingUnitSizesCheck.h +* @brief Ensures the appropriate ids within a Model are unique +* @author Sarah Keating +* +* <!-------------------------------------------------------------------------- +* This file is part of libSBML. Please visit http://sbml.org for more +* information about SBML, and the latest version of libSBML. +* +* Copyright (C) 2019 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. University of Heidelberg, Heidelberg, Germany +* +* Copyright (C) 2013-2018 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* 3. University of Heidelberg, Heidelberg, Germany +* +* Copyright 2011-2012 jointly by the following organizations: +* 1. California Institute of Technology, Pasadena, CA, USA +* 2. EMBL European Bioinformatics Institute (EMBL-EBI), Hinxton, UK +* +* This library is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation. A copy of the license agreement is provided +* in the file named "LICENSE.txt" included with this software distribution +* and also available online as http://sbml.org/software/libsbml/license.html +* ---------------------------------------------------------------------- -->*/ + +#ifndef SpatialCompartmentMappingUnitSizesSum_h +#define SpatialCompartmentMappingUnitSizesSum_h + + +#ifdef __cplusplus + +#include <sbml/validator/VConstraint.h> +#include <sbml/packages/spatial/validator/SpatialValidator.h> + + +LIBSBML_CPP_NAMESPACE_BEGIN + +class SpatialCompartmentMappingUnitSizesCheck: public TConstraint<Model> +{ +public: + + /** + * Creates a new Constraint with the given constraint id. + */ + SpatialCompartmentMappingUnitSizesCheck (unsigned int id, SpatialValidator& v); + + /** + * Destroys this Constraint. + */ + virtual ~SpatialCompartmentMappingUnitSizesCheck (); + + +protected: + + virtual void check_ (const Model& m, const Model& object); + +}; + +LIBSBML_CPP_NAMESPACE_END + +#endif /* __cplusplus */ +#endif /* SpatialCompartmentMappingUnitSizesSum_h */ +/** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-23 17:41:42 UTC (rev 26136) @@ -44,6 +44,7 @@ #include <sbml/packages/spatial/validator/SpatialSBMLError.h> #include <sbml/packages/spatial/common/SpatialExtensionTypes.h> #include <sbml/packages/spatial/sbml/Geometry.h> +#include <sbml/packages/spatial/validator/SpatialCompartmentMappingUnitSizesCheck.h> #endif /* AddingConstraintsToValidator */ @@ -51,6 +52,10 @@ using namespace std; +EXTERN_CONSTRAINT(ErrorEnumValue, SpatialCompartmentMappingUnitSizesCheck); + + + // 1220805 START_CONSTRAINT(SpatialDomainDomainTypeMustBeDomainType, Domain, domain) { Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-23 17:41:42 UTC (rev 26136) @@ -38,6 +38,8 @@ * ------------------------------------------------------------------------ --> */ +#include "sbml\packages\spatial\validator\SpatialCompartmentMappingUnitSizesCheck.h" + addConstraint(new VConstraintDomainSpatialDomainDomainTypeMustBeDomainType(*this)); addConstraint(new VConstraintAdjacentDomainsSpatialAdjacentDomainsDomain1MustBeDomain(*this)); addConstraint(new VConstraintAdjacentDomainsSpatialAdjacentDomainsDomain2MustBeDomain(*this)); @@ -57,5 +59,7 @@ addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeSampledValueMinMax(*this)); addConstraint(new VConstraintCompartmentMappingSpatialCompartmentMappingUnitSizeMustBeFraction(*this)); +addConstraint(new SpatialCompartmentMappingUnitSizesCheck(1221351, *this)); + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,8 +60,8 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_2" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_2" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -60,7 +60,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -3,7 +3,7 @@ <model> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-fail-01-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -3,7 +3,7 @@ <model> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220601-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -3,7 +3,7 @@ <model> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -3,7 +3,7 @@ <model> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220602-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -3,7 +3,7 @@ <model> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> <listOfSpecies> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping foo="someString" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping foo="someString" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping metaid="someString" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping metaid="someString" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221301-pass-00-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping sboTerm="SBO:0000001" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping sboTerm="SBO:0000001" spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"> <annotation/> </spatial:compartmentMapping> </compartment> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221302-pass-00-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"> <notes/> </spatial:compartmentMapping> </compartment> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:foo="someString" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:foo="someString" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-fail-01-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221303-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="someString" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="someString" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221304-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221305-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221305-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221305-pass-00-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -14,7 +14,7 @@ </spatial:geometry> <listOfCompartments> <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1"/> </compartment> </listOfCompartments> </model> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01-1221351.xml (from rev 26135, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01-1221351.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01-1221351.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1.23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> - </spatial:listOfDomainTypes> - </spatial:geometry> - <listOfCompartments> - <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1.23"/> - </compartment> - </listOfCompartments> - </model> -</sbml> - Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02-1221351.xml (from rev 26135, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02-1221351.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02-1221351.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="-0.23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> - </spatial:listOfDomainTypes> - </spatial:geometry> - <listOfCompartments> - <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="-0.23"/> - </compartment> - </listOfCompartments> - </model> -</sbml> - Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03-1221351.xml (from rev 26135, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03-1221351.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03-1221351.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> - </spatial:listOfDomainTypes> - </spatial:geometry> - <listOfCompartments> - <compartment constant="false" id="compartment"> - <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="23"/> - </compartment> - </listOfCompartments> - </model> -</sbml> - Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04-1221351.xml (from rev 26135, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04-1221351.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04-1221351.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0.23e4"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml 2019-10-22 22:14:37 UTC (rev 26135) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml 2019-10-23 17:41:42 UTC (rev 26136) @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0... [truncated message content] |
From: <luc...@us...> - 2019-10-22 22:14:39
|
Revision: 26135 http://sourceforge.net/p/sbml/code/26135 Author: luciansmith Date: 2019-10-22 22:14:37 +0000 (Tue, 22 Oct 2019) Log Message: ----------- Spatial validation update: * Consolidate 21752-21754 * Add 21350 Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-02.xml Removed Paths: ------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLError.h 2019-10-22 22:14:37 UTC (rev 26135) @@ -121,6 +121,9 @@ , SpatialCompartmentMappingDomainTypeMustBeDomainType = 1221304 , SpatialCompartmentMappingUnitSizeMustBeDouble = 1221305 , SpatialCompartmentMappingNameMustBeString = 1221306 +, SpatialCompartmentMappingUnitSizeMustBeFraction = 1221350 +, SpatialCompartmentMappingUnitSizesSum = 1221351 +, SpatialCompartmentMappingUnitConsistency = 1221352 , SpatialCoordinateComponentAllowedCoreAttributes = 1221401 , SpatialCoordinateComponentAllowedCoreElements = 1221402 , SpatialCoordinateComponentAllowedAttributes = 1221403 @@ -160,9 +163,7 @@ , SpatialSampledVolumeMaxValueMustBeDouble = 1221708 , SpatialSampledVolumeNeedsMaxWithMin = 1221750 , SpatialSampledVolumeNeedsMinWithMax = 1221751 -, SpatialSampledVolumeNoSampledValueWithMinMax = 1221752 -, SpatialSampledVolumeNoMinMaxWithSampledValue = 1221753 -, SpatialSampledVolumeMinMaxOrSampledValue = 1221754 +, SpatialSampledVolumeSampledValueMinMax = 1221752 , SpatialAnalyticGeometryAllowedCoreAttributes = 1221801 , SpatialAnalyticGeometryAllowedCoreElements = 1221802 , SpatialAnalyticGeometryAllowedElements = 1221803 Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-10-22 22:14:37 UTC (rev 26135) @@ -753,6 +753,37 @@ } }, + // 1221350 + { SpatialCompartmentMappingUnitSizeMustBeFraction, + "The 'unitSize' attribute must be between 0 and 1.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_ERROR, + "The attribute 'spatial:unitSize' on a <compartmentMapping> must have a value " + "between 0 and 1.", + { "L3V1 Spatial V1 Section" + } + }, + + // 1221351 + { SpatialCompartmentMappingUnitSizesSum, + "The 'unitSize' attributes should sum to 1.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_WARNING, + "The values of the 'spatial:unitSize' attributes of every <compartmentMapping> with the same 'spatial:domainType' should sum to 1.", + { "L3V1 Spatial V1 Section" + } + }, + + // 1221352 + { SpatialCompartmentMappingUnitConsistency, + "The units of a compartmentMapping should be compartment units over domain units.", + LIBSBML_CAT_GENERAL_CONSISTENCY, + LIBSBML_SEV_WARNING, + "If a <parameter> has a child <spatialSymbolReference> that points to a <compartmentMapping>, the units of that <parameter> should be equivalent to the units of the parent <compartment> of the <compartmentMapping>, divided by the units of the <domainType> referenced by the <compartmentMapping>.", + { "L3V1 Spatial V1 Section" + } + }, + // 1221401 { SpatialCoordinateComponentAllowedCoreAttributes, "Core attributes allowed on <coordinateComponent>.", @@ -1218,35 +1249,15 @@ }, // 1221752 - { SpatialSampledVolumeNoSampledValueWithMinMax, - "No 'sampledValue' attribute with min and max.", + { SpatialSampledVolumeSampledValueMinMax, + "Every <sampleVolume> must have a 'sampledValue' attribute or the 'min' and 'max' attributes.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <sampledVolume> with defined 'spatial:minValue' and 'spatial:maxValue' attributes must not define the 'spatial:sampledValue' attribute.", + "A <sampledVolume> must either define the attribute 'spatial:sampledValue' or must define both the 'spatial:minValue' and 'spatial:maxValue' attributes, but may not define any other combination of those three attributes.", { "L3V1 Spatial V1 Section" } }, - // 1221753 - { SpatialSampledVolumeNoMinMaxWithSampledValue, - "No 'minValue' nor 'maxValue' attributes with 'sampledValue'.", - LIBSBML_CAT_GENERAL_CONSISTENCY, - LIBSBML_SEV_ERROR, - "A <sampledVolume> with a defined 'spatial:sampledValue' attribute may not define the 'spatial:minValue' nor the 'spatial:maxValue' attribute.", - { "L3V1 Spatial V1 Section" - } - }, - - // 1221754 - { SpatialSampledVolumeMinMaxOrSampledValue, - "SampledVolume must have 'sampledVolume' or 'minValue' and 'maxValue'.", - LIBSBML_CAT_GENERAL_CONSISTENCY, - LIBSBML_SEV_ERROR, - "A <sampledVolume> must either define its 'spatial:sampledValue' attribute or must define both the 'spatial:minValue' and 'spatial:maxValue' attributes.", - { "L3V1 Spatial V1 Section" - } - }, - // 1221801 { SpatialAnalyticGeometryAllowedCoreAttributes, "Core attributes allowed on <analyticGeometry>.", Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-10-22 22:14:37 UTC (rev 26135) @@ -566,7 +566,7 @@ // 1221752 -START_CONSTRAINT(SpatialSampledVolumeNoSampledValueWithMinMax, SampledVolume, svol) +START_CONSTRAINT(SpatialSampledVolumeSampledValueMinMax, SampledVolume, svol) { bool fail = false; if (svol.isSetMaxValue() && svol.isSetMinValue() && svol.isSetSampledValue()) { @@ -583,16 +583,7 @@ msg = ss_msg.str(); } - inv(fail == false); -} -END_CONSTRAINT - - -// 1221753 -START_CONSTRAINT(SpatialSampledVolumeNoMinMaxWithSampledValue, SampledVolume, svol) -{ - bool fail = false; - if (svol.isSetMaxValue() && !svol.isSetMinValue() && svol.isSetSampledValue()) { + else if (svol.isSetMaxValue() && !svol.isSetMinValue() && svol.isSetSampledValue()) { fail = true; stringstream ss_msg; ss_msg << "A SampledVolume"; @@ -618,24 +609,36 @@ msg = ss_msg.str(); } + else if (!svol.isSetMaxValue() && !svol.isSetMinValue() && !svol.isSetSampledValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " does not define a sampledValue, nor does it define a minValue and a maxValue."; + msg = ss_msg.str(); + } + inv(fail == false); } END_CONSTRAINT -// 1221754 -START_CONSTRAINT(SpatialSampledVolumeMinMaxOrSampledValue, SampledVolume, svol) +// 1221350 +START_CONSTRAINT(SpatialCompartmentMappingUnitSizeMustBeFraction, CompartmentMapping, cmap) { bool fail = false; - if (!svol.isSetMaxValue() && !svol.isSetMinValue() && !svol.isSetSampledValue()) { + if (cmap.isSetUnitSize() && (cmap.getUnitSize() > 1 || cmap.getUnitSize() < 0)) { fail = true; stringstream ss_msg; - ss_msg << "A SampledVolume"; - if (svol.isSetId()) + ss_msg << "A CompartmentMapping"; + if (cmap.isSetId()) { - ss_msg << " with id '" << svol.getId() << "'"; + ss_msg << " with id '" << cmap.getId() << "'"; } - ss_msg << " does not define a sampledValue, nor does it define a minValue and a maxValue."; + ss_msg << " has a unitSize of " << cmap.getUnitSize() << "."; msg = ss_msg.str(); } Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-10-22 22:14:37 UTC (rev 26135) @@ -54,9 +54,8 @@ addConstraint(new VConstraintSampledFieldSpatialSampledFieldThreeSamplesIn3DGeometry(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMaxWithMin(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); -addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoSampledValueWithMinMax(*this)); -addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoMinMaxWithSampledValue(*this)); -addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeMinMaxOrSampledValue(*this)); +addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeSampledValueMinMax(*this)); +addConstraint(new VConstraintCompartmentMappingSpatialCompartmentMappingUnitSizeMustBeFraction(*this)); /** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="1.23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="-0.23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-03.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-fail-01-04.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0.23e4"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0.23"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221350-pass-00-02.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="0"/> + </spatial:listOfDomainTypes> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="2.3e-2"/> + </compartment> + </listOfCompartments> + </model> +</sbml> + Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-02.xml (from rev 26134, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-03.xml (from rev 26134, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-03.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-03.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-04.xml (from rev 26134, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-04.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-04.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-02.xml (from rev 26134, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-02.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml 2019-10-09 06:32:43 UTC (rev 26134) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml 2019-10-22 22:14:37 UTC (rev 26135) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> |
From: <fbe...@us...> - 2019-10-09 06:32:45
|
Revision: 26134 http://sourceforge.net/p/sbml/code/26134 Author: fbergmann Date: 2019-10-09 06:32:43 +0000 (Wed, 09 Oct 2019) Log Message: ----------- - add an example for creating and using a function definition Added Paths: ----------- trunk/libsbml/examples/python/add_function_definition.py Added: trunk/libsbml/examples/python/add_function_definition.py =================================================================== --- trunk/libsbml/examples/python/add_function_definition.py (rev 0) +++ trunk/libsbml/examples/python/add_function_definition.py 2019-10-09 06:32:43 UTC (rev 26134) @@ -0,0 +1,124 @@ +#!/bin/env python +## @file add_function_definition.py +## @brief Example creating and using a function definition +## @author Frank T. Bergmann +## +## <!-------------------------------------------------------------------------- +## This sample program is distributed under a different license than the rest +## of libSBML. This program uses the open-source MIT license, as follows: +## +## Copyright (c) 2013-2018 by the California Institute of Technology +## (California, USA), the European Bioinformatics Institute (EMBL-EBI, UK) +## and the University of Heidelberg (Germany), with support from the National +## Institutes of Health (USA) under grant R01GM070923. All rights reserved. +## +## Permission is hereby granted, free of charge, to any person obtaining a +## copy of this software and associated documentation files (the "Software"), +## to deal in the Software without restriction, including without limitation +## the rights to use, copy, modify, merge, publish, distribute, sublicense, +## and/or sell copies of the Software, and to permit persons to whom the +## Software is furnished to do so, subject to the following conditions: +## +## The above copyright notice and this permission notice shall be included in +## all copies or substantial portions of the Software. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +## DEALINGS IN THE SOFTWARE. +## +## Neither the name of the California Institute of Technology (Caltech), nor +## of the European Bioinformatics Institute (EMBL-EBI), nor of the University +## of Heidelberg, nor the names of any contributors, may be used to endorse +## or promote products derived from this software without specific prior +## written permission. +## ------------------------------------------------------------------------ --> + + +import libsbml +import sys +import os + +def create_sbml_file(file_name): + """ + Simple function that creates a new SBML model 'model1' with a non constant parameter x + """ + doc = libsbml.SBMLDocument() + model = doc.createModel() + model.setId('model1') + + x = model.createParameter() + x.setId('x') + x.setValue(0) + x.setConstant(False) + + libsbml.writeSBMLToFile(doc, file_name) + + +def add_function_defintion(model, id, function): + #type: (libsbml.Model, str, str) + """ + this function adds a new function definition to the given sbml model + """ + + if model.getFunctionDefinition(id): + raise ValueError('the model already has a function definition with id %s' % id) + fun = model.createFunctionDefinition() + fun.setId(id) + + math = libsbml.parseL3Formula(function) + if not math: + raise ValueError('the formula could not be parsed') + fun.setMath(math) + +def add_assignment(model, parameter_id, formula): + #type: (libsbml.Model, str, str) + """ + this function adds an assignment rule to the given parameter + """ + if not model.getParameter(parameter_id): + raise ValueError('the model has no parameter %s' % parameter_id) + + rule = model.createAssignmentRule() + rule.setVariable(parameter_id) + + math = libsbml.parseL3Formula(formula) + if not math: + raise ValueError('the formula could not be parsed') + + rule.setMath(math) + + +if __name__ == "__main__": + + # create a test model if none exists + if not os.path.exists('test.xml'): + create_sbml_file('test.xml') + + # read in the test model + doc = libsbml.readSBMLFromFile('test.xml') + + # bail if it contained errors + if doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR) > 0: + doc.printErrors() + sys.exit(1) + + model = doc.getModel() + + # add a function definiton 'f(x) = sin(x)' to the model + add_function_defintion(model, 'f', 'lambda(x, sin(x))') + + # add an assignment to model: x = sin(time) + add_assignment(model, 'x', 'f(time)') + + # validate the model and bail if it contains errors now + doc.checkConsistency() + if doc.getNumErrors(libsbml.LIBSBML_SEV_ERROR) > 0: + doc.printErrors() + sys.exit(2) + + # write model to the file + libsbml.writeSBMLToFile(doc, 'test.xml') |
From: <luc...@us...> - 2019-09-26 21:43:46
|
Revision: 26133 http://sourceforge.net/p/sbml/code/26133 Author: luciansmith Date: 2019-09-26 21:43:44 +0000 (Thu, 26 Sep 2019) Log Message: ----------- Fix rule 20501: a Parameter may have only one of any of its optional children, not one of each. Modified Paths: -------------- trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex Modified: trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex =================================================================== --- trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex 2019-09-26 21:41:51 UTC (rev 26132) +++ trunk/specifications/sbml-level-3/version-1/spatial/specification/apdx-validation.tex 2019-09-26 21:43:44 UTC (rev 26133) @@ -143,12 +143,8 @@ \subsubsection*{Rules for extended \class{Parameter} object} -\validRule{spatial-20501}{A \Parameter object may contain one and only -one instance of each of the \SpatialSymbolReference, -\AdvectionCoefficient, \BoundaryCondition and \DiffusionCoefficient -elements. No other elements from the SBML Level~3 Spatial Processes -namespaces are permitted on a \Parameter object. (Reference: SBML -Level~3 Specification for Spatial Processes, Version~1, +\validRule{spatial-20501}{\changed{A \Parameter object may contain up to one child element from the SBML Level 3 Spatial Processes namespace: a \SpatialSymbolReference, an \AdvectionCoefficient, a \BoundaryCondition, or a \DiffusionCoefficient.} +(Reference: SBML Level~3 Specification for Spatial Processes, Version~1, \sec{extended-parameter-class}.)} |
From: <luc...@us...> - 2019-09-26 21:41:54
|
Revision: 26132 http://sourceforge.net/p/sbml/code/26132 Author: luciansmith Date: 2019-09-26 21:41:51 +0000 (Thu, 26 Sep 2019) Log Message: ----------- Fix rule 20501: a Parameter may have only one of any of its optional children, not one of each. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/extension/SpatialParameterPlugin.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-05.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-06.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-07.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-08.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-09.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-10.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-11.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-12.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-13.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-14.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-15.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-16.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-17.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-18.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-19.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-20.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-21.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-22.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-23.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-24.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-25.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-26.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-27.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-28.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-29.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-30.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-31.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-32.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-33.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-34.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-pass-00-04.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/extension/SpatialParameterPlugin.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/extension/SpatialParameterPlugin.cpp 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/extension/SpatialParameterPlugin.cpp 2019-09-26 21:41:51 UTC (rev 26132) @@ -1504,6 +1504,11 @@ if (prefix == targetPrefix) { + string err = "A <parameter> "; + Parameter* param = static_cast<Parameter*>(getParentSBMLObject()); + if (param->isSetId()) { + err += "with the id '" + param->getIdAttribute() + "' "; + } if (name == "spatialSymbolReference") { if (isSetSpatialSymbolReference()) @@ -1510,53 +1515,125 @@ { getErrorLog()->logPackageError("spatial", SpatialParameterAllowedElements, getPackageVersion(), getLevel(), - getVersion()); + getVersion(), err + "has multiple <spatialSymbolReference> children."); } + else if (isSetAdvectionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <spatialSymbolReference> and an <advectionCoefficient> child."); + } + else if (isSetBoundaryCondition()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <spatialSymbolReference> and a <boundaryCondition> child."); + } + else if (isSetDiffusionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <spatialSymbolReference> and a <diffusionCoefficient> child."); + } delete mSpatialSymbolReference; - mSpatialSymbolReference = NULL; + mSpatialSymbolReference = NULL; mSpatialSymbolReference = new SpatialSymbolReference(spatialns); obj = mSpatialSymbolReference; } else if (name == "advectionCoefficient") { - if (isSetAdvectionCoefficient()) + if (isSetSpatialSymbolReference()) { getErrorLog()->logPackageError("spatial", SpatialParameterAllowedElements, getPackageVersion(), getLevel(), - getVersion()); + getVersion(), err + "has both an <advectionCoefficient> and a <spatialSymbolReference> child."); } + else if (isSetAdvectionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has multiple <advectionCoefficient> children."); + } + else if (isSetBoundaryCondition()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both an <advectionCoefficient> and a <boundaryCondition> child."); + } + else if (isSetDiffusionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both an <advectionCoefficient> and a <diffusionCoefficient> child."); + } delete mAdvectionCoefficient; - mAdvectionCoefficient = NULL; + mAdvectionCoefficient = NULL; mAdvectionCoefficient = new AdvectionCoefficient(spatialns); obj = mAdvectionCoefficient; } else if (name == "boundaryCondition") { - if (isSetBoundaryCondition()) + if (isSetSpatialSymbolReference()) { getErrorLog()->logPackageError("spatial", SpatialParameterAllowedElements, getPackageVersion(), getLevel(), - getVersion()); + getVersion(), err + "has both a <boundaryCondition> and a <spatialSymbolReference> child."); } + else if (isSetAdvectionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <boundaryCondition> and an <advectionCoefficient> child."); + } + else if (isSetBoundaryCondition()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has multiple <boundaryCondition> children."); + } + else if (isSetDiffusionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <boundaryCondition> and a <diffusionCoefficient> child."); + } delete mBoundaryCondition; - mBoundaryCondition = NULL; + mBoundaryCondition = NULL; mBoundaryCondition = new BoundaryCondition(spatialns); obj = mBoundaryCondition; } else if (name == "diffusionCoefficient") { - if (isSetDiffusionCoefficient()) + if (isSetSpatialSymbolReference()) { getErrorLog()->logPackageError("spatial", SpatialParameterAllowedElements, getPackageVersion(), getLevel(), - getVersion()); + getVersion(), err + "has both a <diffusionCoefficient> and a <spatialSymbolReference> child."); } + else if (isSetAdvectionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <diffusionCoefficient> and an <advectionCoefficient> child."); + } + else if (isSetBoundaryCondition()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has both a <diffusionCoefficient> and a <boundaryCondition> child."); + } + else if (isSetDiffusionCoefficient()) + { + getErrorLog()->logPackageError("spatial", + SpatialParameterAllowedElements, getPackageVersion(), getLevel(), + getVersion(), err + "has multiple <diffusionCoefficient> children."); + } delete mDiffusionCoefficient; - mDiffusionCoefficient = NULL; + mDiffusionCoefficient = NULL; mDiffusionCoefficient = new DiffusionCoefficient(spatialns); obj = mDiffusionCoefficient; } Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialSBMLErrorTable.h 2019-09-26 21:41:51 UTC (rev 26132) @@ -194,10 +194,9 @@ "Elements allowed on <parameter>.", LIBSBML_CAT_GENERAL_CONSISTENCY, LIBSBML_SEV_ERROR, - "A <parameter> object may contain one and only one instance of each of the " - "<spatialSymbolReference,> <advectionCoefficient,> <boundaryCondition> and " - "<diffusionCoefficient> elements. No other elements from the SBML Level 3 " - "Spatial Processes namespaces are permitted on a <parameter> object. ", + "A <parameter> object may contain up to one child element from the SBML " + "Level 3 Spatial Processes namespace: a <spatialSymbolReference>, an " + "<advectionCoefficient>, a <boundaryCondition>, or a <diffusionCoefficient>.", { "L3V1 Spatial V1 Section" } }, Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -64,17 +64,6 @@ <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_2" spatial:unitSize="0"/> </compartment> </listOfCompartments> - <listOfSpecies> - <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> - </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -63,17 +63,6 @@ <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> </compartment> </listOfCompartments> - <listOfSpecies> - <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> - </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -69,9 +69,6 @@ <listOfParameters> <parameter constant="false" id="id_3"> <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -68,10 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -68,10 +68,7 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> </parameter> </listOfParameters> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -68,9 +68,6 @@ </listOfSpecies> <listOfParameters> <parameter constant="false" id="id_3"> - <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> </parameter> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -69,9 +69,6 @@ <listOfParameters> <parameter constant="false" id="id_3"> <spatial:spatialSymbolReference spatial:spatialRef="geometry_1"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> - <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> </parameter> </listOfParameters> </model> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-02.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-03.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:boundaryCondition spatial:boundaryDomainType="domainType_1" spatial:coordinateBoundary="boundary_2" spatial:type="Robin_valueCoefficient" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-04.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianY" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_3" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_4" spatial:value="1"/> + </spatial:coordinateComponent> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianZ" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_5" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_6" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="3"/> + </spatial:listOfDomainTypes> + <spatial:listOfDomains> + <spatial:domain spatial:domainType="domainType_1" spatial:id="domain_1"> + <spatial:listOfInteriorPoints> + <spatial:interiorPoint spatial:coord1="0" spatial:coord2="0" spatial:coord3="0"/> + </spatial:listOfInteriorPoints> + </spatial:domain> + </spatial:listOfDomains> + <spatial:listOfAdjacentDomains> + <spatial:adjacentDomains spatial:domain1="domain_1" spatial:domain2="domain_1" spatial:id="adjacentDomains_1"/> + </spatial:listOfAdjacentDomains> + <spatial:listOfGeometryDefinitions> + <spatial:analyticGeometry spatial:id="geometryDefinition_1" spatial:isActive="false"> + <spatial:listOfAnalyticVolumes> + <spatial:analyticVolume spatial:domainType="domainType_1" spatial:functionType="layered" spatial:id="analyticVolume_1" spatial:ordinal="0"> + <math xmlns="http://www.w3.org/1998/Math/MathML"/> + </spatial:analyticVolume> + </spatial:listOfAnalyticVolumes> + </spatial:analyticGeometry> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> + <spatial:spatialPoints spatial:arrayDataLength="0" spatial:compression="uncompressed" spatial:dataType="double" spatial:id="spatialPoints_1"/> + <spatial:listOfParametricObjects> + <spatial:parametricObject spatial:compression="uncompressed" spatial:dataType="double" spatial:domainType="domainType_1" spatial:id="parametricObject_1" spatial:pointIndexLength="0" spatial:polygonType="triangle"/> + </spatial:listOfParametricObjects> + </spatial:parametricGeometry> + <spatial:mixedGeometry spatial:id="geometryDefinition_4" spatial:isActive="false"> + <spatial:listOfOrdinalMappings> + <spatial:ordinalMapping spatial:geometryDefinition="geometryDefinition_4" spatial:ordinal="0"/> + </spatial:listOfOrdinalMappings> + </spatial:mixedGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="0" spatial:numSamples2="0" spatial:numSamples3="0" spatial:samplesLength="3"/> + </spatial:listOfSampledFields> + </spatial:geometry> + <listOfCompartments> + <compartment constant="false" id="compartment"> + <spatial:compartmentMapping spatial:domainType="domainType_1" spatial:id="compartmentMapping_1" spatial:unitSize="0"/> + </compartment> + </listOfCompartments> + <listOfSpecies> + <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_2" spatial:isSpatial="false"/> + </listOfSpecies> + <listOfParameters> + <parameter constant="false" id="id_3"> + <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="species_1"/> + </parameter> + </listOfParameters> + </model> +</sbml> + Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-01.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-01.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-02.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-02.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-03.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-03.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-04.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-04.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-05.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-05.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-05.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-06.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-06.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-06.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-07.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-07.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-07.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-08.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-08.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-08.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-09.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-09.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-09.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-10.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-10.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-10.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-11.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-11.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-11.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition="false" compartment="compartment" constant="false" hasOnlySubstanceUnits="false" id="id_10" spatial:isSpatial="false"/> </listOfSpecies> - <listOfParameters> - <parameter constant="false" id="id_11"> - <spatial:spatialSymbolReference spatial:spatialRef="someString"/> - <spatial:advectionCoefficient spatial:coordinate="cartesianX" spatial:variable="someString"/> - <spatial:boundaryCondition spatial:boundaryDomainType="someString" spatial:coordinateBoundary="someString" spatial:type="Robin_valueCoefficient" spatial:variable="someString"/> - <spatial:diffusionCoefficient spatial:coordinateReference1="cartesianX" spatial:coordinateReference2="cartesianX" spatial:type="isotropic" spatial:variable="someString"/> - </parameter> - </listOfParameters> </model> </sbml> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-12.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-12.xml 2019-09-26 16:19:26 UTC (rev 26131) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/identifier-constraints/1210301-fail-01-12.xml 2019-09-26 21:41:51 UTC (rev 26132) @@ -33,14 +33,6 @@ <listOfSpecies> <species boundaryCondition=... [truncated message content] |
From: <luc...@us...> - 2019-09-26 16:19:33
|
Revision: 26131 http://sourceforge.net/p/sbml/code/26131 Author: luciansmith Date: 2019-09-26 16:19:26 +0000 (Thu, 26 Sep 2019) Log Message: ----------- Add positive and negative test for converting (or not converting) models with a local parameter that shadows a species reference. Modified Paths: -------------- trunk/libsbml/src/sbml/conversion/test/TestLevelVersionConverter.cpp Added Paths: ----------- trunk/libsbml/src/sbml/conversion/test/test-data/01800-fail-sbml-l3v1.xml trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v1.xml trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v2.xml Modified: trunk/libsbml/src/sbml/conversion/test/TestLevelVersionConverter.cpp =================================================================== --- trunk/libsbml/src/sbml/conversion/test/TestLevelVersionConverter.cpp 2019-09-25 20:41:03 UTC (rev 26130) +++ trunk/libsbml/src/sbml/conversion/test/TestLevelVersionConverter.cpp 2019-09-26 16:19:26 UTC (rev 26131) @@ -383,6 +383,79 @@ END_TEST +START_TEST (test_specref_ref_onlynot) +{ + SBMLNamespaces sbmlns(2, 4); + ConversionProperties prop(&sbmlns); + prop.addOption("strict", true, "should validity be preserved"); + prop.addOption("setLevelAndVersion", true, "convert the document to the given level and version"); + prop.addOption("ignorePackages", true); + + SBMLLevelVersionConverter * converter = new SBMLLevelVersionConverter(); + converter->setProperties(&prop); + + string filename(TestDataDirectory); + filename += "01800-sbml-l3v2.xml"; + + SBMLDocument* d = readSBMLFromFile(filename.c_str()); + + // convert to L2V4 + converter->setDocument(d); + fail_unless(converter->convert() == LIBSBML_OPERATION_SUCCESS); + + delete d; + delete converter; + + SBMLNamespaces sbmlns2(2, 5); + ConversionProperties prop2(&sbmlns2); + prop.addOption("strict", true, "should validity be preserved"); + prop.addOption("setLevelAndVersion", true, "convert the document to the given level and version"); + prop.addOption("ignorePackages", true); + + converter = new SBMLLevelVersionConverter(); + converter->setProperties(&prop2); + + filename = TestDataDirectory; + filename += "01800-sbml-l3v1.xml"; + + d = readSBMLFromFile(filename.c_str()); + + // convert to L2V5 + converter->setDocument(d); + fail_unless(converter->convert() == LIBSBML_OPERATION_SUCCESS); + + delete d; + delete converter; +} +END_TEST + + +START_TEST (test_specref_ref_real) +{ + SBMLNamespaces sbmlns(2, 4); + ConversionProperties prop(&sbmlns); + prop.addOption("strict", true, "should validity be preserved"); + prop.addOption("setLevelAndVersion", true, "convert the document to the given level and version"); + prop.addOption("ignorePackages", true); + + SBMLLevelVersionConverter * converter = new SBMLLevelVersionConverter(); + converter->setProperties(&prop); + + string filename(TestDataDirectory); + filename += "01800-fail-sbml-l3v1.xml"; + + SBMLDocument* d = readSBMLFromFile(filename.c_str()); + + // convert to L2V4 + converter->setDocument(d); + fail_unless(converter->convert() == LIBSBML_OPERATION_FAILED); + + delete d; + delete converter; +} +END_TEST + + Suite * create_suite_TestLevelVersionConverter (void) { @@ -401,6 +474,8 @@ tcase_add_test(tcase, test_compartment_size); tcase_add_test(tcase, test_lv_rxn_variables); + tcase_add_test(tcase, test_specref_ref_onlynot); + tcase_add_test(tcase, test_specref_ref_real); suite_add_tcase(suite, tcase); Added: trunk/libsbml/src/sbml/conversion/test/test-data/01800-fail-sbml-l3v1.xml =================================================================== --- trunk/libsbml/src/sbml/conversion/test/test-data/01800-fail-sbml-l3v1.xml (rev 0) +++ trunk/libsbml/src/sbml/conversion/test/test-data/01800-fail-sbml-l3v1.xml 2019-09-26 16:19:26 UTC (rev 26131) @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model id="case01800" name="case01800"> + <listOfCompartments> + <compartment id="C" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="S1" compartment="C" initialAmount="2" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfReactions> + <reaction id="J1" reversible="true" fast="false"> + <listOfProducts> + <speciesReference id="S1_stoich" species="S1" stoichiometry="1" constant="true"/> + <speciesReference id="S1_stoich2" species="S1" stoichiometry="1" constant="true"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <ci> S1_stoich </ci> + <ci> S1_stoich2 </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="S1_stoich" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v1.xml =================================================================== --- trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v1.xml (rev 0) +++ trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v1.xml 2019-09-26 16:19:26 UTC (rev 26131) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model id="case01800" name="case01800"> + <listOfCompartments> + <compartment id="C" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="S1" compartment="C" initialAmount="2" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfReactions> + <reaction id="J1" reversible="true" fast="false"> + <listOfProducts> + <speciesReference id="S1_stoich" species="S1" stoichiometry="1" constant="true"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <ci> S1_stoich </ci> + <cn type="integer"> 2 </cn> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="S1_stoich" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v2.xml =================================================================== --- trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v2.xml (rev 0) +++ trunk/libsbml/src/sbml/conversion/test/test-data/01800-sbml-l3v2.xml 2019-09-26 16:19:26 UTC (rev 26131) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="case01800" name="case01800"> + <listOfCompartments> + <compartment id="C" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="S1" compartment="C" initialAmount="2" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfReactions> + <reaction id="J1" reversible="true"> + <listOfProducts> + <speciesReference id="S1_stoich" species="S1" stoichiometry="1" constant="true"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <ci> S1_stoich </ci> + <cn type="integer"> 2 </cn> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="S1_stoich" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> |
From: <luc...@us...> - 2019-09-25 20:41:05
|
Revision: 26130 http://sourceforge.net/p/sbml/code/26130 Author: luciansmith Date: 2019-09-25 20:41:03 +0000 (Wed, 25 Sep 2019) Log Message: ----------- Fix: local parameters with the ID of a species reference in an L3 model were not being converted to L2 because it seemed like there was an invalid reference to a species reference (which was not allowed in L2). Modified Paths: -------------- trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp Modified: trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp =================================================================== --- trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-09-25 20:04:33 UTC (rev 26129) +++ trunk/libsbml/src/sbml/conversion/SBMLLevelVersionConverter.cpp 2019-09-25 20:41:03 UTC (rev 26130) @@ -1263,11 +1263,21 @@ unsigned int i = 0; while (!used && i < mMathElements->getSize()) { - const ASTNode* ast = static_cast<SBase*>(mMathElements->get(i))->getMath(); + SBase* element = static_cast<SBase*>(mMathElements->get(i)); + const ASTNode* ast = element->getMath(); + KineticLaw* kl = NULL; + if (element->getTypeCode() == SBML_KINETIC_LAW) { + kl = static_cast<KineticLaw*>(element); + } if (ast != NULL) { for (unsigned int j = 0; j < mSRIds->size(); j++) { - used = containsId(ast, mSRIds->at(j)); + string id = mSRIds->at(j); + if (kl != NULL && kl->getParameter(id) != NULL) + { + continue; + } + used = containsId(ast, id); if (used) break; } } |
From: <luc...@us...> - 2019-09-25 20:04:34
|
Revision: 26129 http://sourceforge.net/p/sbml/code/26129 Author: luciansmith Date: 2019-09-25 20:04:33 +0000 (Wed, 25 Sep 2019) Log Message: ----------- Fix so that L2 models are also OK: they have 'Parameter' children, not 'LocalParameter' children. (Technically, since there is no 'RateOf' in L2, the RateOfCycles didn't need to be changed, but changed it anyway to be more consistent. Modified Paths: -------------- trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp Added Paths: ----------- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-23.xml Modified: trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp =================================================================== --- trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp 2019-09-25 18:47:32 UTC (rev 26128) +++ trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp 2019-09-25 20:04:33 UTC (rev 26129) @@ -180,9 +180,9 @@ { ASTNode* node = static_cast<ASTNode*>( variables->get(ns) ); string name = node->getName() ? node->getName() : ""; - if (kl->getLocalParameter(name) != NULL) + if (kl->getParameter(name) != NULL) { - continue; + continue; } if (m.getReaction(name)) Modified: trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp =================================================================== --- trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp 2019-09-25 18:47:32 UTC (rev 26128) +++ trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp 2019-09-25 20:04:33 UTC (rev 26129) @@ -154,7 +154,7 @@ { ASTNode * child = node->getChild(0); string name = child->getName() ? child->getName() : ""; - if (kl->getLocalParameter(name) != NULL) + if (kl->getParameter(name) != NULL) { continue; } @@ -180,7 +180,7 @@ { ASTNode* node = static_cast<ASTNode*>( variables->get(ns) ); string name = node->getName() ? node->getName() : ""; - if (kl->getLocalParameter(name) != NULL) + if (kl->getParameter(name) != NULL) { continue; } Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-23.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-23.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-23.xml 2019-09-25 20:04:33 UTC (rev 26129) @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 on 2019-09-25 12:54 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level2/version5" level="2" version="5"> + <model id="case01799" name="case01799"> + <listOfCompartments> + <compartment id="C" size="2"/> + </listOfCompartments> + <listOfSpecies> + <species id="S1" compartment="C" initialAmount="2" hasOnlySubstanceUnits="true"/> + </listOfSpecies> + <listOfReactions> + <reaction id="J1"> + <listOfProducts> + <speciesReference species="S1"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <ci> J1 </ci> + <cn type="integer"> 2 </cn> + </apply> + </math> + <listOfParameters> + <parameter id="J1" value="0.1"/> + </listOfParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> |
From: <luc...@us...> - 2019-09-25 18:47:33
|
Revision: 26128 http://sourceforge.net/p/sbml/code/26128 Author: luciansmith Date: 2019-09-25 18:47:32 +0000 (Wed, 25 Sep 2019) Log Message: ----------- Allow access to 'explicitly set' attribute flags (but don't put them in the docs). Also go ahead and keep track of whether something was explicitly set or not, even in L3. Modified Paths: -------------- trunk/libsbml/src/sbml/Compartment.cpp trunk/libsbml/src/sbml/Compartment.h trunk/libsbml/src/sbml/Event.cpp trunk/libsbml/src/sbml/Event.h trunk/libsbml/src/sbml/Parameter.cpp trunk/libsbml/src/sbml/Parameter.h trunk/libsbml/src/sbml/Species.cpp trunk/libsbml/src/sbml/Species.h Modified: trunk/libsbml/src/sbml/Compartment.cpp =================================================================== --- trunk/libsbml/src/sbml/Compartment.cpp 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Compartment.cpp 2019-09-25 18:47:32 UTC (rev 26128) @@ -1450,8 +1450,21 @@ /** @endcond */ +/** @cond doxygenLibsbmlInternal */ +bool Compartment::isExplicitlySetSpatialDimensions() const +{ + return mExplicitlySetSpatialDimensions; +} +/** @endcond */ +/** @cond doxygenLibsbmlInternal */ +bool Compartment::isExplicitlySetConstant() const +{ + return mExplicitlySetConstant; +} +/** @endcond */ + /** @cond doxygenLibsbmlInternal */ /** * Subclasses should override this method to get the list of @@ -1770,6 +1783,7 @@ // mIsSetConstant = attributes.readInto("constant", mConstant, getErrorLog(), false, getLine(), getColumn()); + mExplicitlySetConstant = mIsSetConstant; if (!mIsSetConstant) { logError(AllowedAttributesOnCompartment, level, version, Modified: trunk/libsbml/src/sbml/Compartment.h =================================================================== --- trunk/libsbml/src/sbml/Compartment.h 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Compartment.h 2019-09-25 18:47:32 UTC (rev 26128) @@ -1594,8 +1594,14 @@ /** @endcond */ + /** @cond doxygenLibsbmlInternal */ + bool isExplicitlySetSpatialDimensions() const; + bool isExplicitlySetConstant() const; + /** @endcond */ + + #endif /* !SWIG */ @@ -1633,12 +1639,7 @@ */ virtual void writeAttributes (XMLOutputStream& stream) const; - bool isExplicitlySetSpatialDimensions() const { - return mExplicitlySetSpatialDimensions; }; - bool isExplicitlySetConstant() const { return mExplicitlySetConstant; } ; - - //std::string mId; //std::string mName; std::string mCompartmentType; Modified: trunk/libsbml/src/sbml/Event.cpp =================================================================== --- trunk/libsbml/src/sbml/Event.cpp 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Event.cpp 2019-09-25 18:47:32 UTC (rev 26128) @@ -1853,6 +1853,12 @@ /** @endcond */ +/** @cond doxygenLibsbmlInternal */ +bool Event::isExplicitlySetUVFTT() const +{ + return mExplicitlySetUVFTT; +} +/** @endcond */ /** @cond doxygenLibsbmlInternal */ @@ -2039,6 +2045,7 @@ mIsSetUseValuesFromTriggerTime = attributes.readInto( "useValuesFromTriggerTime", mUseValuesFromTriggerTime, getErrorLog(),false, getLine(), getColumn()); + mExplicitlySetUVFTT = mIsSetUseValuesFromTriggerTime; if (!mIsSetUseValuesFromTriggerTime) { Modified: trunk/libsbml/src/sbml/Event.h =================================================================== --- trunk/libsbml/src/sbml/Event.h 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Event.h 2019-09-25 18:47:32 UTC (rev 26128) @@ -1466,9 +1466,13 @@ /** @endcond */ + /** @cond doxygenLibsbmlInternal */ + bool isExplicitlySetUVFTT() const; + /** @endcond */ + #endif /* !SWIG */ @@ -1514,9 +1518,7 @@ */ virtual void writeAttributes (XMLOutputStream& stream) const; - bool isExplicitlySetUVFTT() const { return mExplicitlySetUVFTT; } ; - //std::string mId; //std::string mName; Trigger* mTrigger; Modified: trunk/libsbml/src/sbml/Parameter.cpp =================================================================== --- trunk/libsbml/src/sbml/Parameter.cpp 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Parameter.cpp 2019-09-25 18:47:32 UTC (rev 26128) @@ -1024,6 +1024,12 @@ /** @endcond */ +/** @cond doxygenLibsbmlInternal */ +bool Parameter::isExplicitlySetConstant() const +{ + return mExplicitlySetConstant; +} +/** @endcond */ void @@ -1326,9 +1332,10 @@ } if (this->getTypeCode() == SBML_PARAMETER) { - mIsSetConstant = attributes.readInto("constant", mConstant, + mExplicitlySetConstant = attributes.readInto("constant", mConstant, getErrorLog(), false, getLine(), getColumn()); - if (!mIsSetConstant) + mIsSetConstant = mExplicitlySetConstant; + if (!mExplicitlySetConstant) { logError(AllowedAttributesOnParameter, level, version, "The required attribute 'constant' is missing from the " Modified: trunk/libsbml/src/sbml/Parameter.h =================================================================== --- trunk/libsbml/src/sbml/Parameter.h 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Parameter.h 2019-09-25 18:47:32 UTC (rev 26128) @@ -988,8 +988,12 @@ /** @endcond */ + /** @cond doxygenLibsbmlInternal */ + bool isExplicitlySetConstant() const; + /** @endcond */ + #endif /* !SWIG */ @@ -1027,9 +1031,6 @@ */ virtual void writeAttributes (XMLOutputStream& stream) const; - bool isExplicitlySetConstant() const - { return mExplicitlySetConstant; } ; - //std::string mId; //std::string mName; double mValue; Modified: trunk/libsbml/src/sbml/Species.cpp =================================================================== --- trunk/libsbml/src/sbml/Species.cpp 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Species.cpp 2019-09-25 18:47:32 UTC (rev 26128) @@ -1800,11 +1800,25 @@ return value; } -/** @endcond */ +bool Species::isExplicitlySetBoundaryCondition() const +{ + return mExplicitlySetBoundaryCondition; +} +bool Species::isExplicitlySetConstant() const +{ + return mExplicitlySetConstant; +} +bool Species::isExplicitlySetHasOnlySubsUnits() const +{ + return mExplicitlySetHasOnlySubsUnits; +} + /** @endcond */ + + void Species::renameSIdRefs(const std::string& oldid, const std::string& newid) { @@ -2185,6 +2199,7 @@ mIsSetBoundaryCondition = attributes.readInto("boundaryCondition", mBoundaryCondition, getErrorLog(), false, getLine(), getColumn()); + mExplicitlySetBoundaryCondition = mIsSetBoundaryCondition; if (!mIsSetBoundaryCondition) { logError(AllowedAttributesOnSpecies, level, version, @@ -2215,6 +2230,7 @@ mIsSetHasOnlySubstanceUnits = attributes.readInto( "hasOnlySubstanceUnits", mHasOnlySubstanceUnits, getErrorLog(), false, getLine(), getColumn()); + mExplicitlySetHasOnlySubsUnits = mIsSetHasOnlySubstanceUnits; if (!mIsSetHasOnlySubstanceUnits) { logError(AllowedAttributesOnSpecies, level, version, @@ -2227,6 +2243,7 @@ // mIsSetConstant = attributes.readInto("constant", mConstant, getErrorLog(), false, getLine(), getColumn()); + mExplicitlySetConstant = mIsSetConstant; if (!mIsSetConstant) { logError(AllowedAttributesOnSpecies, level, version, Modified: trunk/libsbml/src/sbml/Species.h =================================================================== --- trunk/libsbml/src/sbml/Species.h 2019-09-25 18:12:04 UTC (rev 26127) +++ trunk/libsbml/src/sbml/Species.h 2019-09-25 18:47:32 UTC (rev 26128) @@ -1619,9 +1619,17 @@ /** @endcond */ + /** @cond doxygenLibsbmlInternal */ + bool isExplicitlySetBoundaryCondition() const; + bool isExplicitlySetConstant() const; + bool isExplicitlySetHasOnlySubsUnits() const; + /** @endcond */ + + + #endif /* !SWIG */ @@ -1658,15 +1666,6 @@ */ virtual void writeAttributes (XMLOutputStream& stream) const; - bool isExplicitlySetBoundaryCondition() const - { return mExplicitlySetBoundaryCondition; } ; - - bool isExplicitlySetConstant() const - { return mExplicitlySetConstant; } ; - - bool isExplicitlySetHasOnlySubsUnits() const - { return mExplicitlySetHasOnlySubsUnits; } ; - //std::string mId; //std::string mName; std::string mSpeciesType; |
From: <luc...@us...> - 2019-09-25 18:12:06
|
Revision: 26127 http://sourceforge.net/p/sbml/code/26127 Author: luciansmith Date: 2019-09-25 18:12:04 +0000 (Wed, 25 Sep 2019) Log Message: ----------- Local parameters should not contribute to reference cycles, either in assignment nor in rates. Modified Paths: -------------- trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp Added Paths: ----------- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-22.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-07.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-08.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-09.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-10.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-11.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-12.xml Modified: trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp =================================================================== --- trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp 2019-09-18 13:31:12 UTC (rev 26126) +++ trunk/libsbml/src/sbml/validator/constraints/AssignmentCycles.cpp 2019-09-25 18:12:04 UTC (rev 26127) @@ -175,10 +175,15 @@ */ List* variables = object.getKineticLaw()->getMath() ->getListOfNodes( ASTNode_isName ); + const KineticLaw* kl = object.getKineticLaw(); for (ns = 0; ns < variables->getSize(); ns++) { ASTNode* node = static_cast<ASTNode*>( variables->get(ns) ); string name = node->getName() ? node->getName() : ""; + if (kl->getLocalParameter(name) != NULL) + { + continue; + } if (m.getReaction(name)) { Modified: trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp =================================================================== --- trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp 2019-09-18 13:31:12 UTC (rev 26126) +++ trunk/libsbml/src/sbml/validator/constraints/RateOfCycles.cpp 2019-09-25 18:12:04 UTC (rev 26127) @@ -142,6 +142,7 @@ * with the variable as key */ List* functions = object.getKineticLaw()->getMath()->getListOfNodes( ASTNode_isFunction ); + const KineticLaw* kl = object.getKineticLaw(); for (ns = 0; ns < functions->getSize(); ns++) { ASTNode* node = static_cast<ASTNode*>( functions->get(ns) ); @@ -153,7 +154,10 @@ { ASTNode * child = node->getChild(0); string name = child->getName() ? child->getName() : ""; - + if (kl->getLocalParameter(name) != NULL) + { + continue; + } if (m.getRule(name) && m.getRule(name)->isRate()) { addRnSpeciesDependencies(name, object); @@ -176,6 +180,10 @@ { ASTNode* node = static_cast<ASTNode*>( variables->get(ns) ); string name = node->getName() ? node->getName() : ""; + if (kl->getLocalParameter(name) != NULL) + { + continue; + } if (isEdgeCaseAssignment(m, name)) { addRnSpeciesDependencies(name, object); Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-22.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-22.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20906-pass-00-22.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model id="case01799" name="case01799"> + <listOfCompartments> + <compartment id="C" spatialDimensions="3" size="2" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="S1" compartment="C" initialAmount="2" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfReactions> + <reaction id="J1" reversible="true" fast="false"> + <listOfProducts> + <speciesReference species="S1" stoichiometry="1" constant="true"/> + </listOfProducts> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <times/> + <ci> J1 </ci> + <cn type="integer"> 2 </cn> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="J1" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-07.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-07.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-07.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,44 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment id="c" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + <species id="s1" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="k2" constant="false"/> + <parameter id="k1" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="k2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s </ci> + </apply> + </math> + </rateRule> + </listOfRules> + <listOfReactions> + <reaction id="r" reversible="true"> + <listOfReactants> + <speciesReference species="s" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> k2 </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="k2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-08.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-08.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-08.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.9.0 with libSBML version 5.13.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment id="c" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="k2" constant="false"/> + </listOfParameters> + <listOfInitialAssignments> + <initialAssignment symbol="k2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s </ci> + </apply> + </math> + </initialAssignment> + </listOfInitialAssignments> + <listOfReactions> + <reaction id="r" reversible="true"> + <listOfReactants> + <speciesReference species="s" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <ci> k2 </ci> + </math> + <listOfLocalParameters> + <localParameter id="k2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-09.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-09.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-09.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment id="c" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="k2" constant="false"/> + </listOfParameters> + <listOfRules> + <assignmentRule variable="k2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s </ci> + </apply> + </math> + </assignmentRule> + </listOfRules> + <listOfReactions> + <reaction id="r" reversible="true"> + <listOfReactants> + <speciesReference species="s" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <ci> k2 </ci> + </math> + <listOfLocalParameters> + <localParameter id="k2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-10.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-10.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-10.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment id="c" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s" compartment="c" initialConcentration="0" hasOnlySubstanceUnits="true" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="k2" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="k2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s </ci> + </apply> + </math> + </rateRule> + </listOfRules> + <listOfReactions> + <reaction id="r" reversible="true"> + <listOfReactants> + <speciesReference species="s" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> k2 </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="k2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-11.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-11.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-11.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment sboTerm="SBO:0000410" id="default_compartment" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s" compartment="default_compartment" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="p1" constant="false"/> + <parameter id="p2" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="p1"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s </ci> + </apply> + </math> + </rateRule> + <rateRule variable="p2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> p1 </ci> + </apply> + </math> + </rateRule> + </listOfRules> + <listOfReactions> + <reaction id="J0" reversible="true"> + <listOfReactants> + <speciesReference species="s" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> p2 </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="p2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-12.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-12.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-general-consistency-constraints/20912-pass-00-12.xml 2019-09-25 18:12:04 UTC (rev 26127) @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.8.0 on 2016-06-27 11:48 with libSBML version 5.11.9. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model id="doc0" name="doc0"> + <listOfCompartments> + <compartment sboTerm="SBO:0000410" id="default_compartment" spatialDimensions="3" size="1" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="s2" compartment="default_compartment" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> + <species id="s1" compartment="default_compartment" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"/> + </listOfSpecies> + <listOfParameters> + <parameter id="p1" constant="false"/> + <parameter id="p2" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="p1"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s2 </ci> + </apply> + </math> + </rateRule> + <rateRule variable="p2"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> s1 </ci> + </apply> + </math> + </rateRule> + </listOfRules> + <listOfReactions> + <reaction id="J0" reversible="true"> + <listOfReactants> + <speciesReference species="s1" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> p1 </ci> + </apply> + </math> + </kineticLaw> + </reaction> + <reaction id="J1" reversible="true"> + <listOfReactants> + <speciesReference species="s2" stoichiometry="1" constant="true"/> + </listOfReactants> + <kineticLaw> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/rateOf"> rateOf </csymbol> + <ci> p2 </ci> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="p2" value="0.1"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> |
From: <sar...@us...> - 2019-09-18 13:31:14
|
Revision: 26126 http://sourceforge.net/p/sbml/code/26126 Author: sarahkeating Date: 2019-09-18 13:31:12 +0000 (Wed, 18 Sep 2019) Log Message: ----------- found the typo Lucian left in to see whether I really did look at the code :-) Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-09-10 17:43:45 UTC (rev 26125) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/SpatialValidator.cpp 2019-09-18 13:31:12 UTC (rev 26126) @@ -743,7 +743,7 @@ visit(const Reaction& x) { v.mSpatialConstraints->mReaction.applyTo(m, x); - return !v.mSpatialConstraints->mSpatialPoints.empty(); + return !v.mSpatialConstraints->mReaction.empty(); } |
From: <luc...@us...> - 2019-09-10 17:43:48
|
Revision: 26125 http://sourceforge.net/p/sbml/code/26125 Author: luciansmith Date: 2019-09-10 17:43:45 +0000 (Tue, 10 Sep 2019) Log Message: ----------- Add tests of 10217 for rate rules, event assignments, and event delays. (Legal in l3v2; added there in 'pass' form.) Added Paths: ----------- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-07.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-08.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-10.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-20.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-21.xml trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-22.xml Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-07.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-07.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-07.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" constant="false"/> + </listOfParameters> + <listOfEvents> + <event id="_E0" useValuesFromTriggerTime="true"> + <trigger initialValue="true" persistent="true"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <gt/> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol> + <cn type="integer"> 1 </cn> + </apply> + </math> + </trigger> + <delay> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </delay> + <listOfEventAssignments> + <eventAssignment variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <cn type="integer"> 3 </cn> + </math> + </eventAssignment> + </listOfEventAssignments> + </event> + </listOfEvents> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-08.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-08.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-08.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" constant="false"/> + </listOfParameters> + <listOfEvents> + <event id="E0" useValuesFromTriggerTime="true"> + <trigger initialValue="true" persistent="true"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <gt/> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol> + <cn type="integer"> 1 </cn> + </apply> + </math> + </trigger> + <listOfEventAssignments> + <eventAssignment variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </eventAssignment> + </listOfEventAssignments> + </event> + </listOfEvents> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-10.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-10.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-fail-01-10.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version1/core" level="3" version="1"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </rateRule> + </listOfRules> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-20.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-20.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-20.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" constant="false"/> + </listOfParameters> + <listOfEvents> + <event id="_E0" useValuesFromTriggerTime="true"> + <trigger initialValue="true" persistent="true"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <gt/> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol> + <cn type="integer"> 1 </cn> + </apply> + </math> + </trigger> + <delay> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </delay> + <listOfEventAssignments> + <eventAssignment variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <cn type="integer"> 3 </cn> + </math> + </eventAssignment> + </listOfEventAssignments> + </event> + </listOfEvents> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-21.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-21.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-21.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" constant="false"/> + </listOfParameters> + <listOfEvents> + <event id="E0" useValuesFromTriggerTime="true"> + <trigger initialValue="true" persistent="true"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <gt/> + <csymbol encoding="text" definitionURL="http://www.sbml.org/sbml/symbols/time"> time </csymbol> + <cn type="integer"> 1 </cn> + </apply> + </math> + </trigger> + <listOfEventAssignments> + <eventAssignment variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </eventAssignment> + </listOfEventAssignments> + </event> + </listOfEvents> + </model> +</sbml> Added: trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-22.xml =================================================================== --- trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-22.xml (rev 0) +++ trunk/libsbml/src/sbml/validator/test/test-data/sbml-mathml-constraints/10217-pass-00-22.xml 2019-09-10 17:43:45 UTC (rev 26125) @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Created by libAntimony version v2.12.0 with libSBML version 5.18.1. --> +<sbml xmlns="http://www.sbml.org/sbml/level3/version2/core" level="3" version="2"> + <model metaid="__main" id="__main"> + <listOfParameters> + <parameter id="x" value="1" constant="false"/> + </listOfParameters> + <listOfRules> + <rateRule variable="x"> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <true/> + </math> + </rateRule> + </listOfRules> + </model> +</sbml> |
From: <luc...@us...> - 2019-08-30 00:04:37
|
Revision: 26124 http://sourceforge.net/p/sbml/code/26124 Author: luciansmith Date: 2019-08-30 00:04:23 +0000 (Fri, 30 Aug 2019) Log Message: ----------- Add validation rule spatial-21754. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:59:10 UTC (rev 26123) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-30 00:04:23 UTC (rev 26124) @@ -623,5 +623,26 @@ END_CONSTRAINT +// 1221754 +START_CONSTRAINT(SpatialSampledVolumeMinMaxOrSampledValue, SampledVolume, svol) +{ + bool fail = false; + if (!svol.isSetMaxValue() && !svol.isSetMinValue() && !svol.isSetSampledValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " does not define a sampledValue, nor does it define a minValue and a maxValue."; + msg = ss_msg.str(); + } + + inv(fail == false); +} +END_CONSTRAINT + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:59:10 UTC (rev 26123) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-30 00:04:23 UTC (rev 26124) @@ -56,6 +56,7 @@ addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoSampledValueWithMinMax(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoMinMaxWithSampledValue(*this)); +addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeMinMaxOrSampledValue(*this)); /** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-fail-01-01.xml 2019-08-30 00:04:23 UTC (rev 26124) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221754-pass-00-01.xml 2019-08-30 00:04:23 UTC (rev 26124) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> |
From: <luc...@us...> - 2019-08-29 23:59:14
|
Revision: 26123 http://sourceforge.net/p/sbml/code/26123 Author: luciansmith Date: 2019-08-29 23:59:10 +0000 (Thu, 29 Aug 2019) Log Message: ----------- Add validation rule spatial-21753, and rename some other tests, since this one actually tests it. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml Removed Paths: ------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:49:04 UTC (rev 26122) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:59:10 UTC (rev 26123) @@ -527,7 +527,7 @@ START_CONSTRAINT(SpatialSampledVolumeNeedsMaxWithMin, SampledVolume, svol) { bool fail = false; - if (svol.isSetMinValue() && !svol.isSetMaxValue()) { + if (svol.isSetMinValue() && !svol.isSetMaxValue() && !svol.isSetSampledValue()) { fail = true; stringstream ss_msg; ss_msg << "A SampledVolume"; @@ -548,7 +548,7 @@ START_CONSTRAINT(SpatialSampledVolumeNeedsMinWithMax, SampledVolume, svol) { bool fail = false; - if (svol.isSetMaxValue() && !svol.isSetMinValue()) { + if (svol.isSetMaxValue() && !svol.isSetMinValue() && !svol.isSetSampledValue()) { fail = true; stringstream ss_msg; ss_msg << "A SampledVolume"; @@ -565,7 +565,7 @@ END_CONSTRAINT -// 1221751 +// 1221752 START_CONSTRAINT(SpatialSampledVolumeNoSampledValueWithMinMax, SampledVolume, svol) { bool fail = false; @@ -588,5 +588,40 @@ END_CONSTRAINT +// 1221753 +START_CONSTRAINT(SpatialSampledVolumeNoMinMaxWithSampledValue, SampledVolume, svol) +{ + bool fail = false; + if (svol.isSetMaxValue() && !svol.isSetMinValue() && svol.isSetSampledValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " has a sampledValue of '" << svol.getSampledValue() << "'"; + ss_msg << " but also has a maxValue of '" << svol.getMaxValue() << "'. Either use the sampledValue, or a minValue with the maxValue."; + msg = ss_msg.str(); + } + + else if (!svol.isSetMaxValue() && svol.isSetMinValue() && svol.isSetSampledValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " has a sampledValue of '" << svol.getSampledValue() << "'"; + ss_msg << " but also has a minValue of '" << svol.getMinValue() << "'. Either use the sampledValue, or a maxValue with the minValue."; + msg = ss_msg.str(); + } + + inv(fail == false); +} +END_CONSTRAINT + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:49:04 UTC (rev 26122) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:59:10 UTC (rev 26123) @@ -55,6 +55,7 @@ addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMaxWithMin(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoSampledValueWithMinMax(*this)); +addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoMinMaxWithSampledValue(*this)); /** @endcond */ Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml 2019-08-29 23:49:04 UTC (rev 26122) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml 2019-08-29 23:49:04 UTC (rev 26122) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Deleted: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> - <model> - <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> - <spatial:listOfCoordinateComponents> - <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> - <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> - <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> - </spatial:coordinateComponent> - </spatial:listOfCoordinateComponents> - <spatial:listOfDomainTypes> - <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> - </spatial:listOfDomainTypes> - <spatial:listOfGeometryDefinitions> - <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> - <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:maxValue="0.5" spatial:sampledValue="0"/> - </spatial:listOfSampledVolumes> - </spatial:sampledFieldGeometry> - </spatial:listOfGeometryDefinitions> - <spatial:listOfSampledFields> - <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> - </spatial:listOfSampledFields> - </spatial:geometry> - </model> -</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-01.xml (from rev 26122, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-01-01.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:maxValue="0.5" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml (from rev 26122, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-01.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Copied: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml (from rev 26122, branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml) =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-fail-01-02.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221753-pass-00-01.xml 2019-08-29 23:59:10 UTC (rev 26123) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> |
From: <luc...@us...> - 2019-08-29 23:49:09
|
Revision: 26122 http://sourceforge.net/p/sbml/code/26122 Author: luciansmith Date: 2019-08-29 23:49:04 +0000 (Thu, 29 Aug 2019) Log Message: ----------- Add validation rule spatial-21752, and fix all the other files that failed that test. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-03.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-pass-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221504-fail-01-01.xml Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:49:04 UTC (rev 26122) @@ -565,5 +565,28 @@ END_CONSTRAINT +// 1221751 +START_CONSTRAINT(SpatialSampledVolumeNoSampledValueWithMinMax, SampledVolume, svol) +{ + bool fail = false; + if (svol.isSetMaxValue() && svol.isSetMinValue() && svol.isSetSampledValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " has a minValue of '" << svol.getMinValue() << "'"; + ss_msg << " and a maxValue of '" << svol.getMaxValue() << "',"; + ss_msg << " but also has a sampledValue of '" << svol.getSampledValue() << "'. Either use the sampledValue, or the minValue with the maxValue."; + msg = ss_msg.str(); + } + + inv(fail == false); +} +END_CONSTRAINT + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:49:04 UTC (rev 26122) @@ -54,6 +54,7 @@ addConstraint(new VConstraintSampledFieldSpatialSampledFieldThreeSamplesIn3DGeometry(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMaxWithMin(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); +addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNoSampledValueWithMinMax(*this)); /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220301-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-02.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-03.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-fail-01-04.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1220501-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry foo="someString" spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-02.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-02.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-03.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221201-pass-00-03.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-02.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-02.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -40,7 +40,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-03.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221202-pass-00-03.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -40,7 +40,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:foo="someString" spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-02.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-02.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_1" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_2" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-03.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-03.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-fail-01-03.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221203-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221204-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -39,7 +39,7 @@ </spatial:analyticGeometry> <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> <spatial:parametricGeometry spatial:id="geometryDefinition_3" spatial:isActive="false"> Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221504-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221504-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221504-fail-01-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -14,7 +14,7 @@ <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:sampledValue="0"/> </spatial:listOfSampledVolumes> <spatial:listOfSampledVolumes> - <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_2" spatial:maxValue="0" spatial:minValue="0" spatial:sampledValue="0"/> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_2" spatial:maxValue="0" spatial:minValue="0"/> </spatial:listOfSampledVolumes> </spatial:sampledFieldGeometry> </spatial:listOfGeometryDefinitions> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-fail-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:maxValue="0.5" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221752-pass-00-01.xml 2019-08-29 23:49:04 UTC (rev 26122) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:maxValue="0.5"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> |
From: <luc...@us...> - 2019-08-29 23:11:24
|
Revision: 26121 http://sourceforge.net/p/sbml/code/26121 Author: luciansmith Date: 2019-08-29 23:11:21 +0000 (Thu, 29 Aug 2019) Log Message: ----------- Add validation rule spatial-21751. Also add another test for 21750. Modified Paths: -------------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx Added Paths: ----------- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-01.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-pass-00-01.xml Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:04:36 UTC (rev 26120) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraints.cpp 2019-08-29 23:11:21 UTC (rev 26121) @@ -544,5 +544,26 @@ END_CONSTRAINT +// 1221751 +START_CONSTRAINT(SpatialSampledVolumeNeedsMinWithMax, SampledVolume, svol) +{ + bool fail = false; + if (svol.isSetMaxValue() && !svol.isSetMinValue()) { + fail = true; + stringstream ss_msg; + ss_msg << "A SampledVolume"; + if (svol.isSetId()) + { + ss_msg << " with id '" << svol.getId() << "'"; + } + ss_msg << " has a maxValue of '" << svol.getMaxValue() << "', but does not set the minValue attribute."; + msg = ss_msg.str(); + } + + inv(fail == false); +} +END_CONSTRAINT + + /** @endcond */ Modified: branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:04:36 UTC (rev 26120) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/constraints/SpatialConsistencyConstraintsDeclared.cxx 2019-08-29 23:11:21 UTC (rev 26121) @@ -53,6 +53,7 @@ addConstraint(new VConstraintSampledFieldSpatialSampledFieldTwoSamplesIn2DGeometry(*this)); addConstraint(new VConstraintSampledFieldSpatialSampledFieldThreeSamplesIn3DGeometry(*this)); addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMaxWithMin(*this)); +addConstraint(new VConstraintSampledVolumeSpatialSampledVolumeNeedsMinWithMax(*this)); /** @endcond */ Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221750-fail-01-02.xml 2019-08-29 23:11:21 UTC (rev 26121) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-01.xml 2019-08-29 23:11:21 UTC (rev 26121) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-fail-01-02.xml 2019-08-29 23:11:21 UTC (rev 26121) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:maxValue="0.5" spatial:sampledValue="0"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> Added: branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-pass-00-01.xml =================================================================== --- branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-pass-00-01.xml (rev 0) +++ branches/libsbml-experimental/src/sbml/packages/spatial/validator/test/test-data/general-constraints/1221751-pass-00-01.xml 2019-08-29 23:11:21 UTC (rev 26121) @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml level="3" spatial:required="true" version="1" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:spatial="http://www.sbml.org/sbml/level3/version1/spatial/version1"> + <model> + <spatial:geometry spatial:coordinateSystem="cartesian" spatial:id="geometry_1"> + <spatial:listOfCoordinateComponents> + <spatial:coordinateComponent spatial:id="coordinateComponent_1" spatial:type="cartesianX" spatial:unit="dimensionless"> + <spatial:boundaryMin spatial:id="boundary_1" spatial:value="0"/> + <spatial:boundaryMax spatial:id="boundary_2" spatial:value="1"/> + </spatial:coordinateComponent> + </spatial:listOfCoordinateComponents> + <spatial:listOfDomainTypes> + <spatial:domainType spatial:id="domainType_1" spatial:spatialDimensions="1"/> + </spatial:listOfDomainTypes> + <spatial:listOfGeometryDefinitions> + <spatial:sampledFieldGeometry spatial:id="geometryDefinition_2" spatial:isActive="false" spatial:sampledField="sampledField_1"> + <spatial:listOfSampledVolumes> + <spatial:sampledVolume spatial:domainType="domainType_1" spatial:id="sampledVolume_1" spatial:minValue="0" spatial:maxValue="0.5"/> + </spatial:listOfSampledVolumes> + </spatial:sampledFieldGeometry> + </spatial:listOfGeometryDefinitions> + <spatial:listOfSampledFields> + <spatial:sampledField spatial:compression="uncompressed" spatial:dataType="double" spatial:id="sampledField_1" spatial:interpolationType="nearestNeighbor" spatial:numSamples1="3" spatial:samplesLength="3">0 0 1</spatial:sampledField> + </spatial:listOfSampledFields> + </spatial:geometry> + </model> +</sbml> |