use of eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell in project hale by halestudio.
the class OmlRdfReader method getMap.
/**
* @param map List of the generated maps, containing cell{@link CellType}
* and String about
* @return List of Cells {@link Cell}
*/
private List<ICell> getMap(List<Map> maps) {
List<ICell> cells = new ArrayList<ICell>(maps.size());
Cell cell;
Map map;
Iterator<Map> iterator = maps.iterator();
while (iterator.hasNext()) {
map = iterator.next();
if (map.getCell() != null) {
cell = getCell(map.getCell());
cells.add(cell);
}
}
return cells;
}
use of eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell in project hale by halestudio.
the class OmlRdfReader method getCell.
/**
* converts from {@link CellType} to {@link Cell}
*
* @param cell
* @return
*/
private Cell getCell(CellType cellType) {
Cell cell = new Cell();
List<String> labels = cellType.getLabel();
if (labels != null) {
cell.setLabel(labels);
}
// TODO check with Marian set about as UUID from string about
// cell.setAbout(new About(UUID.fromString(cellType.getAbout())));
About about = new About(UUID.randomUUID());
if (cellType.getAbout() != null) {
about.setAbout(cellType.getAbout());
}
cell.setAbout(about);
// set entity1
if (cellType.getEntity1() != null) {
cell.setEntity1(getEntity(cellType.getEntity1().getEntity()));
}
// set entity2
if (cellType.getEntity2() != null) {
cell.setEntity2(getEntity(cellType.getEntity2().getEntity()));
}
// Measure is optional
if (cellType.getMeasure() != null) {
cell.setMeasure(cellType.getMeasure());
}
// Relation is optional
if (cellType.getRelation() != null) {
cell.setRelation(getRelation(cellType.getRelation()));
}
return cell;
}
Aggregations