Skip to content

Commit 8cc12ff

Browse files
committed
removing contact links from parsed links
1 parent 2dbc50e commit 8cc12ff

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

schemas-parse/src/main/groovy/org/cedar/schemas/parse/ISOParser.groovy

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,19 @@ class ISOParser {
425425
}
426426

427427
static List<Link> parseLinks(GPathResult metadata) {
428-
def linkNodes = metadata.distributionInfo.MD_Distribution.'**'.findAll {
428+
def allLinkNodes = metadata.distributionInfo.MD_Distribution.'**'.findAll {
429429
it.name() == 'CI_OnlineResource'
430430
}
431-
def uniqueLinks = linkNodes.collect(ISOParser.&parseLink).findAll() as Set
432-
return uniqueLinks.toList()
431+
def allUniqueLinks = allLinkNodes.collect(ISOParser.&parseLink).findAll() as Set
432+
433+
// Find all contact links and remove them
434+
def allContactLinkNodes = metadata.distributionInfo.MD_Distribution.distributor.MD_Distributor.distributorContact.'**'.findAll {
435+
it.name() == 'CI_OnlineResource'
436+
}
437+
def allUniqueContactLinks = allContactLinkNodes.collect(ISOParser.&parseLink).findAll() as Set
438+
439+
allUniqueLinks.removeAll(allUniqueContactLinks)
440+
return allUniqueLinks.toList()
433441
}
434442

435443
static Link parseLink(GPathResult node) {

0 commit comments

Comments
 (0)