Skip to content

Commit

Permalink
Code cleaning. See #195 and #196
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Jan 7, 2022
1 parent 6a5ca15 commit 47d5b6d
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,13 @@ private Graph toGraph(Sheet s, String root, String namespace, boolean blank_node
int rown = 0; // this counts the LI index not the spreadsheet rows
LinkedHashMap<Integer, String> headers_map = new LinkedHashMap<Integer, String>();

// Iterator<Row> rowIterator = s.rowIterator();
for (int rowNum = s.getFirstRowNum(); rowNum <= s.getLastRowNum(); rowNum++) {
// while (rowIterator.hasNext()) {
// Header
if (headers && rowNum == 0) {
// Row row = rowIterator.next();
Row row = s.getRow(rowNum);
// Iterator<Cell> cellIterator = row.cellIterator();
int colid = 0;
for (int cellNum = row.getFirstCellNum(); cellNum < row.getLastCellNum(); cellNum++) {
//while (cellIterator.hasNext()) {
colid++;
//Cell cell = (Cell) cellIterator.next();
Cell cell = row.getCell(cellNum);
String colstring = cellToString(cell);
String colname = colstring.strip();
Expand All @@ -141,8 +135,7 @@ private Graph toGraph(Sheet s, String root, String namespace, boolean blank_node
}

}else{
// Data
// if (rowIterator.hasNext()) {
// Data
// Rows
rown++;
Node row;
Expand All @@ -156,12 +149,9 @@ private Graph toGraph(Sheet s, String root, String namespace, boolean blank_node
Iterator<Cell> cellIterator = record.cellIterator();
int colid = 0;
for (int cellNum = record.getFirstCellNum(); cellNum < record.getLastCellNum(); cellNum++) {
// while (cellIterator.hasNext()) {
// Cell cell = cellIterator.next();
Cell cell = record.getCell(cellNum);
String value = cellToString(cell);
colid++;
// System.err.println(colid + " " + value);
Node property;
if (headers && headers_map.containsKey(colid)) {
property = NodeFactory
Expand All @@ -171,7 +161,6 @@ private Graph toGraph(Sheet s, String root, String namespace, boolean blank_node
}

g.add(new Triple(row, property, NodeFactory.createLiteral(value)));

}
}
}
Expand Down

0 comments on commit 47d5b6d

Please sign in to comment.