lambdora-service/src/main/java/org/fcrepo/lambdora/service/util/TripleUtil.java
/**
     * This method converts a string (in n-triples format) into a Jena triple
     *
     * @param string containing single n-triples triple
     * @return Triple
     */
This method converts a string (in n-triples format) into a Jena triple
@param string containing single n-triples triple
@return Triple
This method converts a string ( in n - triples format ) into a Jena triple @param string containing single n - triples triple @return Triple
public static Triple toTriple(final String string) {
        Model inputModel = createDefaultModel();
        try {
            inputModel = inputModel.read(new StringInputStream(string), null, strLangNTriples);
        } catch (UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        final Statement stmt = inputModel.listStatements().nextStatement();
        return stmt.asTriple();
    }
public static Triple toTriple ( final String string ) { Model inputModel = createDefaultModel ( ) ; try { inputModel = inputModel . read ( new StringInputStream ( string ) , null , strLangNTriples ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } final Statement stmt = inputModel . listStatements ( ) . nextStatement ( ) ; return stmt . asTriple ( ) ; }
This method converts a string (in n-triples format) into a Jena triple
 @param string containing single n-triples triple
 @return Triple
This method converts a string ( in n - triples format ) into a Jena triple @param string containing single n - triples triple @return Triple
// Create Jena model // Load model with arg string (expecting n-triples) // Since there is only one statement, get it // Return the Jena triple which the statement represents