Skip to content

Commit

Permalink
Merge branch 'development' of github.com:UtrechtUniversity/yoda-rules…
Browse files Browse the repository at this point in the history
…et into development
  • Loading branch information
lwesterhof committed Sep 27, 2023
2 parents e78d7c1 + 7b99910 commit 20348f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
10 changes: 5 additions & 5 deletions json_datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ def get_contributors(combi):
for person in combi.get('Contributor', []):
affiliations = []
for aff in person.get('Affiliation', []):
if isinstance(aff, dict):
if isinstance(aff, dict) and len(aff):
if "Affiliation_Identifier" in aff and len(aff["Affiliation_Identifier"]):
affiliations.append({"name": aff['Affiliation_Name'],
"affiliationIdentifier": '{}'.format(aff['Affiliation_Identifier']),
"affiliationIdentifierScheme": "ROR"})
else:
affiliations.append({'name': aff['Affiliation_Name']})
else:
elif len(aff):
affiliations.append({'name': aff})

name_ids = []
Expand All @@ -293,14 +293,14 @@ def get_contributors(combi):
for person in combi.get('ContactPerson', []):
affiliations = []
for aff in person.get('Affiliation', []):
if isinstance(aff, dict):
if isinstance(aff, dict) and len(aff):
if "Affiliation_Identifier" in aff and len(aff["Affiliation_Identifier"]):
affiliations.append({"name": aff['Affiliation_Name'],
"affiliationIdentifier": '{}'.format(aff['Affiliation_Identifier']),
"affiliationIdentifierScheme": "ROR"})
else:
affiliations.append({'name': aff['Affiliation_Name']})
else:
elif len(aff):
affiliations.append({'name': aff})

name_ids = []
Expand Down Expand Up @@ -445,7 +445,7 @@ def get_geo_locations(combi):
There are two versions of this:
1) Default schema - only textual representation of
2) Geo schema including map (=bounding box or marker/point information) Inclunding temporal and spatial descriptions
2) Geo schema including map (=bounding box or marker/point information) Including temporal and spatial descriptions
Both are mutually exclusive.
I.e. first test presence of 'geoLocation'. Then test presence of 'Covered_Geolocation_Place'
Expand Down
11 changes: 6 additions & 5 deletions meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,12 @@ def update_index_metadata(ctx, path, metadata, creation_time, data_package):

if 'Contributor' in metadata:
for contributor in metadata['Contributor']:
name = contributor['Name']
if 'Given_Name' in name and 'Family_Name' in name:
ctx.msi_add_avu('-C', path, 'Contributor',
name['Given_Name'] + ' ' + name['Family_Name'],
constants.UUFLATINDEX)
if 'Name' in contributor:
name = contributor['Name']
if 'Given_Name' in name and 'Family_Name' in name:
ctx.msi_add_avu('-C', path, 'Contributor',
name['Given_Name'] + ' ' + name['Family_Name'],
constants.UUFLATINDEX)

if 'Tag' in metadata:
for tag in metadata['Tag']:
Expand Down
2 changes: 1 addition & 1 deletion publication.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ def generate_base_DOI(ctx, publication_config, publication_state):


def generate_datacite_json(ctx, publication_state):
"""Generate a DataCite compliant JSON based up yoda-metadata.json.
"""Generate a DataCite compliant JSON based on yoda-metadata.json.
:param ctx: Combined type of a callback and rei struct
:param publication_state: Dict with state of the publication process
Expand Down
4 changes: 2 additions & 2 deletions templates/landingpage.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@
<span>{{ contributor.Name.Family_Name }}, {{ contributor.Name.Given_Name }}</span>
</div>
</div>
{% endif %}

<div class="row">
<div class="col-sm-2">
Expand Down Expand Up @@ -481,6 +480,7 @@
</span>
</div>
</div>
{% endif %}
{% endfor %}

{% for contact in contacts %}
Expand All @@ -493,7 +493,6 @@
<span>{{ contact.Name.Family_Name }}, {{ contact.Name.Given_Name }}</span>
</div>
</div>
{% endif %}

{% if contact.Position %}
<div class="row">
Expand Down Expand Up @@ -553,6 +552,7 @@
</span>
</div>
</div>
{% endif %}
{% endfor %}

<div class="row">
Expand Down

0 comments on commit 20348f8

Please sign in to comment.