Commit d7c162c7 by Maarten L. Hekkelman

links fixed, again

parent f211fa4b
...@@ -973,29 +973,29 @@ void DictParser::linkItems() ...@@ -973,29 +973,29 @@ void DictParser::linkItems()
size_t ix = linkIndex.at(key); size_t ix = linkIndex.at(key);
addLink(ix, piv->mTag, civ->mTag); addLink(ix, piv->mTag, civ->mTag);
} }
}
auto& linkedGroup = dict["pdbx_item_linked_group"]; auto& linkedGroup = dict["pdbx_item_linked_group"];
// now store the links in the validator
for (auto& kv: linkIndex)
{
ValidateLink link = {};
std::tie(link.mParentCategory, link.mChildCategory) = kv.first;
if (linkGroupIds.count(kv.first)) // now store the links in the validator
link.mLinkGroupID = linkGroupIds[kv.first]; for (auto& kv: linkIndex)
{
std::tie(link.mParentKeys, link.mChildKeys) = linkKeys[kv.second]; ValidateLink link = {};
std::tie(link.mParentCategory, link.mChildCategory) = kv.first;
// look up the label if (linkGroupIds.count(kv.first))
for (auto r: linkedGroup.find(cif::Key("category_id") == link.mChildCategory and cif::Key("link_group_id") == link.mLinkGroupID)) link.mLinkGroupID = linkGroupIds[kv.first];
{
link.mLinkGroupLabel = r["label"].as<std::string>(); std::tie(link.mParentKeys, link.mChildKeys) = linkKeys[kv.second];
break;
}
mValidator.addLinkValidator(std::move(link)); // look up the label
for (auto r: linkedGroup.find(cif::Key("category_id") == link.mChildCategory and cif::Key("link_group_id") == link.mLinkGroupID))
{
link.mLinkGroupLabel = r["label"].as<std::string>();
break;
} }
mValidator.addLinkValidator(std::move(link));
} }
// now make sure the itemType is specified for all itemValidators // now make sure the itemType is specified for all itemValidators
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment