Skip to content

Commit

Permalink
Added possibility for = in extra annotations defined in excelparser (#…
Browse files Browse the repository at this point in the history
…752)

# Description
For each annotation it is now allowed to have = in the string that is
added.

It is tested in the excel2onto test which checks that the created
ontology is correct (small change in one of the annotations there).

## Type of change
<!-- Put an `x` in the box that applies. -->
- [ ] Bug fix.
- [ ] New feature.
- [ ] Documentation update.
- [ ] Test update.

## Checklist
<!-- Put an `x` in the boxes that apply. You can also fill these out
after creating the PR. -->

This checklist can be used as a help for the reviewer.

- [ ] Is the code easy to read and understand?
- [ ] Are comments for humans to read, not computers to disregard?
- [ ] Does a new feature has an accompanying new test (in the CI or unit
testing schemes)?
- [ ] Has the documentation been updated as necessary?
- [ ] Does this close the issue?
- [ ] Is the change limited to the issue?
- [ ] Are errors handled for all outcomes?
- [ ] Does the new feature provide new restrictions on dependencies, and
if so is this documented?

## Comments
<!-- Additional comments here, including clarifications on checklist if
applicable. -->
  • Loading branch information
francescalb authored Apr 26, 2024
1 parent 79c15ff commit bd4e3d6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ontopy/excelparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def _add_entities(
or row["Other annotations"] == "nan"
):
for annotation in row["Other annotations"].split(";"):
key, value = annotation.split("=")
key, value = annotation.split("=", 1)
entity[key.strip(" ")] = english(value.strip(" "))

remaining_rows.difference_update(added_rows)
Expand Down
Binary file modified tests/test_excelparser/onto.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_excelparser/result_ontology/fromexcelonto.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

:EMMO_7c8ba943-15cf-5621-98a3-ed1e7e68fee8 a owl:Class ;
emmo:EMMO_967080e5_2f42_4eb2_a3a9_c58143e835f9 "A special boundary."@en ;
:EMMO_98871837-aa90-5eef-9a56-926ae8beebbb "\"A text about this type of boundary\""@en ;
:EMMO_98871837-aa90-5eef-9a56-926ae8beebbb "\"A text about this type of=boundary\""@en ;
rdfs:subClassOf :EMMO_1b2bfe71-5da9-5c46-b137-be45c3e3f9c3 ;
skos:prefLabel "SpecialBoundary"@en .

Expand Down

0 comments on commit bd4e3d6

Please sign in to comment.