Skip to content

Java parser for metadata presented according to LIDO XML Schema

License

Notifications You must be signed in to change notification settings

iliedorobat/LIDO-Parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIDO-Parser

Java parser for metadata presented according to LIDO XML Schema

Requirements

JDK 11+ or OpenJDK 11+
Maven 3.x

Setup

  1. Download and install JDK 11 or OpenJDK 11 (or newer versions)
  2. Download and install Maven 3.x
  3. Clone the repository:
git clone https://github.com/iliedorobat/LIDO-Parser.git
  1. Generate the library:
mvn validate && mvn clean package

Test the library:

java -jar target/LIDO-Parser-1.1-jar-with-dependencies.jar

Example

Parsing:

public class LidoWrapProcessing {
    private static final ParserDAO parserDAO = new ParserDAOImpl();

    public static void parse(String fullPath) {
        LidoWrap lidoWrap = parserDAO.parseLidoFile(fullPath);
        // Get the list of "lido" elements
        ArrayList<Lido> lidoList = lidoWrap.getLidoList();
        
        for (Lido lido : lidoList) {
            ArrayList<LidoRecID> lidoRecIDList = lido.getLidoRecID();
            Category category = lido.getCategory();
            ArrayList<AdministrativeMetadata> administrativeMetadataList = lido.getAdministrativeMetadata();
            ArrayList<DescriptiveMetadata> descriptiveMetadataList = lido.getDescriptiveMetadata();

            // then, you can go deeper to extract administrative/descriptive data, categories and lido ids
        }
    }
}

Serialization using "jackson" library:

public class LidoWrapProcessing {
    private static final ParserDAO parserDAO = new ParserDAOImpl();

    public static void serialize(String inputFullPath, outputPath) {
        LidoWrap lidoWrap = parserDAO.parseLidoFile(inputFullPath);
        ObjectMapper mapper = new ObjectMapper();

        try {
            mapper.writeValue(new File(outputPath), lidoWrap);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

About

Java parser for metadata presented according to LIDO XML Schema

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages