correct JSON-LD media type

main
elf Pavlik 2 years ago
parent 7c0e9bbeaf
commit 7d0d7451de
  1. 2
      packages/dataset/example/loadDataExample.ts
  2. 4
      packages/dataset/test/createExtendedDatasetFromSerializedInput.test.ts
  3. 2
      packages/ldo/src/parseRdf.ts
  4. 2
      packages/rdf-utils/src/serializedToQuads.ts
  5. 2
      packages/subscribable-dataset/Readme.md
  6. 2
      packages/subscribable-dataset/test/createSubscribableDatasetFromSerializedInput.test.ts

@ -34,7 +34,7 @@ async function run(): Promise<void> {
const jsonLdDataset = await serializedToDataset(JSON.stringify(jsonLdData), {
baseIRI:
"https://jackson.solidcommunity.net/IndividualChats/jackson.solidcommunity.net/index.ttl#",
format: "application/json-ld",
format: "application/ld+json",
});
// Returns true because the input data describes the same triple.
console.log(turtleDataset.equals(jsonLdDataset));

@ -12,7 +12,7 @@ describe("createExtendedDatasetFromSerializedInput", () => {
it.skip("creates a dataset with json-ld", async () => {
const dataset = await serializedToDataset(JSON.stringify(jsonLdData), {
format: "application/json-ld",
format: "application/ld+json",
});
expect(dataset.size).toBe(9);
});
@ -26,7 +26,7 @@ describe("createExtendedDatasetFromSerializedInput", () => {
it.skip("Should error when given invalid JSON", async () => {
await expect(
serializedToDataset('{ bad" json', { format: "application/json-ld" }),
serializedToDataset('{ bad" json', { format: "application/ld+json" }),
).rejects.toThrow("Unexpected token b in JSON at position 2");
});
});

@ -47,7 +47,7 @@ export async function parseRdf(
ldoDatasetFactory,
JSON.stringify(data),
{
format: "application/json-ld",
format: "application/ld+json",
},
);
}

@ -9,7 +9,7 @@ export async function serializedToQuads(
options?: ParserOptions,
): Promise<Quad[]> {
// JSON-LD Parsing
if (options && options.format === "application/json-ld") {
if (options && options.format === "application/ld+json") {
throw new Error("Not Implemented");
// return new Promise((resolve, reject) => {
// JSON.parse(data);

@ -86,7 +86,7 @@ async function run(): Promise<void> {
{
baseIRI:
"https://jackson.solidcommunity.net/IndividualChats/jackson.solidcommunity.net/index.ttl#",
format: "application/json-ld",
format: "application/ld+json",
}
);
// Returns true because the input data describes the same triple.

@ -11,7 +11,7 @@ describe("createExtendedDatasetFromSerializedInput", () => {
const dataset = await serializedToSubscribableDataset(
JSON.stringify(jsonLdData),
{
format: "application/json-ld",
format: "application/ld+json",
},
);
expect(dataset.size).toBe(9);

Loading…
Cancel
Save