Skip to content

Commit

Permalink
Fix wrong encodings (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum authored Feb 23, 2024
1 parent e807e08 commit a6f2ae8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions import_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ def main() -> None:
annotation.append(
excel2xml.make_text_prop(
"hasComment",
"Date and time are invented, like for the other resources.",
excel2xml.PropertyElement("Date and time are invented, like for the other resources.", encoding="xml"),
)
)
annotation.append(excel2xml.make_resptr_prop("isAnnotationOf", object_labels_to_ids["Anubis"]))
root.append(annotation)

region = excel2xml.make_region("Region of the Meteorite image", "region_of_meteorite")
region.append(excel2xml.make_text_prop("hasComment", "This is a comment"))
region.append(excel2xml.make_text_prop("hasComment", excel2xml.PropertyElement("This is a comment", encoding="xml")))
region.append(excel2xml.make_color_prop("hasColor", "#5d1f1e"))
region.append(excel2xml.make_resptr_prop("isRegionOf", image2d_labels_to_ids["GibeonMeteorite.jpg"]))
region.append(
Expand All @@ -164,7 +164,7 @@ def main() -> None:
root.append(region)

link = excel2xml.make_link("Link between BM1888-0601-716 and Horohoroto", "link_BM1888-0601-716_horohoroto")
link.append(excel2xml.make_text_prop("hasComment", "This is a comment"))
link.append(excel2xml.make_text_prop("hasComment", excel2xml.PropertyElement("This is a comment", encoding="xml")))
link.append(
excel2xml.make_resptr_prop(
"hasLinkTo",
Expand Down
6 changes: 3 additions & 3 deletions test/expected.xml
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@
</resource>
<annotation label="Annotation to Anubis" id="annotation_to_anubis" permissions="res-default">
<text-prop name="hasComment">
<text permissions="prop-default" encoding="utf8">Date and time are invented, like for the other resources.</text>
<text permissions="prop-default" encoding="xml">Date and time are invented, like for the other resources.</text>
</text-prop>
<resptr-prop name="isAnnotationOf">
<resptr permissions="prop-default">Anubis_fda7c834-692e-4e2c-b7c8-82e26a2775d9</resptr>
</resptr-prop>
</annotation>
<region label="Region of the Meteorite image" id="region_of_meteorite" permissions="res-default">
<text-prop name="hasComment">
<text permissions="prop-default" encoding="utf8">This is a comment</text>
<text permissions="prop-default" encoding="xml">This is a comment</text>
</text-prop>
<color-prop name="hasColor">
<color permissions="prop-default">#5d1f1e</color>
Expand All @@ -195,7 +195,7 @@
</region>
<link label="Link between BM1888-0601-716 and Horohoroto" id="link_BM1888-0601-716_horohoroto" permissions="res-default">
<text-prop name="hasComment">
<text permissions="prop-default" encoding="utf8">This is a comment</text>
<text permissions="prop-default" encoding="xml">This is a comment</text>
</text-prop>
<resptr-prop name="hasLinkTo">
<resptr permissions="prop-default">BM1888-0601-716_97f7982b-eaed-4ef2-8813-cb93f8e2c480</resptr>
Expand Down

0 comments on commit a6f2ae8

Please sign in to comment.