public String getObjectsAsString ( final Graph graph , final Node subject , final Resource predicate , final boolean uriAsLink ) { LOGGER . trace ( "Getting Objects as String: s:{}, p:{}, g:{}" , subject , predicate , graph ) ; final Iterator < Node > iterator = listObjects ( graph , subject , predicate . asNode ( ) ) ; if ( iterator . hasNext ( ) ) { final Node obj = iterator . next ( ) ; if ( obj . isLiteral ( ) ) { final String lit = obj . getLiteralValue ( ) . toString ( ) ; return lit . isEmpty ( ) ? "<empty>" : lit ; } return uriAsLink ? "&lt;<a href=\"" + obj . getURI ( ) + "\">" + obj . getURI ( ) + "</a>&gt;" : obj . getURI ( ) ; } return "" ; }
Get the string version of the object that matches the given subject and predicate