code: public static boolean exists(URI uri) {
      Preconditions.checkArgument(
          URIBuilder.DATASET_SCHEME.equals(uri.getScheme()),
          "Not a dataset URI: " + uri);
  
      Pair<DatasetRepository, Map<String, String>> pair =
          Registration.lookupDatasetUri(URI.create(uri.getRawSchemeSpecificPart()));
      DatasetRepository repo = pair.first();
      Map<String, String> uriOptions = pair.second();
  
      return repo.exists(
          uriOptions.get(URIBuilder.NAMESPACE_OPTION),
          uriOptions.get(URIBuilder.DATASET_NAME_OPTION));
    }
docs: Check whether a {@link Dataset} identified by the given URI exists.
  <p>
  URIs must begin with {@code dataset:}. The remainder of
  the URI is implementation specific, depending on the dataset scheme.
  
  @param uri a {@code Dataset} URI
  @return {@code true} if the dataset exists, {@code false} otherwise
  @throws NullPointerException if {@code uri} is null
  @throws IllegalArgumentException if {@code uri} is not a dataset URI