Search in sources :

Example 1 with Cell

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;
}
Also used : ArrayList(java.util.ArrayList) Cell(eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell) ICell(eu.esdihumboldt.hale.io.oml.internal.model.align.ICell) Map(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.AlignmentType.Map) ICell(eu.esdihumboldt.hale.io.oml.internal.model.align.ICell)

Example 2 with Cell

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;
}
Also used : Cell(eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell) ICell(eu.esdihumboldt.hale.io.oml.internal.model.align.ICell) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Aggregations

Cell (eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell)2 ICell (eu.esdihumboldt.hale.io.oml.internal.model.align.ICell)2 About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)1 Map (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.AlignmentType.Map)1 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)1 ArrayList (java.util.ArrayList)1