dainst / idai-field

iDAI.field | Archaeological Field Recording App by the German Archaeological Institute
Apache License 2.0
36 stars 15 forks source link

Harmonize input type "literature" #253

Open dersmon opened 1 month ago

dersmon commented 1 month ago

This issue came up while I implemented the output for literature type input values in FieldPublication. There are different keys for "zenonId" (zenon.dainst.org links) and "doi" (doi.org links). This should be harmonized in a single key "reference" or something similar, that contains an external link.

The current FieldPublication implementation looks something like this:

    ~H"""
    <%= if is_list(@field.value) do %>
      <ul>
        <%= for value <- @field.value do %>
          <%= cond do %>
            <% Map.has_key?(value, "doi") -> %>
              <li>
                <a href={value["doi"]} target="_blank"><%= value["quotation"] %></a>
              </li>
            <% Map.has_key?(value, "zenonId") -> %>
              <li>
                <a href={value["zenonId"]} target="_blank"><%= value["quotation"] %></a>
              </li>
            <% Map.has_key?(value, "quotation") -> %>
              <li>
                <%= value["quotation"] %>
              </li>
            <% true -> %>
              <li>
                <.render_warning value={value} />
              </li>
          <% end %>
        <% end %>
      </ul>
    <% else %>
      <.render_warning {assigns} />
    <% end %>
    """
lsteinmann commented 1 month ago

I really don't agree on treating DOI and Zenon-ID as the same kind of reference. A DOI typically leads to the work itself, while the Zenon-ID would only point to the entry in our library system. The DOI is a part of the citation in accordance with the DAI citation guidelines, the Zenon-ID is not (and should never be). However, the Zenon-ID is still used in DAI publications for linking references the same way that you do here.

According to the citation guidelines, a literature reference where the work in question has a DOI (and in this case, also a Zenon-ID) would actually need to look like this:

~H"""
<li>
    <a href={value["zenonId"]} target="_blank"><%= value["quotation"] %></a>, 
    <a href={value["doi"]} target="_blank"><%= value["doi"] %></a>
</li>
"""

(N. Benecke, Wirtschaft und Umwelt früher Bauern in Thrakien: Archäozoologische Studien an Fundmaterialien aus Drama (Bulgarien) und Kırklareli-Aşağı Pınar (Türkei), Archäometrische Studien 1 (Wiesbaden 2020), https://doi.org/10.34780/archmetrs.v1i0.1000)

Linking the text of the citation that is not the DOI to Zenon is just fancy candy. (Though it is nice.)

But: We could discuss changing Zenon-ID to any other link to any other bibliographic reference, for which the input would need to be a full URL though - or a complex input from which you choose the reference system. The latter would overly complicate the whole thing in my opinion. (Speaking as someone who has had to do this many many times: It is already a lot of work to input literature references properly.)