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

Data NO #424

Closed
wants to merge 10 commits into from
Closed

Data NO #424

wants to merge 10 commits into from

Conversation

tungland
Copy link
Collaborator

@tungland tungland commented Nov 3, 2022

Sample for review. I am still getting a lot of warnings about the parliamentary replacements, but it seems they are ok?

@matyaskopp
Copy link
Collaborator

I have updated your branch, so it now does not show warnings on replacement.

But you still have validation errors: https://github.com/clarin-eric/ParlaMint/actions/runs/3384809580/jobs/5622227303#step:4:282

  • redundant affiliations: Error: ERROR[01] : affiliation collision: (...) is inside (...) affiliation (line:) member-#government.NO
  • missing parliamentaryGroup: Error: ERROR[12] : Total number of organizations with parliamentaryGroup role: 0
  • invalid form and lemma:
  [Line 21856 Sent ParlaMint-NO_2004-09-30.ana.segd1203e1023.3]: [L1 Format trailing-whitespace] Trailing whitespace not allowed in column FORM.
  [Line 21856 Sent ParlaMint-NO_2004-09-30.ana.segd1203e1023.3]: [L1 Format trailing-whitespace] Trailing whitespace not allowed in column LEMMA.

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

Thanks for your comments @matyaskopp

Unfortunatly, I am am confused by some of the validation errors.

redundant affiliations: Error: ERROR[01] : affiliation collision: (...) is inside (...) affiliation (line:) member-#government.NO
Does this mean that a person has multiple memberships within the same period? And is this not allowed?

missing parliamentaryGroup: Error: ERROR[12] : Total number of organizations with parliamentaryGroup role: 0
I am maybe a bit confused about what a parliamentaryGroup is in relation to a politicalParty. Does parliamentaryGroup refer to a government coalition?

@TomazErjavec
Copy link
Collaborator

redundant affiliations: Error: ERROR[01] : affiliation collision: (...) is inside (...) affiliation (line:) member-#government.NO
Does this mean that a person has multiple memberships within the same period? And is this not allowed?

I think it means (but @matyaskopp pls. correct me if I am wrong) that they are a member of the same organisation twice at some time.

missing parliamentaryGroup: Error: ERROR[12] : Total number of organizations with parliamentaryGroup role: 0 I am maybe a bit confused about what a parliamentaryGroup is in relation to a politicalParty. Does parliamentaryGroup refer to a government coalition?

No, this is explained in the Guidelines - we require parliamentaryGroups, and politicalParties are optional. A "hack" is that you just rename @role from the second to the first.

@matyaskopp
Copy link
Collaborator

redundant affiliations: Error: ERROR[01] : affiliation collision: (...) is inside (...) affiliation (line:) member-#government.NO
Does this mean that a person has multiple memberships within the same period? And is this not allowed?

yes. the member-role affiliation is affiliated multiple times at the same time with government.
if you run this from git root directory, you will get numbers of affected lines:

awk '{gsub(/(<[a-zA-Z:]+)/,"& LINE=\"" NR "\"",$0);print}' Data/ParlaMint-NO/ParlaMint-NO.xml \
| java -jar /usr/share/java/saxon.jar -xsl:Scripts/validate-parlamint-particDesc.xsl -s:- 2>&1 \
| grep ERROR

output:

ERROR[01] :928 affiliation collision: (2022-03-04 --- 2022-03-07) is inside (2021-10-14 --- 2022-11-02) affiliation (line:921) member-#government.NO
ERROR[01] :1258 affiliation collision: (2007-10-18 --- 2012-03-23) is inside (2005-10-17 --- 2012-03-23) affiliation (line:1248) member-#government.NO
ERROR[01] :2910 affiliation collision: (2021-09-20 --- 2021-10-14) is inside (2019-01-22 --- 2021-10-14) affiliation (line:2900) member-#government.NO
ERROR[01] :2944 affiliation collision: (2017-03-05 --- 2017-07-02) is inside (2015-12-16 --- 2018-08-13) affiliation (line:2934) member-#government.NO
ERROR[01] :2954 affiliation collision: (2018-03-20 --- 2018-04-04) is inside (2015-12-16 --- 2018-08-13) affiliation (line:2934) member-#government.NO
ERROR[12] :342 Total number of organizations with parliamentaryGroup role: 0

ignore these lines (it is detection of one day overlap, but the message is wrong):

INFO[01] :558 affiliation collision: (2005-10-17 --- 2007-09-21) has one day overlap with (1500-01-01 --- ) affiliation (line:) member-#government.NO

should be

INFO[01] :558 affiliation collision: (2005-10-17 --- 2007-09-21) has one day overlap with (2007-09-21 --- 2008-06-20) affiliation (line:568) member-#government.NO

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

Thanks for the help guys! I found the error - when a person went directly from one ministerial post to another they got two memberships with overlapping dates. I now tried merging the government memberships into one affiliation.

But when doing this I got some new errors. I wonder what you guys think about this case:

