eq.rightExpr.toString(prefixInstance) };
}
tablesJTable[indexJTables++] = generateTable(rows, tableHead,
operatorGraph);
} else if (qr instanceof RuleResult) {
final RuleResult gr = (RuleResult) qr;
int max = 0;
for (final Predicate p : gr.getPredicateResults()) {
max = Math.max(max, p.getParameters().size());
}
final String[] tableHead = new String[max + 1];
tableHead[0] = "Predicate";
for (int i = 1; i < max + 1; i++) {
tableHead[i] = "Arg. " + i;
}
final Object[][] rows = new Object[gr.getPredicateResults()
.size()][];
int i = 0;
for (final Predicate p : gr.getPredicateResults()) {
final Object[] row = new Object[max + 1];
if (operatorGraph == null) {
final LuposDocument document = new LuposDocument();
final LuposJTextPane textPane = new LuposJTextPane(document);
document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
textPane.setText(p.getName().toString(prefixInstance));
textPane.setEditable(false);
row[0] = textPane;
} else {
row[0] = p.getName().toString(prefixInstance);
}
int index = 1;
for (final Literal l : p.getParameters()) {
if (operatorGraph == null) {
final LuposDocument document = new LuposDocument();
final LuposJTextPane textPane = new LuposJTextPane(document);
document.init(TurtleParser.createILuposParser(new LuposDocumentReader(document)), false);
textPane.setText(l.toString(prefixInstance));
textPane.setEditable(false);
row[index++] = textPane;
} else {
row[index++] = l.toString(prefixInstance);
}
}
for (int i2 = index; i2 < max + 1; i2++) {
row[i2] = "";
}
rows[i++] = row;
}
tablesJTable[indexJTables++] = generateTable(rows, tableHead,
operatorGraph);
} else if (qr instanceof GraphResult) {
final GraphResult gr = (GraphResult) qr;
final String[] tableHead = { "Subject", "Predicate", "Object" };
final Object[][] rows = new Object[gr.getGraphResultTriples()
.size()][];
int i = 0;
for (final Triple t : gr.getGraphResultTriples()) {
if (operatorGraph == null) {
final LuposDocument documentSubject = new LuposDocument();
final LuposJTextPane textPaneSubject = new LuposJTextPane(documentSubject);
documentSubject.init(TurtleParser.createILuposParser(new LuposDocumentReader(documentSubject)), false);
textPaneSubject.setText(t.getSubject().toString(prefixInstance));