private Set<String> findUris(Graph graph) {
        Set<String> result = new HashSet<>();
        for (Triple t : graph.iterate()) {
            try {
                String object = t.getObject().toString().replace("<", "").replace(">", "");
                // check for valid uri
                new URL(object).toURI();
                result.add(object);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
private Set<String> findUris(Graph graph) {
        Set<String> result = new HashSet<>();
        for (Triple t : graph.iterate()) {
            try {
                String object = t.getObject().toString().replace("<", "").replace(">", "");
               
                new URL(object).toURI();
                result.add(object);
            } catch (MalformedURLException e) {
                e.printStackTrace();
            } catch (URISyntaxException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
private set<string> finduris(graph graph) { set<string> result = new hashset<>(); for (triple t : graph.iterate()) { try { string object = t.getobject().tostring().replace("<", "").replace(">", ""); new url(object).touri(); result.add(object); } catch (malformedurlexception e) { e.printstacktrace(); } catch (urisyntaxexception e) { e.printstacktrace(); } } return result; }