Add AGROVOC lookup support

This works locally, but I don't think it will work on App Engine
because csv-metadata-quality uses requests-cache and creates the
agrovoc-response-cache.sqlite file in the current working directory.
This commit is contained in:
Alan Orth 2021-03-13 23:49:24 +02:00
parent 9aab2ae83f
commit e7dd8d1421
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9
2 changed files with 14 additions and 0 deletions

View File

@ -57,6 +57,11 @@ def process():
args.append("-x") args.append("-x")
args.append(request.form["excludeText"]) args.append(request.form["excludeText"])
if "agrovocCheckbox" in request.form:
if "agrovocText" in request.form:
args.append("-a")
args.append(request.form["agrovocText"])
if "unsafe" in request.form: if "unsafe" in request.form:
args.append("-u") args.append("-u")

View File

@ -21,6 +21,15 @@
<div id="excludeHelp" class="form-text">Optionally indicate fields to skip during analysis. Separate multiple fields with a comma, for example: <code>dcterms.issued,dcterms.subject</code>.</div> <div id="excludeHelp" class="form-text">Optionally indicate fields to skip during analysis. Separate multiple fields with a comma, for example: <code>dcterms.issued,dcterms.subject</code>.</div>
</div> </div>
<div class="input-group mb-3">
<div class="input-group-text">
Validate field(s) against AGROVOC&nbsp;
<input class="form-check-input" type="checkbox" id="agrovocFieldsCheckbox" name="agrovocCheckbox" aria-label="Checkbox for following text input">
</div>
<input type="text" class="form-control" placeholder="dcterms.subject" id="agrovocFieldsText" name="agrovocText" aria-label="Text input with checkbox">
<div id="agrovocHelp" class="form-text">Optionally indicate fields to validate against <a href="https://agrovoc.uniroma2.it/agrovoc/agrovoc/en/" title="AGROVOC Multilingual Thesaurus">AGROVOC</a>. Separate multiple fields with a comma, for example: <code>dcterms.subject,cg.coverage.country</code>. Note: this can take an extra minute or more depending on your data. If you have a problem please try again and it will generally be faster the second time.</div>
</div>
<div class="mb-3 form-check form-switch"> <div class="mb-3 form-check form-switch">
<input class="form-check-input" type="checkbox" id="unsafeCheckbox" name="unsafe"> <input class="form-check-input" type="checkbox" id="unsafeCheckbox" name="unsafe">
<label class="form-check-label" for="unsafeCheckbox" aria-describedby="unsafeHelp">Enable unsafe fixes</label> <label class="form-check-label" for="unsafeCheckbox" aria-describedby="unsafeHelp">Enable unsafe fixes</label>