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

no.unit.nva.api.PublicationContext Maven / Gradle / Ivy

There is a newer version: 0.23.2
Show newest version
package no.unit.nva.api;

import static no.unit.nva.DatamodelConfig.dataModelObjectMapper;
import static nva.commons.core.attempt.Try.attempt;
import com.fasterxml.jackson.databind.JsonNode;
import no.unit.nva.model.Publication;

public class PublicationContext {

    public static JsonNode getContext(Publication publication) {
        return attempt(() -> dataModelObjectMapper.readTree(publication.getJsonLdContext())).orElseThrow();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy