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

documents: remove unnecessary properties #131

Merged
merged 1 commit into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions sonar/modules/documents/dojson/contrib/marc21tojson/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,6 @@ def marc21_to_title(self, key, value):
return main_title


@marc21tojson.over('titlesProper', '^730..')
@utils.for_each_value
@utils.ignore_value
def marc21_to_titlesProper(self, key, value):
"""Test dojson marc21titlesProper.

titleProper: 730$a
"""
return not_repetitive(marc21tojson.bib_id, key, value, 'a')


@marc21tojson.over('authors', '[17][01]0..')
@utils.for_each_value
@utils.ignore_value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -995,17 +995,6 @@
"type": "string",
"minLength": 1
},
"titlesProper": {
"title": "Proper or uniformed titles",
"description": "Uniform title, a related or an analytical title that is controlled by an authority file or list, used as an added access point.",
"type": "array",
"minItems": 1,
"items": {
"title": "Proper or uniformed title",
"type": "string",
"minLength": 1
}
},
"is_part_of": {
"title": "Is part of",
"description": "Title of the host document.",
Expand Down Expand Up @@ -1042,17 +1031,6 @@
}
}
},
"translatedFrom": {
"title": "Translated from",
"description": "Language from which a resource is translated.",
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 2,
"validationMessage": "Should be in the ISO 639 format, with 3 characters, ie <code>eng</code> for English."
}
},
"authors": {
"title": "Authors",
"description": "Author(s) of the resource. Can be either persons or organisations.",
Expand Down
25 changes: 0 additions & 25 deletions sonar/modules/documents/mappings/v6/documents/document-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,28 +74,6 @@
"analyzer": "autocomplete",
"search_analyzer": "standard"
},
"titlesProper": {
"type": "text",
"analyzer": "global_lowercase_asciifolding",
"fields": {
"eng": {
"type": "text",
"analyzer": "english"
},
"fre": {
"type": "text",
"analyzer": "french"
},
"ger": {
"type": "text",
"analyzer": "german"
},
"ita": {
"type": "text",
"analyzer": "italian"
}
}
},
"type": {
"type": "keyword"
},
Expand Down Expand Up @@ -132,9 +110,6 @@
}
}
},
"translatedFrom": {
"type": "keyword"
},
"authors": {
"type": "object",
"properties": {
Expand Down
5 changes: 0 additions & 5 deletions sonar/modules/documents/templates/documents/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ <h5 class="text-secondary">{{ record.institution.name }}</h5>
{{ dl(_('Series'), record.series|series_format) }}
{% endif %}

<!-- UNIFORM TITLE -->
{% if record.titlesProper|length > 0 %}
{{ dl(_('Uniform title'), record.titlesProper|join('; ')) }}
{% endif %}

<!-- IS PART OF -->
{% if record.is_part_of %}
{{ dl(_('Is part of'), record.is_part_of) }}
Expand Down
30 changes: 0 additions & 30 deletions tests/ui/documents/test_marc21tojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,36 +201,6 @@ def test_marc21_to_title():
assert data.get('title') == 'main title'


# titleProper: [730$a repetitive]
def test_marc21_to_titles_proper():
"""Test dojson marc21titlesProper."""

marc21xml = """
<record>
<datafield tag="730" ind1="1" ind2="0">
<subfield code="a">proper title</subfield>
</datafield>
</record>
"""
marc21json = create_record(marc21xml)
data = marc21tojson.do(marc21json)
assert data.get('titlesProper') == ['proper title']

marc21xml = """
<record>
<datafield tag="730" ind1=" " ind2=" ">
<subfield code="a">proper title</subfield>
</datafield>
<datafield tag="730" ind1=" " ind2=" ">
<subfield code="a">other proper title</subfield>
</datafield>
</record>
"""
marc21json = create_record(marc21xml)
data = marc21tojson.do(marc21json)
assert data.get('titlesProper') == ['proper title', 'other proper title']


# languages: 008 and 041 [$a, repetitive]
def test_marc21_to_language():
"""Test dojson marc21languages."""
Expand Down