private void exportTriples(Iterable<Triple> triples, RDFHandler handler) throws RDFHandlerException { handler.startRDF(); addNamespaces(handler); populateRepository(triples, handler); handler.endRDF(); }
private void populateRepository(Iterable<Triple> triples, RDFHandler handler) throws RDFHandlerException { RDFModelFormater.TripleFormater translator = new TripleFormater(baseURI); for (Triple t : triples) { handler.handleStatement(translator.formatTriple(t)); } }
private void addNamespaces(RDFHandler handler) throws RDFHandlerException { for (String prefix : namespaces.getDeclaredPrefixes()) { handler.handleNamespace(prefix, namespaces.getNamespaceURI(prefix)); } }