lambdora-service/src/main/java/org/fcrepo/lambdora/service/util/TripleUtil.java
/**
     * This method translates a Jena Triple into its n-triples string
     *
     * @param triple to convert to a String
     * @return string
     */
This method translates a Jena Triple into its n-triples string
@param triple to convert to a String
@return string
This method translates a Jena Triple into its n - triples string @param triple to convert to a String @return string
public static String fromTriple(final Triple triple) {
        final Model model = createDefaultModel();
        model.add(model.asStatement(triple));
        final ByteArrayOutputStream out = new ByteArrayOutputStream();
        RDFDataMgr.write(out, model.getGraph(), Lang.NTRIPLES);
        try {
            return out.toString(UTF_8.name());
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        } finally {
            try {
                out.close();
            } catch (IOException e) {
            }
        }
    }
public static String fromTriple ( final Triple triple ) { final Model model = createDefaultModel ( ) ; model . add ( model . asStatement ( triple ) ) ; final ByteArrayOutputStream out = new ByteArrayOutputStream ( ) ; RDFDataMgr . write ( out , model . getGraph ( ) , Lang . NTRIPLES ) ; try { return out . toString ( UTF_8 . name ( ) ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } finally { try { out . close ( ) ; } catch ( IOException e ) { } } }
This method translates a Jena Triple into its n-triples string
 @param triple to convert to a String
 @return string
This method translates a Jena Triple into its n - triples string @param triple to convert to a String @return string
// Create the Jena model // Add the triple to the model // Write the model to an outputstream // Return the result // TODO: Log this error