You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.0 KiB
28 lines
1.0 KiB
import type { Quad } from "@rdfjs/types";
|
|
import type { ParserOptions } from "@ldo/rdf-utils";
|
|
import { createDatasetFromSerializedInput } from "@ldo/dataset";
|
|
import { createSubscribableDatasetFactory } from "./createSubscribableDataset";
|
|
import type { ISubscribableDataset } from "./types";
|
|
|
|
/**
|
|
* Creates a SubscribableDataset with a string input that could be JSON-LD, Turtle, N-Triples, TriG, RDF*, or N3.
|
|
* @param data A string representation of RDF Data in JSON-LD, Turtle, N-Triples, TriG, RDF*, or N3.
|
|
* @param options Parser options: {
|
|
* format?: string;
|
|
* factory?: RDF.DataFactory;
|
|
* baseIRI?: string;
|
|
* blankNodePrefix?: string;
|
|
* }
|
|
* @returns A dataset
|
|
*/
|
|
export async function createWrapperSubscribableDatasetFromSerializedInput(
|
|
data: string,
|
|
options?: ParserOptions,
|
|
): Promise<ISubscribableDataset<Quad>> {
|
|
const datasetFactory = createSubscribableDatasetFactory();
|
|
return createDatasetFromSerializedInput<ISubscribableDataset<Quad>>(
|
|
datasetFactory,
|
|
data,
|
|
options,
|
|
);
|
|
}
|
|
|