private List<URI> getUrisInContext(RepositoryConnection connection, Resource context) throws RepositoryException {
        List<URI> uris = new ArrayList<URI>();

        // Get all triples in the context
        RepositoryResult<Statement> statements = connection.getStatements(null, null, null, false, context);
        while (statements.hasNext()) {
            Statement statement = statements.next();

            // If subject is a URI, add it in if not already present
            Resource subject = statement.getSubject();
            System.out.println("sample==" + subject.stringValue());
            if (subject instanceof URI) {
                URI uri = (URI) subject;

                if (!uris.contains(uri)) {
                    System.out.println("sample2==" + uri.stringValue());
                    uris.add(uri);
                }
            }

            // If object is a URI, add it in if not already present
            Value object = statement.getObject();
            if (object instanceof URI) {
                URI uri = (URI) object;
                if (!uris.contains(uri)) {
                    System.out.println("sample3==" + uri.stringValue());
                    uris.add(uri);
                }
            }
        }
        statements.close();
        System.out.println("STATEMENTS===" + uris.toString());
        return uris;
    }