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.1 KiB
28 lines
1.1 KiB
import type { ParserOptions } from "n3";
|
|
import type { Quad } from "@rdfjs/types";
|
|
import { createDatasetFromSerializedInput } from "@ldo/dataset";
|
|
import { createWrapperSubscribableDatasetFactory } from "./createWrapperSubscribableDataset";
|
|
import type WrapperSubscribableDataset from "./WrapperSubscribableDataset";
|
|
|
|
/**
|
|
* 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 default async function createWrapperSubscribableDatasetDataserFromSerializedInput(
|
|
data: string,
|
|
options?: ParserOptions,
|
|
): Promise<WrapperSubscribableDataset<Quad>> {
|
|
const datasetFactory = createWrapperSubscribableDatasetFactory();
|
|
return createDatasetFromSerializedInput<WrapperSubscribableDataset<Quad>>(
|
|
datasetFactory,
|
|
data,
|
|
options,
|
|
);
|
|
}
|
|
|