private void addExtractionTimeSizeMetaTriples(ExtractionContext context)
throws TripleHandlerException {
// adding extraction date
String xsdDateTimeNow = RDFUtils.toXSDDateTime(new Date());
output.receiveTriple(
new URIImpl(documentURI.toString()),
vSINDICE.getProperty(SINDICE.DATE),
ValueFactoryImpl.getInstance().createLiteral(xsdDateTimeNow),
null,
context
);
// adding number of extracted triples
int numberOfTriples = 0;
CompositeTripleHandler cth = (CompositeTripleHandler) output;
for (TripleHandler th : cth.getChilds()) {
if (th instanceof CountingTripleHandler) {
numberOfTriples = ((CountingTripleHandler) th).getCount();
}
}
output.receiveTriple(
new URIImpl(documentURI.toString()),
vSINDICE.getProperty(SINDICE.SIZE),
ValueFactoryImpl.getInstance().createLiteral(numberOfTriples + 1), // the number of triples plus itself
null,
context
);