Skip to content
This repository has been archived by the owner on Jan 3, 2019. It is now read-only.

Commit

Permalink
Logging cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Jul 10, 2013
1 parent 253c250 commit 235683b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Expand Up @@ -51,7 +51,7 @@ public void receiveTriple(final Resource s, final URI p, final Value o,
model.createProperty(p.getNamespace(), p.getLocalName()),
objectNode(o));
model.add(triple);
LOGGER.debug("Added triple: {}", triple.asTriple().toString());
LOGGER.trace("Added triple: {}", triple.asTriple().toString());
}

/**
Expand Down
Expand Up @@ -22,10 +22,13 @@
import javax.xml.transform.stream.StreamSource;

import org.apache.any23.extractor.ExtractionException;
import org.apache.any23.extractor.Extractor;
import org.apache.any23.extractor.IssueReport.Issue;
import org.apache.any23.source.ByteArrayDocumentSource;
import org.apache.any23.source.DocumentSource;
import org.apache.any23.writer.TripleHandlerException;
import org.apache.any23.Any23;
import org.apache.any23.ExtractionReport;
import org.fcrepo.triplegenerators.tei.xslt.LoggingErrorListener;
import org.slf4j.Logger;

Expand Down Expand Up @@ -87,7 +90,14 @@ public Dataset getTriples(final InputStream resource)
new ByteArrayDocumentSource(rdfXmlBytes,
"http://dummy.absolute.url", "application/rdf+xml");
try (final ModelTripleHandler handler = new ModelTripleHandler()) {
any23.extract(source, handler);
final ExtractionReport report = any23.extract(source, handler);
for (final Extractor<?> extractor : report.getMatchingExtractors()) {
for (final Issue issue : report.getExtractorIssues(extractor
.getDescription().getExtractorName())) {
LOGGER.error("Extraction issue: ({},{}): {}\n", issue
.getCol(), issue.getRow(), issue.getMessage());
}
}
final Model results = handler.getModel();
return new DatasetImpl(results);
}
Expand Down

0 comments on commit 235683b

Please sign in to comment.