@Test public void testSimpleSentence() throws Exception { String sentence = "Angela Merkel is the German chancellor."; URI uri = new URI("file: String template = "SELECT * FROM NAMED <http: + $.kb().getUri() + "&doc=" + uri.toString() + "#recognized> WHERE {GRAPH <http: + $.kb().getUri() + "&doc=" + uri.toString() + "#recognized> {?s <" + RDFS_LABEL + "> ?o}}"; Document document = $.pipeline().createDocument(sentence, new URI("file: for(int step = 0; $.pipeline().hasNext(step); step = $.pipeline().execute(step, document)) { } BufferedReader r = new BufferedReader(rdfaGen.serialize(document, $.kb())); for(String line = r.readLine() ; line != null; line = r.readLine()) { System.out.println(line); } r.close(); }
@Override public Reader serialize(Document document, KnowledgeBase kb) throws Exception { switch (document.getMimeType()) { case TEXT: return serializeTextPlain(document, kb, document.getContent()); case HTML: return serializeTextHtml(document, kb, document.getContent()); default: return serializeTextPlain(document, kb, document.getContent()); } }
RDFaSerializer implements Serializer { @Override public Reader serialize(Document document, KnowledgeBase kb) throws Exception { switch (document.getMimeType()) { case TEXT: return serializeTextPlain(document, kb, document.getContent()); case HTML: return serializeTextHtml(document, kb, document.getContent()); default: return serializeTextPlain(document, kb, document.getContent()); } } }
RDFaSerializer implements Serializer { @Override public Reader serialize(Document document, KnowledgeBase kb) throws Exception { switch (document.getMimeType()) { case TEXT: return serializeTextPlain(document, kb, document.getContent()); case HTML: return serializeTextHtml(document, kb, document.getContent()); default: return serializeTextPlain(document, kb, document.getContent()); } }  }
RDFaSerializer implements Serializer { @Override public Reader serialize(Document document, KnowledgeBase kb) throws Exception { switch (document.getMimeType()) { case TEXT: return serializeTextPlain(document, kb, document.getContent()); case HTML: return serializeTextHtml(document, kb, document.getContent()); default: return serializeTextPlain(document, kb, document.getContent()); } }  @Override Reader serialize(Document document, KnowledgeBase kb); }
RDFaSerializer implements Serializer { @Override public Reader serialize(Document document, KnowledgeBase kb) throws Exception { switch (document.getMimeType()) { case TEXT: return serializeTextPlain(document, kb, document.getContent()); case HTML: return serializeTextHtml(document, kb, document.getContent()); default: return serializeTextPlain(document, kb, document.getContent()); } }  @Override Reader serialize(Document document, KnowledgeBase kb);  }