code: public static Object fromRDF(Object dataset, JsonLdOptions options) throws JsonLdError {
          // handle non specified serializer case
  
          RDFParser parser = null;
  
          if (options.format == null && dataset instanceof String) {
              // attempt to parse the input as nquads
              options.format = JsonLdConsts.APPLICATION_NQUADS;
          }
  
          if (rdfParsers.containsKey(options.format)) {
              parser = rdfParsers.get(options.format);
          } else {
              throw new JsonLdError(JsonLdError.Error.UNKNOWN_FORMAT, options.format);
          }
  
          // convert from RDF
          return fromRDF(dataset, options, parser);
      }
docs: Converts an RDF dataset to JSON-LD.
  
  @param dataset
  a serialized string of RDF in a format specified by the format
  option or an RDF dataset to convert.
  @param options
  the options to use: [format] the format if input is not an
  array: 'application/nquads' for N-Quads (default).
  [useRdfType] true to use rdf:type, false to use @type
  (default: false). [useNativeTypes] true to convert XSD types
  into native types (boolean, integer, double), false not to
  (default: true).
  @return A JSON-LD object.
  @throws JsonLdError
  If there is an error converting the dataset to JSON-LD.