Now the validator gives an error on current ministers that have changed jobs. I.e. they have two "minister" affiliation, one with a "to" date and one without, but only one "member" to government. This membership does not have a "to" attribute as it is current.

In these cases I now get an ERROR[18] : Missing implicated affiliation role 'member' but is it not OK to encode the persons like this?

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

An example:

            <affiliation role="minister" from="2021-10-14" to="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges kommunal- og regionalminister</roleName>
            </affiliation>
            <affiliation role="minister" from="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges forsvarsminister</roleName>
            </affiliation>
            <affiliation from="2021-10-14" role="member" ref="#government.NO"/>

@matyaskopp
Copy link
Collaborator

An example of a person that now gives an error:

            <affiliation role="minister" from="2021-10-14" ref="#government.NO">
              <roleName xml:lang="nob">Norges fiskeriminister</roleName>
            </affiliation>
            <affiliation role="minister" from="2022-03-04" to="2022-03-07" ref="#government.NO">
              <roleName xml:lang="nob">Norges arbeidsminister</roleName>
            </affiliation>
            <affiliation from="2021-10-14" to="2022-03-07" role="member" ref="#government.NO"/>```

this affiliation does not have to attribute

<affiliation role="minister" from="2021-10-14" ref="#government.NO">
               <roleName xml:lang="nob">Norges fiskeriminister</roleName>
</affiliation>

so from 2022-03-08 is missing member-role affiliation

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

Does he still need a to attribute if he is still in the job?

@matyaskopp
Copy link
Collaborator

matyaskopp commented Nov 3, 2022

Does he still need a to attribute if he is still in the job?

if he is still in job, then he is still member, but you have to add member-role affiliation

<affiliation from="2021-10-14" to="2022-03-07" role="member" ref="#government.NO"/>

@TomazErjavec
Copy link
Collaborator

Or leave out the @to on member as well.

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

Ah my fault - at first gave a wrong example, and had to update my comment.

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

Sorry about the confusion guys

@tungland
Copy link
Collaborator Author

tungland commented Nov 3, 2022

This is the post I am confused about:

            <affiliation role="minister" from="2021-10-14" to="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges kommunal- og regionalminister</roleName>
            </affiliation>
            <affiliation role="minister" from="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges forsvarsminister</roleName>
            </affiliation>
            <affiliation from="2021-10-14" role="member" ref="#government.NO"/>

@matyaskopp
Copy link
Collaborator

This is the post I am confused about:

            <affiliation role="minister" from="2021-10-14" to="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges kommunal- og regionalminister</roleName>
            </affiliation>
            <affiliation role="minister" from="2022-04-12" ref="#government.NO">
              <roleName xml:lang="nob">Norges forsvarsminister</roleName>
            </affiliation>
            <affiliation from="2021-10-14" role="member" ref="#government.NO"/>

this should work, I have no error for this:

               <person xml:id="person.TEST">
                  <persName>
                     <forename>TEST</forename>
                     <surname>TEST</surname>
                  </persName>                  
                  <affiliation role="minister" from="2021-10-14" to="2022-04-12" ref="#government.NO">
                    <roleName xml:lang="nob">Norges kommunal- og regionalminister</roleName>
                  </affiliation>
                  <affiliation role="minister" from="2022-04-12" ref="#government.NO">
                    <roleName xml:lang="nob">Norges forsvarsminister</roleName>
                  </affiliation>
                  <affiliation from="2021-10-14" role="member" ref="#government.NO"/>
               </person>

@tungland
Copy link
Collaborator Author

tungland commented Nov 4, 2022

Thanks for looking into this! Maybe I'm missing something? Here is a an entry and the corresponding error message:

         <person xml:id="person.MARPER">
            <persName>
              <forename>Marte Mjøs</forename>
              <surname>Persen</surname>
            </persName>
            <sex value="F"/>
            <birth when="1975-04-24"/>
            <affiliation ref="#party.A" role="member"/>
            <affiliation from="2021-10-01" to="2025-09-30" ref="#ST" role="member"/>
            <affiliation role="minister" from="2021-10-14" to="2022-03-07" ref="#government.NO">
              <roleName xml:lang="nob">Norges olje- og energiminister</roleName>
            </affiliation>
            <affiliation role="minister" from="2022-03-07" ref="#government.NO">
              <roleName xml:lang="nob">Norges arbeidsminister</roleName>
            </affiliation>
            <affiliation from="2021-10-14" role="member" ref="#government.NO"/>
          </person> 
ERROR[18] : Missing implicated affiliation role 'member' in person.MARPER affiliation [affiliation role="minister" from="2021-10-14" to="2022-03-07" ref="#government.NO"]
              [roleName xml:lang="nob"]Norges olje- og energiminister[/roleName]
            [/affiliation]

@matyaskopp
Copy link
Collaborator

I am not able to reproduce this error. Can you please update the data in your repository? I will check it then

@tungland tungland closed this Nov 4, 2022
@tungland tungland deleted the data-NO branch November 4, 2022 15:00
@gclux gclux mentioned this pull request Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants