From 47d5b6dd1b8854ab77d2b1af0b4524b8d8b98a8a Mon Sep 17 00:00:00 2001 From: Enrico Daga Date: Fri, 7 Jan 2022 12:37:54 +0000 Subject: [PATCH] Code cleaning. See #195 and #196 --- .../spreadsheet/SpreadsheetTriplifier.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/sparql-anything-spreadsheet/src/main/java/com/github/sparqlanything/spreadsheet/SpreadsheetTriplifier.java b/sparql-anything-spreadsheet/src/main/java/com/github/sparqlanything/spreadsheet/SpreadsheetTriplifier.java index ecb76642..070fc751 100644 --- a/sparql-anything-spreadsheet/src/main/java/com/github/sparqlanything/spreadsheet/SpreadsheetTriplifier.java +++ b/sparql-anything-spreadsheet/src/main/java/com/github/sparqlanything/spreadsheet/SpreadsheetTriplifier.java @@ -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 headers_map = new LinkedHashMap(); -// Iterator 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 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(); @@ -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; @@ -156,12 +149,9 @@ private Graph toGraph(Sheet s, String root, String namespace, boolean blank_node Iterator 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 @@ -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))); - } } }