Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tei:export incomplete #379

Open
martinantonmueller opened this issue Dec 14, 2022 · 1 comment
Open

tei:export incomplete #379

martinantonmueller opened this issue Dec 14, 2022 · 1 comment
Assignees
Labels
bug pmb issue is specific for pmb project TEI-Serialisation

Comments

@martinantonmueller
Copy link
Member

this is an incomplete export:

<date to-iso="1938-09-25">03.12.1918 – 25.09.1938</date>

from-isois missing

cf. https://pmb.acdh.oeaw.ac.at/apis/entities/tei/institution/36687

@martinantonmueller martinantonmueller added bug pmb issue is specific for pmb project labels Dec 14, 2022
@gregorpirgie
Copy link
Contributor

gregorpirgie commented Apr 25, 2023

relates to #391

Will propose a solution for both issues. The current date handling is managed in this template:

{% if object.start_date_written == object.end_date_written %} # GP: add check here that both dates are not none or catch this case above
<date>{{ object.start_date_written }}</date>
{% elif object.start_date_written and object.end_date_written %}
<date
      {% if object.start_start_date %}
        from-iso="{{ object.start_start_date|date:'Y-m-d' }}"
      {% endif %}
      {% if object.end_date %} 
        to-iso="{{ object.end_date|date:'Y-m-d' }}"
      {% endif %}
    >{{ object.start_date_written }}  – {{ object.end_date_written }}</date>
{% elif object.start_date_written %}
<date
      {% if object.start_start_date %}
        notBefore-iso="{{ object.start_start_date|date:'Y-m-d' }}"
      {% endif %}
      {% if object.start_date %}
        when-iso="{{ object.start_date|date:'Y-m-d' }}"
      {% endif %}
    >{{ object.start_date_written }}</date>
{% elif object.end_date_written %}
<date
      {% if object.end_date %}
        when-iso="{{ object.end_date|date:'Y-m-d' }}"
      {% endif %}
      {% if object.end_end_date %}
        notAfter-iso="{{ object.end_end_date|date:'Y-m-d' }}"
      {% endif %}
    >{{ object.end_date_written }}</date>
{% else %}
{% endif %}

I think we would need even more checks, for each individual date-section. To unifiy the beaviour, I would propose to return:

  • no date at all, if both start and end date are none
  • an empty date in each case where from-iso and to-iso is expected and only one of the two is None. I guess that this caused the incomplete exports

@martinantonmueller and @csae8092 - would this be the desired behaviour and if so, what should be the default value for the second case where a to-iso and from-iso is expected but only one of the two is None? Should it be simply "None"

PS: to be clear, in the second case, I suggest, of course, to keep the exisiting date and set the missing date (either from-iso or to-iso to None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug pmb issue is specific for pmb project TEI-Serialisation
Projects
None yet
Development

No branches or pull requests

3 participants