clarin-eric / ParlaMint

ParlaMint: Comparable Parliamentary Corpora
https://clarin-eric.github.io/ParlaMint/
41 stars 52 forks source link

Inaccurate (and possibly spurious) error message #570

Closed mrudolf closed 1 year ago

mrudolf commented 1 year ago

I have the following data:

<affiliation from="2015-11-16" ref="#government.PL" role="minister" to="2017-12-11"/>
<affiliation from="2017-12-11" ref="#government.PL" role="minister" to="2018-01-09"/>

This triggers this error:

INFO[01] ParlaMint-PL-listPerson affiliation collision: (2015-11-16 --- 2017-12-11) has one day overlap with (1500-01-01 --- ) affiliation minister-#government.PL

The error message is clearly wrong about the date (1500-01-01). No such date exists in the input data. But is the check accurate? As far as I can see, there is 0, not 1 day overlap between 2017-12-11 and 2017-12-11. It is quite common for someone to be appointed a minister in the next government on the same day he stops to be a minister in former government. Do I need to falsify dates to make this possible?

TomazErjavec commented 1 year ago

Comments like "INFO[01]" are @matyaskopp's babies, but, still: yes, it does seem the 1500-01-01 is wrong (I guess this is some artificial date set to be always earlier than any actualy date, there for reasons of comparison, still, it should be present here, but probably ony if an element does not have the from attribute).

As for overlap, we had quite some discussions about that, and we did decide to falsify dates in order not to have multiple values for a date. Then again, nothing really dies if you do have overlap, you will notice that you only got a INFO message, not even WARNING, much less ERROR.

TomazErjavec commented 1 year ago

Sorry, didn't mean to close.

About:

As far as I can see, there is 0, not 1 day overlap between 2017-12-11 and 2017-12-11.

There is 1 day when they overlap, namely 2017-12-11.

mrudolf commented 1 year ago

As for overlap, we had quite some discussions about that, and we did decide to falsify dates in order not to have multiple values for a date. Then again, nothing really dies if you do have overlap, you will notice that you only got a INFO message, not even WARNING, much less ERROR.

It it possible to have an overlap if one has two minister roles at the same time?

TomazErjavec commented 1 year ago

It it possible to have an overlap if one has two minister roles at the same time?

Yes that should be legitimate. If it isn't, it's an error in validation.

matyaskopp commented 1 year ago

It it possible to have an overlap if one has two minister roles at the same time?

Yes, it is, but you should specify roleName to avoid error/warning.

<person ...>
  <!-- ... -->
  <affiliation role="minister ... >
    <roleName>Minister of Agriculture</roleName>
  </affiliation>
  <affiliation role="minister ... >
    <roleName>Minister of Health</roleName>
  </affiliation>
</person>

This code does the validation and compartment if the affiliations are equivalent: https://github.com/clarin-eric/ParlaMint/blob/89fa819303d66d916ef97b83c368150c6d0ef5b6/Scripts/validate-parlamint-particDesc.xsl#L59-L82

mrudolf commented 1 year ago

Makes sense. I will add roles as soon as I have them translated (I was worried untranslated roles will cause yet another warning).