predicates.add(p);
table.createColumn(p);
}
} else {
Node subject = LangCSV.caculateSubject(rowNum, csvFilePath);
Row row = table.createRow(subject);
row.setValue(table.getColumn(CSV_ROW_NODE), NodeFactory.createLiteral(
(rowNum + ""), XSDDatatype.XSDinteger));
for (int col = 0; col < rowLine.size() && col<predicates.size(); col++) {
String columnValue = rowLine.get(col).trim();
if("".equals(columnValue)){
continue;
}
Node o;
try {
// Try for a double.
double d = Double.parseDouble(columnValue);
o = NodeFactory.createLiteral(columnValue,
XSDDatatype.XSDdouble);
} catch (Exception e) {
o = NodeFactory.createLiteral(columnValue);
}
row.setValue(table.getColumn(predicates.get(col)), o);
}
}
rowNum++;
}
return table;