diff --git a/Gemfile b/Gemfile index 3040431..510e83e 100644 --- a/Gemfile +++ b/Gemfile @@ -2,3 +2,5 @@ source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins gem 'jekyll-seo-tag' gem "webrick", "~> 1.8" +# See https://github.com/ffi/ffi/issues/1103 +gem "ffi", "< 1.17.0" \ No newline at end of file diff --git a/README.textile b/README.textile index c4b6ba2..d8fd758 100644 --- a/README.textile +++ b/README.textile @@ -14,7 +14,7 @@ Quick setup: Start server locally when working on a draft: -@bundle exec jekyll serve --drafts --watch@ +@bundle exec jekyll serve --drafts --future --watch@ Open "http://localhost:4000":http://localhost:4000 diff --git a/_posts/2024-06-24-custom-gnd-suggests.md b/_posts/2024-06-24-custom-gnd-suggests.md new file mode 100644 index 0000000..5ed05ec --- /dev/null +++ b/_posts/2024-06-24-custom-gnd-suggests.md @@ -0,0 +1,73 @@ +--- +layout: post +title: "Customize your GND autosuggests" +date: 2024-06-24 +author: Adrian Pohl +tags: lobid-gnd +--- + +Recently, the current lookup options in lobid-gnd turned out to not be enough for a use case we were facing. We needed to associate date and place of a person's birth/death but couldn't. So we added this option for everyone to benefit from. Now, you can get auto-suggests for GND persons that include a good overview of birth/death dates and places, occupations/professions and places of activity. They might for example look like this: + +![Suggest list of different persons for query 'rowohlt' containing the named information with unicode icons fr birth and death](/images/20240624-custom-gnd-suggests/rpb-strapi-screenshot.png) + +### How do I make lobid return a custom autosuggest format? + +We have documented the configuration of such a customized GND autosuggest string in the [API documentation](https://lobid.org/gnd/api#auto-complete). + +For example, here is the query that returns autosuggestions like the above: [`rowohlt+AND+type:Person&format=json:preferredName,*_dateOfBirth+_placeOfBirth,†_dateOfDeath+_placeOfDeath,placeOfActivity,professionOrOccupation`](https://lobid.org/gnd/search?q=rowohlt+AND+type:Person&format=json%3ApreferredName,*_dateOfBirth+_placeOfBirth,%E2%80%A0_dateOfDeath+_placeOfDeath,placeOfActivity,professionOrOccupation) + +The reponse to this query looks like this: + +```json +[ { + "label" : "Rowohlt, Hilda | † 1943", + "id" : "https://d-nb.info/gnd/116004595X", + "category" : "Individualisierte Person" +}, { + "label" : "Rowohlt, Charlotta | Schauspielerin", + "id" : "https://d-nb.info/gnd/124750848X", + "category" : "Individualisierte Person" +}, { + "label" : "Rowohlt, Heinrich", + "id" : "https://d-nb.info/gnd/139303960", + "category" : "Individualisierte Person" +}, { + "image" : "https://commons.wikimedia.org/wiki/Special:FilePath/HARRYROW.jpg?width=100", + "label" : "Rowohlt, Harry | * 1945 Hamburg | † 2015 Hamburg | Schriftsteller; Lyriker; Verleger; Journalist; Sprecher; Übersetzer", + "id" : "https://d-nb.info/gnd/107828553", + "category" : "Individualisierte Person" +}, { + "label" : "Rowohlt, Hilde", + "id" : "https://d-nb.info/gnd/116667230", + "category" : "Individualisierte Person" +}, { + "label" : "Rowohlt, Ernst | * 1887 Bremen | † 1960 Hamburg | Leipzig; Berlin | Verleger", + "id" : "https://d-nb.info/gnd/118603493", + "category" : "Individualisierte Person" +}, { + "label" : "Pierenkämper-Rowohlt, Maria | * 1910 | † 2005 | Hamburg-Volksdorf | Schauspielerin", + "id" : "https://d-nb.info/gnd/116184620", + "category" : "Individualisierte Person" +}, { + "label" : "Ledig-Rowohlt, Heinrich Maria | * 1908 Leipzig | † 1992 Delhi | Verleger", + "id" : "https://d-nb.info/gnd/118570757", + "category" : "Individualisierte Person" +}, { + "label" : "Ledig-Rowohlt, Jane | † 1994 | Hamburg", + "id" : "https://d-nb.info/gnd/116853166", + "category" : "Individualisierte Person" +}, { + "label" : "Pierenkämpfer, Maria | * [19XX] | Schauspielerin", + "id" : "https://d-nb.info/gnd/1329213513", + "category" : "Individualisierte Person" +} ] +``` + +Basically, as with autosuggest queries before, you have to configure the response payload by using the `format=json` parameter, add a trailing colon and then the configuration bit which in our case is `preferredName,*_dateOfBirth+_placeOfBirth,†_dateOfDeath+_placeOfDeath,placeOfActivity,professionOrOccupation`. + +As usual, you have a comma-seperated list of all the field contents you want to be returned. The additional option is provided by allowing to use `_{field}` with the addition of custom characters like "†". I could also use "born in"/"died in" instead, like this: [`preferredName,born in_dateOfBirth,placeOfBirth,died in_dateOfDeath,placeOfDeath,placeOfActivity,professionOrOccupation`](https://lobid.org/gnd/search?q=rowohlt+AND+type:Person&format=json%3ApreferredName,born in_dateOfBirth,placeOfBirth,died in_dateOfDeath,placeOfDeath,placeOfActivity,professionOrOccupation) + +We hope that others will also benefit from this option. Let us know if you like it. + + +*This feature was added in the context of a project where we are building a new editorial backend for the regional bibliography and person database of Rhineland-Palatinate ([RPB](https://rpb.lbz-rlp.de/) & [RPPD](https://rppd.lobid.org)). For looking up GND IDs in the [Strapi](https://strapi.io/)-based editorial backend, we are relying on the lobid-gnd API. We were happy to play back the needed improvements for the lookups into the lobid-gnd service.* \ No newline at end of file diff --git a/css/main.css b/css/main.css index b60b73e..baf74e5 100644 --- a/css/main.css +++ b/css/main.css @@ -64,6 +64,7 @@ code { padding: 2px 4px; background-color: #f5f5f5; font-size: smaller; + word-wrap: break-word; } img { diff --git a/images/20240624-custom-gnd-suggests/rpb-strapi-screenshot.png b/images/20240624-custom-gnd-suggests/rpb-strapi-screenshot.png new file mode 100644 index 0000000..491a1a8 Binary files /dev/null and b/images/20240624-custom-gnd-suggests/rpb-strapi-screenshot.png differ