public void parse(final InputStream in, final TripleConsumer tc,
final String encoding) throws UnsupportedEncodingException {
try {
this.reader = new BufferedReader(new InputStreamReader(in, encoding));
Triple t = this.nextTriple();
// System.out.println(t);
// Triple last=t;
// String lastLine=line;
// int lastPos=pos;
while (t != null) {
// last=t;
// lastLine=line;
// lastPos=pos;
// System.out.println(t);
tc.consume(t);
t = this.nextTriple();
// if (YagoParser.maxTriples > 0
// && counter > YagoParser.maxTriples - 1)
// System.out.println("Last triple:" + t);
if (t != null
&& (t.getSubject() == null || t.getPredicate() == null || t
.getSubject() == null)) {
log.debug("Triple:" + t);
log.debug("Line:" + this.line + "###############pos:"
+ this.pos);
}