Skip to content

Commit

Permalink
Merge pull request #1225 from ontodev/fix-1216
Browse files Browse the repository at this point in the history
Skip non-robot columns for axiom annotations
  • Loading branch information
jamesaoverton authored Nov 13, 2024
2 parents 27d5fd3 + 1b7149c commit 063a1e1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

## Fixed
- Skip "non-robot" columns in templates for the purposes of axiom annotations [#1216]
- Add missing filter for deprecated in lowercase_definition check [#1220]
- Bug was fixed that caused logical axioms with axiom annotations not to be processed correctly when merging axiom annotations [#1223]

Expand Down Expand Up @@ -419,6 +420,7 @@ First official release of ROBOT!
[#1223]: https://github.com/ontodev/robot/pull/1223
[#1221]: https://github.com/ontodev/robot/pull/1221
[#1220]: https://github.com/ontodev/robot/issues/1220
[#1216]: https://github.com/ontodev/robot/issues/1216
[#1211]: https://github.com/ontodev/robot/pull/1211
[#1194]: https://github.com/ontodev/robot/pull/1194
[#1193]: https://github.com/ontodev/robot/pull/1193
Expand Down
5 changes: 5 additions & 0 deletions robot-core/src/main/java/org/obolibrary/robot/Template.java
Original file line number Diff line number Diff line change
Expand Up @@ -2126,6 +2126,11 @@ private Set<OWLAnnotation> maybeGetAxiomAnnotations(List<String> row, int column
} catch (IndexOutOfBoundsException e) {
break;
}
// Skip columsn with empty templates.
// See https://github.com/ontodev/robot/issues/1216
if (template.trim().equals("")) {
continue;
}
Matcher m = Pattern.compile("^>.*").matcher(template);
if (m.matches()) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void testLegacyTemplateCSV() throws Exception {
}

/**
* Test a strange case where a sequence .
* Test a strange case with no labels and no types.
*
* @throws Exception if entities cannot be found
*/
Expand All @@ -63,7 +63,7 @@ public void testNoLabelsNoTypes() throws Exception {
}

/**
* Test a strange case where a sequence .
* Test a case with no labels.
*
* @throws Exception if entities cannot be found
*/
Expand Down
10 changes: 5 additions & 5 deletions robot-core/src/test/resources/template.csv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Label,Label Comment,Nested Comment,See Also,ID,Synonyms,Parent,Parts,Parts Annotation,Equivalent,Eq Annotation
A rdfs:label,>AL rdfs:comment@en,>>A rdfs:comment,>AI rdfs:seeAlso,ID,A IAO:0000118 SPLIT=|,SC %,SC part_of some %,>A rdfs:comment,EC %,>A rdfs:comment
skip this row
test 3,test 3 comment,test 3 comment comment,http://robot.obolibrary.org/,GO:1234,synonym 1|synonym 2,test2,test one,test one comment,,
test 4,test 4 comment,,,GO:1235,,,,,'test one' and (part_of some (test2 and 'test 3')),test2 and test 3 comment
Label,Label Comment,Nested Comment,Ignore,See Also,ID,Synonyms,Parent,Parts,Parts Annotation,Equivalent,Eq Annotation
A rdfs:label,>AL rdfs:comment@en,>>A rdfs:comment,,>AI rdfs:seeAlso,ID,A IAO:0000118 SPLIT=|,SC %,SC part_of some %,>A rdfs:comment,EC %,>A rdfs:comment
skip this row,,,,,,,,,,,
test 3,test 3 comment,test 3 comment comment,ignore this,http://robot.obolibrary.org/,GO:1234,synonym 1|synonym 2,test2,test one,test one comment,,
test 4,test 4 comment,,ignore this,,GO:1235,,,,,'test one' and (part_of some (test2 and 'test 3')),test2 and test 3 comment

0 comments on commit 063a1e1

Please sign in to comment.