/** * Send the content to an output stream. * * @param triples the triples * @param out the output stream * @param subject the subject */ @Override public void write(final Stream<Triple> triples, final OutputStream out, final String subject) { final Writer writer = new OutputStreamWriter(out, UTF_8); try { template .execute(writer, new HtmlData(namespaceService, subject, triples.collect(toList()), css, js, icon)) .flush(); } catch (final IOException ex) { throw new UncheckedIOException(ex); } }
private LabelledTriple labelTriple(final Triple triple) { final String pred = triple.getPredicate().getIRIString(); if (triple.getObject() instanceof IRI) { return new LabelledTriple(triple, getLabel(pred), getLabel(((IRI) triple.getObject()).getIRIString())); } else if (triple.getObject() instanceof Literal) { return new LabelledTriple(triple, getLabel(pred), ((Literal) triple.getObject()).getLexicalForm()); } return new LabelledTriple(triple, getLabel(pred), triple.getObject().ntriplesString()); } }
private LabelledTriple labelTriple(final Triple triple) { final String pred = triple.getPredicate().getIRIString(); if (triple.getObject() instanceof IRI) { return new LabelledTriple(triple, getLabel(pred), getLabel(((IRI) triple.getObject()).getIRIString())); } else if (triple.getObject() instanceof Literal) { return new LabelledTriple(triple, getLabel(pred), ((Literal) triple.getObject()).getLexicalForm()); } return new LabelledTriple(triple, getLabel(pred), triple.getObject().ntriplesString()); } }
/** * Send the content to an output stream. * * @param triples the triples * @param out the output stream * @param subject the subject */ @Override public void write(final Stream<Triple> triples, final OutputStream out, final String subject) { final Writer writer = new OutputStreamWriter(out, UTF_8); try { template .execute(writer, new HtmlData(namespaceService, subject, triples.collect(toList()), css, js, icon)) .flush(); } catch (final IOException ex) { throw new UncheckedIOException(ex); } }