code: public static Object fromRDF(Object input, JsonLdOptions options, RDFParser parser)
              throws JsonLdError {
  
          final RDFDataset dataset = parser.parse(input);
  
          // convert from RDF
          final Object rval = new JsonLdApi(options).fromRDF(dataset);
  
          // re-process using the generated context if outputForm is set
          if (options.outputForm != null) {
              if (JsonLdConsts.EXPANDED.equals(options.outputForm)) {
                  return rval;
              } else if (JsonLdConsts.COMPACTED.equals(options.outputForm)) {
                  return compact(rval, dataset.getContext(), options);
              } else if (JsonLdConsts.FLATTENED.equals(options.outputForm)) {
                  return flatten(rval, dataset.getContext(), options);
              } else {
                  throw new JsonLdError(JsonLdError.Error.UNKNOWN_ERROR,
                          "Output form was unknown: " + options.outputForm);
              }
          }
          return rval;
      }
docs: Converts an RDF dataset to JSON-LD, using a specific instance of
  {@link RDFParser}.
  
  @param input
  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).
  @param parser
  A specific instance of {@link RDFParser} to use for the
  conversion.
  @return A JSON-LD object.
  @throws JsonLdError
  If there is an error converting the dataset to JSON-LD.