Permalink
Browse files

check xp dupes

  • Loading branch information...
1 parent eb89a73 commit becda5c5fcc7ba59e60ac31da5da635f7600a753 @cmungall committed May 11, 2010
Showing with 9 additions and 1 deletion.
  1. +9 −1 obo-check-xps.pl
View
@@ -33,6 +33,7 @@
my @flagged = ();
my %referenced;
my $n = 0;
+my %id_by_xp_h = ();
if (!@ARGV) {
@ARGV=('-');
}
@@ -65,18 +66,25 @@
if (@xps == 1) {
flag("single_xp: @xps",$_);
}
+ my @xp_links = ();
my @genii = ();
foreach (@xps) {
s/\s*\!.*//;
my @parts = split(' ',$_);
shift @parts;
+ push(@xp_links,join(' ',@parts));
foreach (@parts) {
$referenced{$_} = 1;
}
if (@parts == 1) {
push(@genii, $parts[0]);
}
}
+ my $xp_str = join('; ', sort {$a cmp $b} @xp_links);
+ if ($id_by_xp_h{$xp_str}) {
+ flag("duplicate xp def: '$xp_str' $id == $id_by_xp_h{$xp_str}", $_);
+ }
+ $id_by_xp_h{$xp_str} = $id;
if (@genii < 1) {
flag("single_genus: @genii", $_);
}
@@ -97,7 +105,7 @@
foreach (keys %done) {
if (/^_:/) {
- if ($referenced{$_}) {
+ if (!$referenced{$_}) {
flag("unreferenced anon class", $_);
}
}

0 comments on commit becda5c

Please sign in to comment.