Skip to content

folio-org/lib-linked-data-marc4ld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lib-linked-data-marc4ld

© 2024 EBSCO Information Services.

This software is distributed under the terms of the Apache License, Version 2.0. See the file "LICENSE" for more information.

Introduction

lib-linked-data-marc4ld is a Java Spring library for converting MARC Bibliographic records to Linked Data Graph and vice-versa.

Usage

Convert MARC Bibliographic record to Linked Data Graph

import org.folio.ld.dictionary.model.Resource;
import org.folio.marc4ld.service.marc2ld.bib.MarcBib2ldMapper;
import org.folio.marc4ld.service.marc2ld.bib.MarcBib2ldMapper;
import org.springframework.stereotype.Service;

@Service
public class YourService {

  private final MarcBib2ldMapper mapper;

  public YourService(MarcBib2ldMapper mapper) {
    this.mapper = mapper;
  }

  public void yourMethod(String marcJson) {
    Resource resource = mapper.fromMarcJson(marcJson);
    // ...
    // ...
  }
}

Convert Linked Data Graph to MARC Bibliographic record

import org.folio.ld.dictionary.model.Resource;
import org.folio.marc4ld.service.ld2marc.Bibframe2MarcMapper;
import org.springframework.stereotype.Service;

@Service
public class YourService {
  private final Bibframe2MarcMapper mapper;

  public YourService(Bibframe2MarcMapper mapper) {
    this.mapper = mapper;
  }

  public void yourMethod(Resource resource) {
    String marcJson = mapper.toMarcJson(resource);
    // ...
    // ...
  }
}

Dependencies

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages