Closed joewiz closed 8 years ago
@awmarrs I found them!
Huzzah!
Closed with https://github.com/HistoryAtState/tags/commit/7cad575052dfddbe8bfcc51888684b8b929a447b.
The procedure:
/db/apps/tags/tagged-resources/frus-tags-todo
Convert exact matches to final format:
xquery version "3.1";
let $studies := collection('/db/apps/tags/tagged-resources/frus-tags-todo')//study
for $tag in $studies//tag[not(@id)]
let $match := doc('/db/apps/tags/taxonomy/taxonomy.xml')//label[. = $tag]/../id
return
if ($match) then
(
update insert attribute id {$match} into $tag,
update value $tag with ''
)
else ()
Merge these into existing frus-tags document (and move non-matches into unofficial-tags-tbd):
xquery version "3.1";
let $frus-tags := doc('/db/apps/tags/tagged-resources/frus/frus-tags.xml')//study
let $new-studies :=
for $study in collection('/db/apps/tags/tagged-resources/frus-tags-todo')//study
let $link := $study/link
let $vol-id := substring-after($link, 'historicaldocuments/')
return
element study {
element title { normalize-space($study/title) },
element link { "https://history.state.gov/historicaldocuments/" || $vol-id },
element tags {
for $tag in $study/tags/tag[@id]
order by $tag/@id
return
element tag { attribute id { $tag/@id } }
},
element unofficial-tags-tbd {
for $tag in distinct-values(($study/tags/tag[not(@id)], $study/unofficial-tags-tbd/tag))
order by $tag
return
element tag { $tag }
}
}
let $re-sorted-studies :=
element studies {
for $study in ($frus-tags, $new-studies)
let $link := $study/link
let $vol-id := substring-after($link, 'historicaldocuments/')
order by $vol-id
return $study
}
return
xmldb:store('/db/apps/tags/tagged-resources/frus', 'frus-tags.xml', $re-sorted-studies)
From the commit message:
This leaves only 8 published volumes without tags:
- frus1889
- frus1890
- frus1891
- frus1892
- frus1893
- frus1902app3 (intern noted this wasn’t available to him/her)
- frus1969-76ve14p2
- frus1977-80v30
(As discussed before, we intentionally did not submit frus1861-99Index & frus1900-18Index for tagging.)
As I did with policy studies tags, I moved all tags that did not have an exact match with entries in the taxonomy into the “unofficial-tags-tbd.” I didn’t proof these for typos / slight differences from the controlled values in the taxonomy. With further proofreading / fuzzy searching, some of these tags could be added and thus available to users of our website.
:tada: This issue has been resolved in version 1.0.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
frus-tags-todo.zip
cleanup-scripts.zip