Skip to content

Commit

Permalink
Add Library of Congress NAF as Author identifier (#9812)
Browse files Browse the repository at this point in the history
* Add Library of Congress NAF as Author identifier

Adds Library of Congress Name Authority File (LC NAF) as an Author identifier.

The `label` has been shortened to just “Library of Congress” to
avoid having an obscenely long label in the drop-down lists and
also avoid obscure acronyms (“NAF”) in it that are likely to
cause more confusion than clarity.

The URI identifiers given by LoC themselves start with “http://” but I
have opted to use “https://” for the `url` so patrons etc. won’t need a
redirect or similar to get to the page.

Closes #9791

* Add auto select for LOC NAF Author identifiers

Adds an entry for `loc_naf` (Library of Congress Name Authority File)
identifiers to the `identifierPatterns` lookup table to enable
autoselection when entering the identifiers.

* Update LoC NAF identifier label+name

Per #9812 (comment)

Co-authored-by: Tom Morris <tfmorris@gmail.com>

* Update lc_naf author autoselection regex

Per #9812 (comment)

Co-authored-by: Tom Morris <tfmorris@gmail.com>

---------

Co-authored-by: Tom Morris <tfmorris@gmail.com>
  • Loading branch information
Freso and tfmorris authored Aug 28, 2024
1 parent 8780881 commit e7c202d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions openlibrary/components/AuthorIdentifiers.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
const identifierPatterns = {
wikidata: /^Q[1-9]\d*$/i,
isni: /^[0]{4} ?[0-9]{4} ?[0-9]{4} ?[0-9]{3}[0-9X]$/i,
lc_naf: /^n[bors]?[0-9]+$/,
amazon: /^B[0-9A-Za-z]{9}$/,
youtube: /^@[A-Za-z0-9_\-.]{3,30}/,
}
Expand Down
5 changes: 5 additions & 0 deletions openlibrary/plugins/openlibrary/config/author/identifiers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ identifiers:
notes: two formats depending on if the author exists in wikidata, wd:Q42 or inv:914ad8068b8711ead0cc2efbed56e53c
url: https://inventaire.io/entity/@@@
website: https://inventaire.io/
- label: Library of Congress Names
name: lc_naf
notes: Should be something like nr92001540, no97027235, etc. (/^n[a-z]?[0-9]+$/)
url: https://id.loc.gov/authorities/names/@@@
website: https://id.loc.gov/authorities/names.html
- label: LibraryThing
name: librarything
notes: Should be something like kingstephen-1
Expand Down

0 comments on commit e7c202d

Please sign in to comment.