DlgpWriter extends AbstractGraalWriter { protected void writePredicate(Predicate p) throws IOException { if (p.equals(Predicate.TOP)) { p = top; } this.writeLowerIdentifier(p.getIdentifier()); } DlgpWriter();  DlgpWriter(OutputStream out);  DlgpWriter(Writer out);  DlgpWriter(File file);  DlgpWriter(String path); DlgpWriter write(Directive d); @Override DlgpWriter writeComment(String comment); @Override DlgpWriter write(AtomSet atomset); @Override DlgpWriter write(Atom atom); @Override DlgpWriter write(Rule rule); @Override DlgpWriter write(NegativeConstraint constraint); @Override DlgpWriter write(ConjunctiveQuery query); @Override DlgpWriter write(Prefix prefix); static String writeToString(Object o);  }
@Test public void writePredicate() throws IOException { Predicate p = new Predicate("P", 1); ByteArrayOutputStream os = new ByteArrayOutputStream(); DlgpWriter writer = new DlgpWriter(os); writer.write(new DefaultAtom(p, cst)); writer.flush(); String s = new String(os.toByteArray(),"UTF-8"); writer.close(); Character c = s.charAt(0); Assert.assertTrue("Predicate label does not begin with lower case or double quote.", Character.isLowerCase(c) || c == '<'); }