mirror of
https://github.com/ilri/csv-metadata-quality.git
synced 2024-12-22 04:02:19 +01:00
csv_metadata_quality/check.py: Fix AGROVOC lookup
We actually only need to see if there are more than zero matches because a term like "Nigeria" will match in English, Spanish, etc, whereas terms that *really* don't match will have zero results.
This commit is contained in:
parent
1fd3d8bc2f
commit
4e3511cd55
@ -238,8 +238,8 @@ def agrovoc(field):
|
||||
if request.status_code == requests.codes.ok:
|
||||
data = request.json()
|
||||
|
||||
# check if there is 1 result, ie an exact subject term match
|
||||
if len(data['results']) != 1:
|
||||
# check if there are any results
|
||||
if len(data['results']) == 0:
|
||||
print(f'Invalid AGROVOC subject: {value}')
|
||||
|
||||
return field
|
||||
|
Loading…
Reference in New Issue
Block a user