typeHandlers.put(type, handler);
}
public void run(TriplesInputStream stream) throws IOException {
while (true) {
Triple next = stream.nextTriple();
if (next == null) {
if (currentSubject != null) {
handleSubject(currentSubject, currentProps, currentLinks);
}
return;
}
String s = next.getSubject();
// Try to url-decode the subject, errors allowed
try {
s = URLDecoder.decode(s, "utf8");
} catch (IllegalArgumentException e) {
}
// And simplify the namespaces
s = URISimplifier.simplify(next.getSubject());
if (!s.equals(currentSubject)) {
/* New subject, handle the current one before accumulate */
if (currentSubject != null) handleSubject(currentSubject, currentProps, currentLinks);