code: @Override
      public boolean hasStatement(Resource subject, URI predicate, Value object, boolean includeInferred, Resource... contexts) throws RepositoryException {
          if(!this.isOpen()){throw new RepositoryException("Connection is closed.");}
          String queryString = null;
          if(contexts == null) {
              queryString="ASK { GRAPH ?ctx { ?s ?p ?o } filter (?ctx = (IRI(\""+DEFAULT_GRAPH_URI+"\")))}";
          }else if (contexts.length == 0) {
              queryString = SOMETHING;
          }
          else {
              StringBuilder sb= new StringBuilder();
              sb.append("ASK { GRAPH ?ctx { ?s ?p ?o } filter (?ctx = (");
                  boolean first = true;
                  for (Resource context : contexts) {
                      if (first) {
                          first = !first;
                      }
                      else {
                          sb.append(",");
                      }
                      if (context == null) {
                          sb.append("IRI(\""+DEFAULT_GRAPH_URI+"\")");
                      } else {
                          sb.append("IRI(\"" + context.toString() + "\")");
                      }
                  }
                  sb.append(") ) }");
              queryString = sb.toString();
          }
          try {
              logger.debug(queryString);
              MarkLogicBooleanQuery query = prepareBooleanQuery(queryString); // baseuri ?
  
              setBindings(query, subject, predicate, object, contexts);
              return query.evaluate();
          }
          catch (MalformedQueryException e) {
              throw new RepositoryException(e);
          }
          catch (QueryEvaluationException e) {
              throw new RepositoryException(e);
          }
      }
docs: returns true or false if a statement exists in repository / context
  
  TBD- should refactor
  
  @param subject
  @param predicate
  @param object
  @param includeInferred
  @param contexts
  @return boolean
  @throws RepositoryException