code: public static String encode(ImmutableList<TargetAtom> body, PrefixManager prefixManager) {
  
  		TurtleWriter turtleWriter = new TurtleWriter();
  		for (TargetAtom atom : body) {
  			String subject, predicate, object = "";
  			String originalString = atom.getProjectionAtom().getPredicate().toString();
  			if (isUnary(atom.getProjectionAtom())) {
  				ImmutableTerm subjectTerm = atom.getSubstitutedTerm(0);
  				subject = getDisplayName(subjectTerm, prefixManager);
  				predicate = "a";
  				object = getAbbreviatedName(originalString, prefixManager, false);
  				if (originalString.equals(object)) {
  					object = "<" + object + ">";
  				}
  			}
  			else if (originalString.equals("triple")) {
                  ImmutableTerm subjectTerm = atom.getSubstitutedTerm(0);
                  subject = getDisplayName(subjectTerm, prefixManager);
                  ImmutableTerm predicateTerm = atom.getSubstitutedTerm(1);
                  predicate = getDisplayName(predicateTerm, prefixManager);
                  ImmutableTerm objectTerm = atom.getSubstitutedTerm(2);
                  object = getDisplayName(objectTerm, prefixManager);
  			}
  			else {
                  ImmutableTerm subjectTerm = atom.getSubstitutedTerm(0);
  				subject = getDisplayName(subjectTerm, prefixManager);
  				predicate = getAbbreviatedName(originalString, prefixManager, false);
  				if (originalString.equals(predicate)) {
  					predicate = "<" + predicate + ">";
  				}
                  ImmutableTerm objectTerm = atom.getSubstitutedTerm(1);
  				object = getDisplayName(objectTerm, prefixManager);
  			}
  			turtleWriter.put(subject, predicate, object);
  		}
  		return turtleWriter.print();
  	}
docs: Transforms the given <code>OBDAQuery</code> into a string. The method requires
  a prefix manager to shorten full IRI name.