node.addProperty(RP.type, advice.getType());
node.addProperty(RP.date, advice.getDate());
//save the feedback data
if (advice instanceof SearchFeedback) {
SearchFeedback feedback = (SearchFeedback) advice;
node.addProperty(RP.score,
String.valueOf(feedback.getScore()));
node.addProperty(RP.searchquery, feedback.getFeedbackQuery());
//node.addProperty(RP.issearch, "true");
} else if (advice instanceof DocumentFeedback) {
DocumentFeedback feedback = (DocumentFeedback) advice;
node.addProperty(RP.score,
String.valueOf(feedback.getScore()));
node.addProperty(RP.documentID, feedback.getDocumentID());
node.addProperty(RP.categoryName, feedback.getCategoryName());
node.addProperty(RP.summary, feedback.getSummary());
} else if (advice instanceof CategoryFeedback) {
CategoryFeedback feedback = (CategoryFeedback) advice;
node.addProperty(RP.score,
String.valueOf(feedback.getScore()));
node.addProperty(RP.categoryName, feedback.getCategoryName());
node.addProperty(RP.categoryLocation,
feedback.getCategoryLocation());
}
//write the model
model.write(new FileOutputStream(file));
model.close();