// for this import entry
Map<String, RelationshipRow> relationshipMap = new HashMap<String, RelationshipRow>();
Map<String, RefsetRow> cdMap = new HashMap<String, RefsetRow>();
RF2Input input = (RF2Input) entry.getInput();
InputType inputType = input.getInputType();
Set<String> conceptsFiles = input.getConceptsFiles();
log.info("Read concepts info");
for(String conceptsFile : conceptsFiles) {
final String message = "Unable to load concepts file. " +
"Please check your input configuration file. " +
"(input type = "+inputType+", file="+conceptsFile+")";
try {
loadConceptRows(modMap, conceptMap, input.getInputStream(conceptsFile));
} catch (NullPointerException e) {
log.error(message, e);
throw new ImportException(message, e);
} catch (IOException e) {
log.error(message, e);
throw new ImportException(message, e);
}
}
// Load relationships
Set<String> relationshipsFiles = input.getStatedRelationshipsFiles();
if(relationshipsFiles == null || relationshipsFiles.isEmpty()) {
log.info("Read inferred relationships info");
relationshipsFiles = input.getRelationshipsFiles();
} else {
log.info("Read stated relationships info");
}
if(relationshipsFiles == null || relationshipsFiles.isEmpty()) {
throw new ImportException("No relationships files was specified.");
}
for(String relationshipsFile : relationshipsFiles) {
final String message = "Unable to load relationships file. Please check your input configuration " +
"file. (input type = " + inputType+", file=" + relationshipsFile+")";
try {
loadRelationshipRows(modMap, relationshipMap, input.getInputStream(relationshipsFile));
} catch (NullPointerException e) {
log.error(message, e);
throw new ImportException(message, e);
} catch (IOException e) {
log.error(message, e);
throw new ImportException(message, e);
}
// Load concrete domains refsets
log.info("Read concrete domains reference set info");
for (String filename : input.getConcreteDomainRefsetFiles()) {
try {
loadReferenceSet(input, filename, modMap, cdMap, IRefsetFactory.CD);
} catch (ArrayIndexOutOfBoundsException e) {
final String msg = "Error loading concrete domains reference set: " + filename +
". Possibly has wrong number of columns.";