Search in sources :

Example 1 with OmlReader

use of eu.esdihumboldt.hale.io.oml.OmlReader in project hale by halestudio.

the class OMLReaderTest method loadAlignment.

private static Alignment loadAlignment(URI sourceSchemaLocation, URI targetSchemaLocation, final URI alignmentLocation) throws IOProviderConfigurationException, IOException {
    // load source schema
    Schema source = readXMLSchema(new DefaultInputSupplier(sourceSchemaLocation));
    // load target schema
    Schema target = readXMLSchema(new DefaultInputSupplier(targetSchemaLocation));
    OmlReader reader = new OmlReader();
    reader.setSourceSchema(source);
    reader.setTargetSchema(target);
    reader.setSource(new DefaultInputSupplier(alignmentLocation));
    reader.validate();
    IOReport report = reader.execute(null);
    assertTrue(report.isSuccess());
    return reader.getAlignment();
}
Also used : DefaultInputSupplier(eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier) Schema(eu.esdihumboldt.hale.common.schema.model.Schema) OmlReader(eu.esdihumboldt.hale.io.oml.OmlReader) IOReport(eu.esdihumboldt.hale.common.core.io.report.IOReport)

Aggregations

IOReport (eu.esdihumboldt.hale.common.core.io.report.IOReport)1 DefaultInputSupplier (eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier)1 Schema (eu.esdihumboldt.hale.common.schema.model.Schema)1 OmlReader (eu.esdihumboldt.hale.io.oml.OmlReader)1