All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.digitalcollections.cudami.lobid.client.LobidSubjectsClient Maven / Gradle / Ivy

There is a newer version: 8.0.3
Show newest version
package de.digitalcollections.cudami.lobid.client;

import com.fasterxml.jackson.databind.ObjectMapper;
import de.digitalcollections.cudami.lobid.client.mapper.Lobid2DCModelMapper;
import de.digitalcollections.lobid.model.LobidSubject;
import de.digitalcollections.model.exception.TechnicalException;
import de.digitalcollections.model.identifiable.semantic.Subject;
import java.net.http.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class LobidSubjectsClient extends LobidBaseClient {

  private static final Logger LOGGER = LoggerFactory.getLogger(LobidSubjectsClient.class);

  LobidSubjectsClient(HttpClient http, String serverUrl, ObjectMapper mapper) {
    super(http, serverUrl, LobidSubject.class, mapper);
  }

  public Subject getByGndId(String gndId) throws TechnicalException {
    LobidSubject lobidSubject = doGetRequestForObject(String.format("/gnd/%s.json", gndId));
    Subject subject = Lobid2DCModelMapper.mapToSubject(lobidSubject, null);
    return subject;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy