diff --git a/copasi/MIRIAM/CConstants.cpp b/copasi/MIRIAM/CConstants.cpp index 1a32a83aba..84a0c4c6f9 100644 --- a/copasi/MIRIAM/CConstants.cpp +++ b/copasi/MIRIAM/CConstants.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -48,7 +48,7 @@ void CMIRIAMResourceObject::unescapeId(std::string & id) id.find_first_not_of("0123456789abcdefABCDEF", pos + 1) > pos + 2) { char ascii[2]; - ascii[0] = (unsigned char) strtol(id.substr(pos + 1 , 2).c_str(), NULL, 16); + ascii[0] = (unsigned char) strtol(id.substr(pos + 1, 2).c_str(), NULL, 16); ascii[1] = 0x0; id.replace(pos, 3, CCopasiXMLInterface::utf8(ascii)); } @@ -148,14 +148,15 @@ std::string CMIRIAMResourceObject::getURI() const std::string CMIRIAMResourceObject::getIdentifiersOrgURL() const { - std::string URL = mpResources->getMIRIAMResource(mResource).getIdentifiersOrgURL(); - if (URL == "http://identifiers.org/unknown") + std::string URL = mpResources->getMIRIAMResource(mResource).createIdentifiersOrgURL(mId); + + if (URL.find("http://identifiers.org/unknown") != std::string::npos) { return mId; } - return URL + "/" + mId; + return URL; } bool CMIRIAMResourceObject::setNode(CRDFNode * pNode) @@ -215,62 +216,16 @@ bool CMIRIAMResourceObject::isValid(const std::string & URI) const void CMIRIAMResourceObject::extractId(const std::string & uri) { - std::string URI; - - if (uri.length() > 8 && uri.substr(0, 8) == "https://") - URI = "http://" + uri.substr(8); - else - URI = uri; - - mId = ""; + mId = uri; // Check whether the resource is known. if (mpResources == NULL || mResource == C_INVALID_INDEX) { - mId = URI; return; } - int offset; - const std::string * pTmp = & mpResources->getMIRIAMResource(mResource).getMIRIAMURI(); - - if (URI.substr(0, pTmp->length()) == *pTmp && - URI.length() > pTmp->length()) - { - offset = (pTmp->at(pTmp->length() - 1) == '/') ? 0 : 1; - mId = URI.substr(pTmp->length() + offset); - } - - if (mId == "") - { - std::string Tmp = mpResources->getMIRIAMResource(mResource).getIdentifiersOrgURL(); - - if (URI.substr(0, Tmp.length()) == Tmp && - URI.length() > Tmp.length()) - { - offset = (Tmp[Tmp.length() - 1] == '/') ? 0 : 1; - mId = URI.substr(Tmp.length() + offset); - } - } - - if (mId == "") - { - // We need to check for deprecated URIs - const CCopasiParameterGroup * pDeprecated = &(mpResources->getMIRIAMResource(mResource)).getMIRIAMDeprecated(); - CCopasiParameterGroup::index_iterator itDeprecated = pDeprecated->beginIndex(); - CCopasiParameterGroup::index_iterator endDeprecated = pDeprecated->endIndex(); - - for (; itDeprecated != endDeprecated; ++itDeprecated) - if (URI.substr(0, (*itDeprecated)->getValue< std::string >().length()) == (*itDeprecated)->getValue< std::string >() && - URI.length() > (*itDeprecated)->getValue< std::string >().length()) - { - const std::string & uri = (*itDeprecated)->getValue< std::string >(); - offset = (uri[uri.length() - 1] == '/') ? 0 : 1; - mId = URI.substr(uri.length() + offset); - break; - } - } + mId = mpResources->getMIRIAMResource(mResource).extractId(uri); unescapeId(mId); diff --git a/copasi/MIRIAM/CMIRIAMResource.cpp b/copasi/MIRIAM/CMIRIAMResource.cpp index aba938699e..0b8405d5f9 100644 --- a/copasi/MIRIAM/CMIRIAMResource.cpp +++ b/copasi/MIRIAM/CMIRIAMResource.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -225,6 +225,7 @@ bool CMIRIAMResources::updateMIRIAMResourcesFromFile(CProcessReport * pProcessRe URI == "urn:miriam:doi" || URI == "urn:miriam:pubmed" || URI == "urn:miriam:isbn"); + pMIRIAMResource->setMIRIAMNamespaceEmbeddedInPattern(dataType.getAttrValue("namespaceEmbeddedInPattern") == "True"); pTmpCpyCMIRIAMResources->addParameter(pMIRIAMResource); @@ -326,8 +327,9 @@ void CMIRIAMResources::createURIMap() for (; it != end; ++it) { pResource = static_cast< CMIRIAMResource * >(*it); - mURI2Resource[pResource->getMIRIAMURI() + ":"] = Index; - mURI2Resource[pResource->getIdentifiersOrgURL() + "/"] = Index; + mURI2Resource[pResource->getMIRIAMURI() + ":" ] = Index; + mURI2Resource[pResource->getIdentifiersOrgURL(true) + ":" ] = Index; + mURI2Resource[pResource->getIdentifiersOrgURL(false) + "/" ] = Index; const CCopasiParameterGroup * pDeprecated = &pResource->getMIRIAMDeprecated(); CCopasiParameterGroup::index_iterator itDeprecated = pDeprecated->beginIndex(); @@ -369,20 +371,19 @@ size_t CMIRIAMResources::getMIRIAMResourceIndex(const std::string & uri) const else URI = uri; - std::map< std::string, size_t >::const_iterator it = mURI2Resource.lower_bound(URI); - std::map< std::string, size_t >::const_iterator end = mURI2Resource.upper_bound(URI); + std::pair< std::map< std::string, size_t >::const_iterator, std::map< std::string, size_t >::const_iterator > range = mURI2Resource.equal_range(URI); - if (it == mURI2Resource.begin()) + if (range.first == mURI2Resource.begin()) return index; - it--; + range.first--; - for (; it != end; ++it) + for (; range.first != range.second; ++range.first) { // Check whether the URI base of the candidate matches. - if (URI.compare(0, it->first.length(), it->first) == 0) + if (URI.compare(0, range.first->first.length(), range.first->first) == 0) { - index = it->second; + index = range.first->second; break; } } @@ -431,31 +432,40 @@ CMIRIAMResources::~CMIRIAMResources() ///////////////////////////////////////////////////////////////////////////////////// CMIRIAMResource::CMIRIAMResource(const std::string & name, - const CDataContainer * pParent) : - CCopasiParameterGroup(name, pParent), - mpDisplayName(NULL), - mpURI(NULL), - mpCitation(NULL), - mpDeprecated(NULL) -{initializeParameter();} + const CDataContainer * pParent) + : CCopasiParameterGroup(name, pParent) + , mpDisplayName(NULL) + , mpURI(NULL) + , mpCitation(NULL) + , mpDeprecated(NULL) + , mpNamespaceEmbeddedInPattern(NULL) +{ + initializeParameter(); +} CMIRIAMResource::CMIRIAMResource(const CMIRIAMResource & src, - const CDataContainer * pParent): - CCopasiParameterGroup(src, pParent), - mpDisplayName(NULL), - mpURI(NULL), - mpCitation(NULL), - mpDeprecated(NULL) -{initializeParameter();} + const CDataContainer * pParent) + : CCopasiParameterGroup(src, pParent) + , mpDisplayName(NULL) + , mpURI(NULL) + , mpCitation(NULL) + , mpDeprecated(NULL) + , mpNamespaceEmbeddedInPattern(NULL) +{ + initializeParameter(); +} CMIRIAMResource::CMIRIAMResource(const CCopasiParameterGroup & group, - const CDataContainer * pParent): - CCopasiParameterGroup(group, pParent), - mpDisplayName(NULL), - mpURI(NULL), - mpCitation(NULL), - mpDeprecated(NULL) -{initializeParameter();} + const CDataContainer * pParent) + : CCopasiParameterGroup(group, pParent) + , mpDisplayName(NULL) + , mpURI(NULL) + , mpCitation(NULL) + , mpDeprecated(NULL) + , mpNamespaceEmbeddedInPattern(NULL) +{ + initializeParameter(); +} void CMIRIAMResource::initializeParameter() { @@ -463,6 +473,7 @@ void CMIRIAMResource::initializeParameter() mpURI = assertParameter("URI", CCopasiParameter::Type::STRING, (std::string) ""); mpPattern = assertParameter("Pattern", CCopasiParameter::Type::STRING, (std::string) ""); mpCitation = assertParameter("Citation", CCopasiParameter::Type::BOOL, false); + mpNamespaceEmbeddedInPattern = assertParameter("NamespaceEmbeddedInPattern", CCopasiParameter::Type::BOOL, false); mpDeprecated = assertGroup("Deprecated"); } @@ -514,9 +525,24 @@ const std::string & CMIRIAMResource::getMIRIAMURI() const return *mpURI; } -std::string CMIRIAMResource::getIdentifiersOrgURL() const +std::string CMIRIAMResource::getIdentifiersOrgURL(const bool & compact) const +{ + if (!compact + || !*mpNamespaceEmbeddedInPattern) + return "http://identifiers.org/" + mpURI->substr(11); + + return "http://identifiers.org/" + extractNamespaceFromPattern(); +} + +std::string CMIRIAMResource::extractNamespaceFromPattern() const { - return "http://identifiers.org/" + mpURI->substr(11); + if (*mpNamespaceEmbeddedInPattern) + { + std::string::size_type start = mpPattern->find('^') + 1; + return mpPattern->substr(start, mpPattern->find(':', start) - start); + } + + return ""; } void CMIRIAMResource::setMIRIAMPattern(const std::string & pattern) @@ -539,6 +565,16 @@ const bool & CMIRIAMResource::getMIRIAMCitation() const return *mpCitation; } +void CMIRIAMResource::setMIRIAMNamespaceEmbeddedInPattern(const bool & namespaceEmbeddedInPattern) +{ + *mpNamespaceEmbeddedInPattern = namespaceEmbeddedInPattern; +} + +const bool & CMIRIAMResource::getMIRIAMNamespaceEmbeddedInPattern() const +{ + return *mpNamespaceEmbeddedInPattern; +} + void CMIRIAMResource::addDeprecatedURL(const std::string & URL) { mpDeprecated->addParameter("URL", CCopasiParameter::Type::STRING, URL); @@ -548,3 +584,80 @@ const CCopasiParameterGroup & CMIRIAMResource::getMIRIAMDeprecated() const { return *mpDeprecated; } + +std::string CMIRIAMResource::extractId(const std::string & uri) const +{ + std::string Id; + std::string URI; + + if (uri.length() > 8 && uri.substr(0, 8) == "https://") + URI = "http://" + uri.substr(8); + else + URI = uri; + + int offset; + const std::string & Tmp = getMIRIAMURI(); + + if (URI.substr(0, Tmp.length()) == Tmp && + URI.length() > Tmp.length()) + { + offset = (Tmp.at(Tmp.length() - 1) == '/') ? 0 : 1; + Id = URI.substr(Tmp.length() + offset); + } + + if (Id == "" + && *mpNamespaceEmbeddedInPattern) + { + std::string Tmp = getIdentifiersOrgURL(true); + + if (URI.substr(0, Tmp.length()) == Tmp && + URI.length() > Tmp.length()) + { + offset = (Tmp[Tmp.length() - 1] == '/') ? 0 : 1; + Id = extractNamespaceFromPattern() + ":" + URI.substr(Tmp.length() + offset); + } + } + + if (Id == "") + { + std::string Tmp = getIdentifiersOrgURL(false); + + if (URI.substr(0, Tmp.length()) == Tmp && + URI.length() > Tmp.length()) + { + offset = (Tmp[Tmp.length() - 1] == '/') ? 0 : 1; + Id = URI.substr(Tmp.length() + offset); + } + } + + if (Id == "") + { + // We need to check for deprecated URIs + const CCopasiParameterGroup * pDeprecated = &getMIRIAMDeprecated(); + CCopasiParameterGroup::index_iterator itDeprecated = pDeprecated->beginIndex(); + CCopasiParameterGroup::index_iterator endDeprecated = pDeprecated->endIndex(); + + for (; itDeprecated != endDeprecated; ++itDeprecated) + { + const std::string & Tmp = (*itDeprecated)->getValue< std::string >(); + + if (URI.substr(0, Tmp.length()) == Tmp && + URI.length() > Tmp.length()) + { + offset = (Tmp[Tmp.length() - 1] == '/') ? 0 : 1; + Id = URI.substr(Tmp.length() + offset); + break; + } + } + } + + return Id; +} + +std::string CMIRIAMResource::createIdentifiersOrgURL(const std::string id) const +{ + if (*mpNamespaceEmbeddedInPattern) + return "http://identifiers.org/" + id; + + return getIdentifiersOrgURL(false) + "/" + id; +} diff --git a/copasi/MIRIAM/CMIRIAMResource.h b/copasi/MIRIAM/CMIRIAMResource.h index ed6999d02a..1ced4221f1 100644 --- a/copasi/MIRIAM/CMIRIAMResource.h +++ b/copasi/MIRIAM/CMIRIAMResource.h @@ -1,4 +1,4 @@ -// Copyright (C) 2019 - 2021 by Pedro Mendes, Rector and Visitors of the +// Copyright (C) 2019 - 2022 by Pedro Mendes, Rector and Visitors of the // University of Virginia, University of Heidelberg, and University // of Connecticut School of Medicine. // All rights reserved. @@ -108,9 +108,17 @@ class CMIRIAMResource : public CCopasiParameterGroup /** * Retrieve the identifiers.org URL of the MIRIAM Resource. + * @param const bool & compact * @return std::string URL */ - std::string getIdentifiersOrgURL() const; + std::string getIdentifiersOrgURL(const bool & compact) const; + + /** + * Create the URL for the provided Id + * @param const std::string id + * @return std::string IdentifiersOrgURL + */ + std::string createIdentifiersOrgURL(const std::string id) const; /** * Set the Pattern of the MIRIAM Resource. @@ -136,6 +144,18 @@ class CMIRIAMResource : public CCopasiParameterGroup */ const bool & getMIRIAMCitation() const; + /** + * Set whether the namespace is embedded in the pattern. + * @param const bool & isNamespaceEmbeddedInPattern + */ + void setMIRIAMNamespaceEmbeddedInPattern(const bool & isNamespaceEmbeddedInPattern); + + /** + * Retrieve whether the resource can be used as reference. + * @return const bool & isCitation + */ + const bool & getMIRIAMNamespaceEmbeddedInPattern() const; + /** * Add a deprecated URL to the MIRIAM Resource * @param const std::string & URL @@ -148,6 +168,13 @@ class CMIRIAMResource : public CCopasiParameterGroup */ const CCopasiParameterGroup & getMIRIAMDeprecated() const; + /** + * Extract the ID from the given URI + * @param const std::string & uri + * @return std::string ID + */ + std::string extractId(const std::string & uri) const; + private: /** * Allocates all group parameters and assures that they are @@ -155,6 +182,12 @@ class CMIRIAMResource : public CCopasiParameterGroup */ void initializeParameter(); + /** + * Extract the embedded namespace from the pattern + * @return std::string namespace + */ + std::string extractNamespaceFromPattern() const; + //Attributes /** * The name used in the GUI @@ -176,6 +209,11 @@ class CMIRIAMResource : public CCopasiParameterGroup */ bool * mpCitation; + /** + * A pointer to a bool indication the the resource an be used as reference + */ + bool * mpNamespaceEmbeddedInPattern; + /** * A parameter group holding all deprecated URIs */ diff --git a/copasi/MIRIAM/MIRIAMResources.xml b/copasi/MIRIAM/MIRIAMResources.xml index d87df8732c..3e96c2bd5e 100644 --- a/copasi/MIRIAM/MIRIAMResources.xml +++ b/copasi/MIRIAM/MIRIAMResources.xml @@ -21,7 +21,7 @@ - + @@ -32,6 +32,7 @@ + @@ -44,6 +45,7 @@ + @@ -53,6 +55,7 @@ + @@ -64,6 +67,7 @@ + @@ -75,6 +79,7 @@ + @@ -88,6 +93,7 @@ + @@ -98,6 +104,7 @@ + @@ -110,6 +117,7 @@ + @@ -119,6 +127,7 @@ + @@ -128,6 +137,7 @@ + @@ -139,6 +149,7 @@ + @@ -148,6 +159,7 @@ + @@ -157,6 +169,7 @@ + @@ -166,6 +179,7 @@ + @@ -178,6 +192,7 @@ + @@ -190,6 +205,7 @@ + @@ -199,6 +215,7 @@ + @@ -208,15 +225,17 @@ + - + + @@ -226,6 +245,7 @@ + @@ -235,6 +255,7 @@ + @@ -248,6 +269,7 @@ + @@ -258,6 +280,7 @@ + @@ -270,6 +293,7 @@ + @@ -279,6 +303,7 @@ + @@ -288,6 +313,7 @@ + @@ -300,6 +326,7 @@ + @@ -309,6 +336,7 @@ + @@ -318,6 +346,7 @@ + @@ -328,6 +357,7 @@ + @@ -337,6 +367,7 @@ + @@ -346,6 +377,7 @@ + @@ -355,6 +387,7 @@ + @@ -364,6 +397,7 @@ + @@ -374,6 +408,7 @@ + @@ -383,6 +418,7 @@ + @@ -395,6 +431,7 @@ + @@ -404,6 +441,7 @@ + @@ -412,6 +450,7 @@ + @@ -420,6 +459,7 @@ + @@ -428,6 +468,7 @@ + @@ -436,6 +477,7 @@ + @@ -444,14 +486,16 @@ + - + + @@ -460,6 +504,7 @@ + @@ -468,6 +513,7 @@ + @@ -476,6 +522,7 @@ + @@ -484,6 +531,7 @@ + @@ -492,6 +540,7 @@ + @@ -500,6 +549,7 @@ + @@ -509,6 +559,7 @@ + @@ -517,6 +568,7 @@ + @@ -525,6 +577,7 @@ + @@ -533,16 +586,18 @@ + - + + @@ -554,6 +609,7 @@ + @@ -562,6 +618,7 @@ + @@ -570,6 +627,7 @@ + @@ -578,15 +636,17 @@ + - + + @@ -596,6 +656,7 @@ + @@ -604,6 +665,7 @@ + @@ -612,6 +674,7 @@ + @@ -620,6 +683,7 @@ + @@ -628,6 +692,7 @@ + @@ -636,6 +701,7 @@ + @@ -646,6 +712,7 @@ + @@ -654,6 +721,7 @@ + @@ -665,6 +733,7 @@ + @@ -674,6 +743,7 @@ + @@ -682,6 +752,7 @@ + @@ -690,6 +761,7 @@ + @@ -698,6 +770,7 @@ + @@ -706,6 +779,7 @@ + @@ -714,6 +788,7 @@ + @@ -722,6 +797,7 @@ + @@ -730,6 +806,7 @@ + @@ -738,6 +815,7 @@ + @@ -746,6 +824,7 @@ + @@ -755,6 +834,7 @@ + @@ -765,6 +845,7 @@ + @@ -773,6 +854,7 @@ + @@ -781,6 +863,7 @@ + @@ -790,6 +873,7 @@ + @@ -798,6 +882,7 @@ + @@ -806,6 +891,7 @@ + @@ -814,6 +900,7 @@ + @@ -822,6 +909,7 @@ + @@ -830,6 +918,7 @@ + @@ -838,6 +927,7 @@ + @@ -846,6 +936,7 @@ + @@ -854,6 +945,7 @@ + @@ -862,6 +954,7 @@ + @@ -870,6 +963,7 @@ + @@ -878,6 +972,7 @@ + @@ -886,6 +981,7 @@ + @@ -894,6 +990,7 @@ + @@ -902,6 +999,7 @@ + @@ -910,6 +1008,7 @@ + @@ -918,6 +1017,7 @@ + @@ -926,6 +1026,7 @@ + @@ -935,6 +1036,7 @@ + @@ -943,6 +1045,7 @@ + @@ -951,6 +1054,7 @@ + @@ -960,6 +1064,7 @@ + @@ -968,6 +1073,7 @@ + @@ -977,6 +1083,7 @@ + @@ -985,6 +1092,7 @@ + @@ -995,6 +1103,7 @@ + @@ -1006,6 +1115,7 @@ + @@ -1017,6 +1127,7 @@ + @@ -1029,6 +1140,7 @@ + @@ -1037,6 +1149,7 @@ + @@ -1045,6 +1158,7 @@ + @@ -1053,6 +1167,7 @@ + @@ -1061,6 +1176,7 @@ + @@ -1069,6 +1185,7 @@ + @@ -1077,6 +1194,7 @@ + @@ -1085,6 +1203,7 @@ + @@ -1095,6 +1214,7 @@ + @@ -1103,6 +1223,7 @@ + @@ -1111,6 +1232,7 @@ + @@ -1119,6 +1241,7 @@ + @@ -1127,6 +1250,7 @@ + @@ -1135,6 +1259,7 @@ + @@ -1143,6 +1268,7 @@ + @@ -1153,6 +1279,7 @@ + @@ -1161,6 +1288,7 @@ + @@ -1169,6 +1297,7 @@ + @@ -1177,6 +1306,7 @@ + @@ -1185,6 +1315,7 @@ + @@ -1193,6 +1324,7 @@ + @@ -1201,6 +1333,7 @@ + @@ -1209,6 +1342,7 @@ + @@ -1217,6 +1351,7 @@ + @@ -1230,6 +1365,7 @@ + @@ -1239,6 +1375,7 @@ + @@ -1247,6 +1384,7 @@ + @@ -1255,6 +1393,7 @@ + @@ -1263,16 +1402,18 @@ + - + + @@ -1281,6 +1422,7 @@ + @@ -1289,6 +1431,7 @@ + @@ -1297,6 +1440,7 @@ + @@ -1305,6 +1449,7 @@ + @@ -1313,6 +1458,7 @@ + @@ -1321,6 +1467,7 @@ + @@ -1329,6 +1476,7 @@ + @@ -1337,6 +1485,7 @@ + @@ -1345,6 +1494,7 @@ + @@ -1353,6 +1503,7 @@ + @@ -1361,6 +1512,7 @@ + @@ -1369,6 +1521,7 @@ + @@ -1377,6 +1530,7 @@ + @@ -1385,6 +1539,7 @@ + @@ -1393,6 +1548,7 @@ + @@ -1401,6 +1557,7 @@ + @@ -1409,6 +1566,7 @@ + @@ -1417,6 +1575,7 @@ + @@ -1425,6 +1584,7 @@ + @@ -1433,6 +1593,7 @@ + @@ -1441,6 +1602,7 @@ + @@ -1449,6 +1611,7 @@ + @@ -1457,6 +1620,7 @@ + @@ -1465,6 +1629,7 @@ + @@ -1473,6 +1638,7 @@ + @@ -1481,6 +1647,7 @@ + @@ -1489,6 +1656,7 @@ + @@ -1497,6 +1665,7 @@ + @@ -1505,6 +1674,7 @@ + @@ -1513,6 +1683,7 @@ + @@ -1521,6 +1692,7 @@ + @@ -1529,6 +1701,7 @@ + @@ -1537,6 +1710,7 @@ + @@ -1545,6 +1719,7 @@ + @@ -1553,6 +1728,7 @@ + @@ -1561,6 +1737,7 @@ + @@ -1569,6 +1746,7 @@ + @@ -1577,6 +1755,7 @@ + @@ -1585,6 +1764,7 @@ + @@ -1593,22 +1773,25 @@ + - + + - + + @@ -1617,6 +1800,7 @@ + @@ -1625,6 +1809,7 @@ + @@ -1633,6 +1818,7 @@ + @@ -1641,6 +1827,7 @@ + @@ -1649,6 +1836,7 @@ + @@ -1658,6 +1846,7 @@ + @@ -1666,6 +1855,7 @@ + @@ -1674,6 +1864,7 @@ + @@ -1682,6 +1873,7 @@ + @@ -1690,14 +1882,16 @@ + - + + @@ -1706,6 +1900,7 @@ + @@ -1714,6 +1909,7 @@ + @@ -1722,6 +1918,7 @@ + @@ -1730,6 +1927,7 @@ + @@ -1738,6 +1936,7 @@ + @@ -1746,6 +1945,7 @@ + @@ -1754,6 +1954,7 @@ + @@ -1762,6 +1963,7 @@ + @@ -1770,6 +1972,7 @@ + @@ -1778,6 +1981,7 @@ + @@ -1786,6 +1990,7 @@ + @@ -1794,6 +1999,7 @@ + @@ -1802,6 +2008,7 @@ + @@ -1810,6 +2017,7 @@ + @@ -1818,6 +2026,7 @@ + @@ -1826,6 +2035,7 @@ + @@ -1834,6 +2044,7 @@ + @@ -1842,6 +2053,7 @@ + @@ -1850,6 +2062,7 @@ + @@ -1858,6 +2071,7 @@ + @@ -1866,6 +2080,7 @@ + @@ -1874,6 +2089,7 @@ + @@ -1882,6 +2098,7 @@ + @@ -1890,6 +2107,7 @@ + @@ -1898,6 +2116,7 @@ + @@ -1907,6 +2126,7 @@ + @@ -1915,6 +2135,7 @@ + @@ -1923,6 +2144,7 @@ + @@ -1931,6 +2153,7 @@ + @@ -1939,6 +2162,7 @@ + @@ -1947,6 +2171,7 @@ + @@ -1955,6 +2180,7 @@ + @@ -1963,6 +2189,7 @@ + @@ -1971,6 +2198,7 @@ + @@ -1979,6 +2207,7 @@ + @@ -1987,6 +2216,7 @@ + @@ -1995,6 +2225,7 @@ + @@ -2003,24 +2234,27 @@ + - + + - + + @@ -2029,6 +2263,7 @@ + @@ -2037,6 +2272,7 @@ + @@ -2045,6 +2281,7 @@ + @@ -2053,6 +2290,7 @@ + @@ -2061,14 +2299,16 @@ + - + + @@ -2077,6 +2317,7 @@ + @@ -2087,6 +2328,7 @@ + @@ -2095,6 +2337,7 @@ + @@ -2103,6 +2346,7 @@ + @@ -2111,6 +2355,7 @@ + @@ -2119,6 +2364,7 @@ + @@ -2127,6 +2373,7 @@ + @@ -2137,6 +2384,7 @@ + @@ -2145,6 +2393,7 @@ + @@ -2153,6 +2402,7 @@ + @@ -2161,6 +2411,7 @@ + @@ -2169,6 +2420,7 @@ + @@ -2177,6 +2429,7 @@ + @@ -2185,6 +2438,7 @@ + @@ -2193,6 +2447,7 @@ + @@ -2201,6 +2456,7 @@ + @@ -2209,6 +2465,7 @@ + @@ -2217,6 +2474,7 @@ + @@ -2225,6 +2483,7 @@ + @@ -2233,14 +2492,16 @@ + - + + @@ -2249,6 +2510,7 @@ + @@ -2257,6 +2519,7 @@ + @@ -2265,6 +2528,7 @@ + @@ -2273,6 +2537,7 @@ + @@ -2281,6 +2546,7 @@ + @@ -2289,6 +2555,7 @@ + @@ -2297,6 +2564,7 @@ + @@ -2305,6 +2573,7 @@ + @@ -2313,6 +2582,7 @@ + @@ -2321,6 +2591,7 @@ + @@ -2329,6 +2600,7 @@ + @@ -2337,6 +2609,7 @@ + @@ -2345,6 +2618,7 @@ + @@ -2354,6 +2628,7 @@ + @@ -2362,6 +2637,7 @@ + @@ -2370,6 +2646,7 @@ + @@ -2378,6 +2655,7 @@ + @@ -2386,6 +2664,7 @@ + @@ -2394,6 +2673,7 @@ + @@ -2402,6 +2682,7 @@ + @@ -2410,6 +2691,7 @@ + @@ -2418,6 +2700,7 @@ + @@ -2426,6 +2709,7 @@ + @@ -2434,6 +2718,7 @@ + @@ -2442,6 +2727,7 @@ + @@ -2450,6 +2736,7 @@ + @@ -2458,6 +2745,7 @@ + @@ -2466,6 +2754,7 @@ + @@ -2474,6 +2763,7 @@ + @@ -2482,6 +2772,7 @@ + @@ -2490,6 +2781,7 @@ + @@ -2498,6 +2790,7 @@ + @@ -2506,6 +2799,7 @@ + @@ -2514,6 +2808,7 @@ + @@ -2522,6 +2817,7 @@ + @@ -2530,6 +2826,7 @@ + @@ -2538,6 +2835,7 @@ + @@ -2546,6 +2844,7 @@ + @@ -2554,6 +2853,7 @@ + @@ -2562,6 +2862,7 @@ + @@ -2570,6 +2871,7 @@ + @@ -2578,6 +2880,7 @@ + @@ -2586,6 +2889,7 @@ + @@ -2594,6 +2898,7 @@ + @@ -2602,6 +2907,7 @@ + @@ -2613,6 +2919,7 @@ + @@ -2621,6 +2928,7 @@ + @@ -2629,6 +2937,7 @@ + @@ -2637,6 +2946,7 @@ + @@ -2645,6 +2955,7 @@ + @@ -2653,6 +2964,7 @@ + @@ -2661,6 +2973,7 @@ + @@ -2669,6 +2982,7 @@ + @@ -2677,6 +2991,7 @@ + @@ -2685,6 +3000,7 @@ + @@ -2693,6 +3009,7 @@ + @@ -2701,6 +3018,7 @@ + @@ -2709,6 +3027,7 @@ + @@ -2717,6 +3036,7 @@ + @@ -2725,6 +3045,7 @@ + @@ -2733,6 +3054,7 @@ + @@ -2741,6 +3063,7 @@ + @@ -2749,6 +3072,7 @@ + @@ -2757,6 +3081,7 @@ + @@ -2765,6 +3090,7 @@ + @@ -2773,6 +3099,7 @@ + @@ -2781,6 +3108,7 @@ + @@ -2789,6 +3117,7 @@ + @@ -2797,6 +3126,7 @@ + @@ -2805,6 +3135,7 @@ + @@ -2813,6 +3144,7 @@ + @@ -2821,6 +3153,7 @@ + @@ -2829,6 +3162,7 @@ + @@ -2837,6 +3171,7 @@ + @@ -2845,6 +3180,7 @@ + @@ -2853,6 +3189,7 @@ + @@ -2861,6 +3198,7 @@ + @@ -2869,6 +3207,7 @@ + @@ -2877,6 +3216,7 @@ + @@ -2885,6 +3225,7 @@ + @@ -2893,6 +3234,7 @@ + @@ -2901,6 +3243,7 @@ + @@ -2909,6 +3252,7 @@ + @@ -2917,6 +3261,7 @@ + @@ -2925,6 +3270,7 @@ + @@ -2933,6 +3279,7 @@ + @@ -2941,6 +3288,7 @@ + @@ -2949,6 +3297,7 @@ + @@ -2957,6 +3306,7 @@ + @@ -2965,6 +3315,7 @@ + @@ -2973,6 +3324,7 @@ + @@ -2981,6 +3333,7 @@ + @@ -2989,6 +3342,7 @@ + @@ -2997,6 +3351,7 @@ + @@ -3005,6 +3360,7 @@ + @@ -3013,6 +3369,7 @@ + @@ -3021,6 +3378,7 @@ + @@ -3029,6 +3387,7 @@ + @@ -3037,6 +3396,7 @@ + @@ -3045,6 +3405,7 @@ + @@ -3053,6 +3414,7 @@ + @@ -3061,6 +3423,7 @@ + @@ -3070,6 +3433,7 @@ + @@ -3078,6 +3442,7 @@ + @@ -3086,6 +3451,7 @@ + @@ -3094,6 +3460,7 @@ + @@ -3102,6 +3469,7 @@ + @@ -3110,6 +3478,7 @@ + @@ -3118,6 +3487,7 @@ + @@ -3126,6 +3496,7 @@ + @@ -3134,6 +3505,7 @@ + @@ -3142,6 +3514,7 @@ + @@ -3150,6 +3523,7 @@ + @@ -3158,6 +3532,7 @@ + @@ -3166,6 +3541,7 @@ + @@ -3174,6 +3550,7 @@ + @@ -3182,6 +3559,7 @@ + @@ -3190,6 +3568,7 @@ + @@ -3198,14 +3577,16 @@ + - + + @@ -3214,6 +3595,7 @@ + @@ -3222,6 +3604,7 @@ + @@ -3230,6 +3613,7 @@ + @@ -3238,6 +3622,7 @@ + @@ -3246,6 +3631,7 @@ + @@ -3254,6 +3640,7 @@ + @@ -3262,14 +3649,16 @@ + - + + @@ -3278,6 +3667,7 @@ + @@ -3286,6 +3676,7 @@ + @@ -3294,6 +3685,7 @@ + @@ -3302,6 +3694,7 @@ + @@ -3311,6 +3704,7 @@ + @@ -3319,6 +3713,7 @@ + @@ -3327,6 +3722,7 @@ + @@ -3335,6 +3731,7 @@ + @@ -3343,6 +3740,7 @@ + @@ -3351,6 +3749,7 @@ + @@ -3359,6 +3758,7 @@ + @@ -3367,6 +3767,7 @@ + @@ -3375,6 +3776,7 @@ + @@ -3383,6 +3785,7 @@ + @@ -3391,6 +3794,7 @@ + @@ -3399,6 +3803,7 @@ + @@ -3407,6 +3812,7 @@ + @@ -3415,6 +3821,7 @@ + @@ -3423,6 +3830,7 @@ + @@ -3431,6 +3839,7 @@ + @@ -3439,6 +3848,7 @@ + @@ -3447,6 +3857,7 @@ + @@ -3455,6 +3866,7 @@ + @@ -3463,6 +3875,7 @@ + @@ -3471,6 +3884,7 @@ + @@ -3479,6 +3893,7 @@ + @@ -3487,6 +3902,7 @@ + @@ -3495,6 +3911,7 @@ + @@ -3503,22 +3920,25 @@ + - + + - + + @@ -3527,6 +3947,7 @@ + @@ -3535,6 +3956,7 @@ + @@ -3543,6 +3965,7 @@ + @@ -3551,6 +3974,7 @@ + @@ -3559,6 +3983,7 @@ + @@ -3567,6 +3992,7 @@ + @@ -3575,6 +4001,7 @@ + @@ -3583,6 +4010,7 @@ + @@ -3591,6 +4019,7 @@ + @@ -3599,6 +4028,7 @@ + @@ -3608,6 +4038,7 @@ + @@ -3616,6 +4047,7 @@ + @@ -3624,6 +4056,7 @@ + @@ -3632,6 +4065,7 @@ + @@ -3640,6 +4074,7 @@ + @@ -3648,6 +4083,7 @@ + @@ -3656,6 +4092,7 @@ + @@ -3664,6 +4101,7 @@ + @@ -3672,6 +4110,7 @@ + @@ -3680,6 +4119,7 @@ + @@ -3688,6 +4128,7 @@ + @@ -3696,6 +4137,7 @@ + @@ -3704,6 +4146,7 @@ + @@ -3712,6 +4155,7 @@ + @@ -3720,15 +4164,17 @@ + - + + @@ -3737,6 +4183,7 @@ + @@ -3745,6 +4192,7 @@ + @@ -3753,6 +4201,7 @@ + @@ -3761,6 +4210,7 @@ + @@ -3769,6 +4219,7 @@ + @@ -3777,6 +4228,7 @@ + @@ -3785,6 +4237,7 @@ + @@ -3793,6 +4246,7 @@ + @@ -3801,6 +4255,7 @@ + @@ -3809,6 +4264,7 @@ + @@ -3817,6 +4273,7 @@ + @@ -3825,6 +4282,7 @@ + @@ -3833,6 +4291,7 @@ + @@ -3841,6 +4300,7 @@ + @@ -3849,6 +4309,7 @@ + @@ -3857,6 +4318,7 @@ + @@ -3865,6 +4327,7 @@ + @@ -3873,6 +4336,7 @@ + @@ -3881,6 +4345,7 @@ + @@ -3890,6 +4355,7 @@ + @@ -3898,6 +4364,7 @@ + @@ -3906,6 +4373,7 @@ + @@ -3914,6 +4382,7 @@ + @@ -3922,6 +4391,7 @@ + @@ -3930,6 +4400,7 @@ + @@ -3938,6 +4409,7 @@ + @@ -3946,6 +4418,7 @@ + @@ -3954,6 +4427,7 @@ + @@ -3962,6 +4436,7 @@ + @@ -3970,6 +4445,7 @@ + @@ -3978,6 +4454,7 @@ + @@ -3986,6 +4463,7 @@ + @@ -3994,6 +4472,7 @@ + @@ -4002,6 +4481,7 @@ + @@ -4010,6 +4490,7 @@ + @@ -4018,6 +4499,7 @@ + @@ -4026,6 +4508,7 @@ + @@ -4034,6 +4517,7 @@ + @@ -4042,6 +4526,7 @@ + @@ -4050,6 +4535,7 @@ + @@ -4058,6 +4544,7 @@ + @@ -4066,6 +4553,7 @@ + @@ -4074,6 +4562,7 @@ + @@ -4082,6 +4571,7 @@ + @@ -4090,6 +4580,7 @@ + @@ -4098,6 +4589,7 @@ + @@ -4106,6 +4598,7 @@ + @@ -4114,6 +4607,7 @@ + @@ -4122,6 +4616,7 @@ + @@ -4130,6 +4625,7 @@ + @@ -4138,6 +4634,7 @@ + @@ -4146,6 +4643,7 @@ + @@ -4154,6 +4652,7 @@ + @@ -4162,6 +4661,7 @@ + @@ -4170,6 +4670,7 @@ + @@ -4178,6 +4679,7 @@ + @@ -4186,6 +4688,7 @@ + @@ -4194,6 +4697,7 @@ + @@ -4202,6 +4706,7 @@ + @@ -4210,6 +4715,7 @@ + @@ -4218,22 +4724,25 @@ + - + + - + + @@ -4244,6 +4753,7 @@ + @@ -4252,6 +4762,7 @@ + @@ -4260,6 +4771,7 @@ + @@ -4269,6 +4781,7 @@ + @@ -4277,6 +4790,7 @@ + @@ -4285,6 +4799,7 @@ + @@ -4293,6 +4808,7 @@ + @@ -4301,15 +4817,17 @@ + - + + @@ -4318,6 +4836,7 @@ + @@ -4326,6 +4845,7 @@ + @@ -4334,6 +4854,7 @@ + @@ -4342,6 +4863,7 @@ + @@ -4350,6 +4872,7 @@ + @@ -4358,6 +4881,7 @@ + @@ -4366,6 +4890,7 @@ + @@ -4374,6 +4899,7 @@ + @@ -4382,6 +4908,7 @@ + @@ -4390,6 +4917,7 @@ + @@ -4398,6 +4926,7 @@ + @@ -4406,6 +4935,7 @@ + @@ -4414,6 +4944,7 @@ + @@ -4423,6 +4954,7 @@ + @@ -4431,6 +4963,7 @@ + @@ -4439,6 +4972,7 @@ + @@ -4447,6 +4981,7 @@ + @@ -4455,6 +4990,7 @@ + @@ -4463,6 +4999,7 @@ + @@ -4471,6 +5008,7 @@ + @@ -4479,6 +5017,7 @@ + @@ -4487,6 +5026,7 @@ + @@ -4495,6 +5035,7 @@ + @@ -4503,6 +5044,7 @@ + @@ -4511,6 +5053,7 @@ + @@ -4519,6 +5062,7 @@ + @@ -4527,6 +5071,7 @@ + @@ -4536,6 +5081,7 @@ + @@ -4544,6 +5090,7 @@ + @@ -4552,6 +5099,7 @@ + @@ -4560,6 +5108,7 @@ + @@ -4568,6 +5117,7 @@ + @@ -4576,6 +5126,7 @@ + @@ -4584,6 +5135,7 @@ + @@ -4592,6 +5144,7 @@ + @@ -4600,6 +5153,7 @@ + @@ -4608,6 +5162,7 @@ + @@ -4616,6 +5171,7 @@ + @@ -4624,6 +5180,7 @@ + @@ -4632,6 +5189,7 @@ + @@ -4640,6 +5198,7 @@ + @@ -4648,6 +5207,7 @@ + @@ -4656,6 +5216,7 @@ + @@ -4664,6 +5225,7 @@ + @@ -4672,6 +5234,7 @@ + @@ -4680,6 +5243,7 @@ + @@ -4688,6 +5252,7 @@ + @@ -4696,6 +5261,7 @@ + @@ -4704,6 +5270,7 @@ + @@ -4712,6 +5279,7 @@ + @@ -4720,6 +5288,7 @@ + @@ -4728,6 +5297,7 @@ + @@ -4738,6 +5308,7 @@ + @@ -4746,6 +5317,7 @@ + @@ -4754,6 +5326,7 @@ + @@ -4762,6 +5335,7 @@ + @@ -4770,6 +5344,7 @@ + @@ -4778,6 +5353,7 @@ + @@ -4786,6 +5362,7 @@ + @@ -4794,6 +5371,7 @@ + @@ -4802,6 +5380,7 @@ + @@ -4810,6 +5389,7 @@ + @@ -4819,6 +5399,7 @@ + @@ -4827,6 +5408,7 @@ + @@ -4835,6 +5417,7 @@ + @@ -4843,6 +5426,7 @@ + @@ -4851,6 +5435,7 @@ + @@ -4859,6 +5444,7 @@ + @@ -4867,6 +5453,7 @@ + @@ -4875,6 +5462,7 @@ + @@ -4884,6 +5472,7 @@ + @@ -4892,6 +5481,7 @@ + @@ -4900,14 +5490,16 @@ + - + + @@ -4916,6 +5508,7 @@ + @@ -4924,6 +5517,7 @@ + @@ -4933,6 +5527,7 @@ + @@ -4941,6 +5536,7 @@ + @@ -4949,6 +5545,7 @@ + @@ -4957,6 +5554,7 @@ + @@ -4965,6 +5563,7 @@ + @@ -4973,6 +5572,7 @@ + @@ -4981,6 +5581,7 @@ + @@ -4989,6 +5590,7 @@ + @@ -4997,6 +5599,7 @@ + @@ -5005,6 +5608,7 @@ + @@ -5013,6 +5617,7 @@ + @@ -5021,6 +5626,7 @@ + @@ -5029,6 +5635,7 @@ + @@ -5037,6 +5644,7 @@ + @@ -5045,6 +5653,7 @@ + @@ -5053,6 +5662,7 @@ + @@ -5061,6 +5671,7 @@ + @@ -5070,6 +5681,7 @@ + @@ -5078,6 +5690,7 @@ + @@ -5086,6 +5699,7 @@ + @@ -5094,6 +5708,7 @@ + @@ -5102,6 +5717,7 @@ + @@ -5110,6 +5726,7 @@ + @@ -5118,6 +5735,7 @@ + @@ -5126,6 +5744,7 @@ + @@ -5134,6 +5753,7 @@ + @@ -5142,6 +5762,7 @@ + @@ -5150,6 +5771,7 @@ + @@ -5158,6 +5780,7 @@ + @@ -5166,6 +5789,7 @@ + @@ -5174,6 +5798,7 @@ + @@ -5182,6 +5807,7 @@ + @@ -5190,6 +5816,7 @@ + @@ -5198,6 +5825,7 @@ + @@ -5206,6 +5834,7 @@ + @@ -5214,6 +5843,7 @@ + @@ -5222,6 +5852,7 @@ + @@ -5230,6 +5861,7 @@ + @@ -5238,6 +5870,7 @@ + @@ -5246,6 +5879,7 @@ + @@ -5255,6 +5889,7 @@ + @@ -5263,6 +5898,7 @@ + @@ -5271,6 +5907,7 @@ + @@ -5279,6 +5916,7 @@ + @@ -5287,6 +5925,7 @@ + @@ -5295,6 +5934,7 @@ + @@ -5303,6 +5943,7 @@ + @@ -5311,6 +5952,7 @@ + @@ -5319,6 +5961,7 @@ + @@ -5327,6 +5970,7 @@ + @@ -5335,6 +5979,7 @@ + @@ -5343,6 +5988,7 @@ + @@ -5351,6 +5997,7 @@ + @@ -5359,6 +6006,7 @@ + @@ -5367,6 +6015,7 @@ + @@ -5375,6 +6024,7 @@ + @@ -5383,6 +6033,7 @@ + @@ -5391,6 +6042,7 @@ + @@ -5399,6 +6051,7 @@ + @@ -5407,6 +6060,7 @@ + @@ -5415,6 +6069,7 @@ + @@ -5423,6 +6078,7 @@ + @@ -5431,6 +6087,7 @@ + @@ -5439,6 +6096,7 @@ + @@ -5447,6 +6105,7 @@ + @@ -5455,6 +6114,7 @@ + @@ -5463,6 +6123,7 @@ + @@ -5471,6 +6132,7 @@ + @@ -5479,6 +6141,7 @@ + @@ -5487,6 +6150,7 @@ + @@ -5495,6 +6159,7 @@ + @@ -5503,6 +6168,7 @@ + @@ -5511,6 +6177,7 @@ + @@ -5519,6 +6186,7 @@ + @@ -5527,6 +6195,7 @@ + @@ -5535,6 +6204,7 @@ + @@ -5543,6 +6213,7 @@ + @@ -5551,6 +6222,7 @@ + @@ -5559,6 +6231,7 @@ + @@ -5567,6 +6240,7 @@ + @@ -5575,6 +6249,7 @@ + @@ -5583,6 +6258,7 @@ + @@ -5591,6 +6267,7 @@ + @@ -5599,6 +6276,7 @@ + @@ -5607,6 +6285,7 @@ + @@ -5615,6 +6294,7 @@ + @@ -5623,6 +6303,7 @@ + @@ -5631,6 +6312,7 @@ + @@ -5639,6 +6321,7 @@ + @@ -5647,6 +6330,7 @@ + @@ -5655,6 +6339,7 @@ + @@ -5663,6 +6348,7 @@ + @@ -5671,6 +6357,7 @@ + @@ -5679,6 +6366,7 @@ + @@ -5687,6 +6375,7 @@ + @@ -5695,6 +6384,7 @@ + @@ -5703,6 +6393,7 @@ + @@ -5711,6 +6402,7 @@ + @@ -5719,6 +6411,7 @@ + @@ -5727,6 +6420,7 @@ + @@ -5735,6 +6429,7 @@ + @@ -5743,6 +6438,7 @@ + @@ -5751,6 +6447,7 @@ + @@ -5759,6 +6456,7 @@ + @@ -5767,6 +6465,7 @@ + @@ -5775,6 +6474,7 @@ + @@ -5783,6 +6483,7 @@ + @@ -5791,6 +6492,7 @@ + @@ -5799,6 +6501,7 @@ + @@ -5807,6 +6510,7 @@ + @@ -5815,6 +6519,7 @@ + @@ -5823,6 +6528,7 @@ + @@ -5831,6 +6537,7 @@ + @@ -5839,6 +6546,7 @@ + @@ -5847,6 +6555,7 @@ + @@ -5855,6 +6564,7 @@ + @@ -5863,6 +6573,7 @@ + @@ -5871,6 +6582,7 @@ + @@ -5879,14 +6591,16 @@ + - + + @@ -5895,6 +6609,7 @@ + @@ -5903,6 +6618,7 @@ + @@ -5911,6 +6627,7 @@ + @@ -5919,6 +6636,7 @@ + @@ -5927,6 +6645,7 @@ + @@ -5935,6 +6654,7 @@ + @@ -5943,6 +6663,7 @@ + @@ -5951,6 +6672,7 @@ + @@ -5959,6 +6681,7 @@ + @@ -5967,6 +6690,7 @@ + @@ -5975,6 +6699,16 @@ + + + + + + + + + + @@ -5983,6 +6717,7 @@ + @@ -5991,6 +6726,7 @@ + @@ -5999,6 +6735,7 @@ + @@ -6007,6 +6744,16 @@ + + + + + + + + + + @@ -6015,6 +6762,25 @@ + + + + + + + + + + + + + + + + + + + @@ -6023,6 +6789,7 @@ + @@ -6031,14 +6798,16 @@ + - + + @@ -6047,6 +6816,718 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/copasi/MIRIAM/bin/updateMiriam.py b/copasi/MIRIAM/bin/updateMiriam.py new file mode 100644 index 0000000000..65ed69064f --- /dev/null +++ b/copasi/MIRIAM/bin/updateMiriam.py @@ -0,0 +1,78 @@ +#!/usr/bin/env python3 + +# BEGIN: Copyright +# Copyright (C) 2020 Rector and Visitors of the University of Virginia +# All rights reserved +# END: Copyright + +# BEGIN: License +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# END: License + +from collections import OrderedDict +from pathlib import Path +import json +from sqlalchemy import true +import xmltodict +import requests + +def createDataType(namespace): + datatype = OrderedDict() + + datatype['@id']= namespace['mirId'] + datatype['@pattern']= namespace['pattern'] + + if namespace['namespaceEmbeddedInLui']: + datatype['@namespaceEmbeddedInPattern'] = True + + datatype['name'] = namespace['name'] + datatype['definition'] = namespace['description'] + datatype['namespace'] = namespace['prefix'] + + uri = OrderedDict() + uri['@type'] = 'URN' + uri['#text'] = 'urn:miriam:' + namespace['prefix'] + + uris = OrderedDict() + uris['uri'] = [uri] + + datatype['uris'] = uris + + return datatype + + +def main(): + identifiersURL = 'https://registry.api.identifiers.org/resolutionApi/getResolverDataset' + identifiers = json.loads(requests.get(identifiersURL).content) + + miriamURL = 'https://copasi.org/static/miriam.xml' + response = requests.get(miriamURL) + miriam = xmltodict.parse(response.content) + + for namespace in identifiers['payload']['namespaces']: + mirId = namespace['mirId'] + + found = None + for datatype in miriam['miriam']['datatype']: + if datatype['@id'] == mirId: + found = datatype + break + + if found: + if namespace['namespaceEmbeddedInLui']: + datatype['@namespaceEmbeddedInPattern'] = True + else: + datatype = createDataType(namespace) + miriam['miriam']['datatype'].append(datatype) + + miriamXml = xmltodict.unparse(miriam, pretty=True, indent=' ') + + outputFile = Path('miriam.xml') + outputFileHandle = outputFile.open('w') + outputFileHandle.write(miriamXml) + +if __name__ == "__main__": + main()