Beispiel #1
0
 private void exportTriples(Iterable<Triple> triples, RDFHandler handler)
     throws RDFHandlerException {
   handler.startRDF();
   addNamespaces(handler);
   populateRepository(triples, handler);
   handler.endRDF();
 }
Beispiel #2
0
 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));
   }
 }
Beispiel #3
0
 private void addNamespaces(RDFHandler handler) throws RDFHandlerException {
   for (String prefix : namespaces.getDeclaredPrefixes()) {
     handler.handleNamespace(prefix, namespaces.getNamespaceURI(prefix));
   }
 }