Skip to content

Commit

Permalink
chore: use datafactory from n3 (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr authored Dec 13, 2023
1 parent bffab52 commit cb25776
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/rdfjs.internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import RdfJsDataFactory from "@rdfjs/data-model";
import { DataFactory } from "n3";
import type * as RdfJs from "@rdfjs/types";
import type {
BlankNodeId,
Expand All @@ -39,7 +39,7 @@ import type { ToRdfJsOptions } from "./rdfjs";
import type { IriString } from "./interfaces";
import { xmlSchemaTypes } from "./datatypes";

export const DataFactory = RdfJsDataFactory;
export { DataFactory };

type QuadParseOptions = Partial<{
otherQuads: RdfJs.Quad[];
Expand Down Expand Up @@ -356,7 +356,7 @@ export function toRdfJsQuads(
options: ToRdfJsOptions = {},
): RdfJs.Quad[] {
const quads: RdfJs.Quad[] = [];
const dataFactory = options.dataFactory ?? RdfJsDataFactory;
const dataFactory = options.dataFactory ?? DataFactory;

Object.keys(dataset.graphs).forEach((graphIri: IriString) => {
const graph = dataset.graphs[graphIri];
Expand Down Expand Up @@ -386,7 +386,7 @@ export function subjectToRdfJsQuads(
options: ToRdfJsOptions = {},
): RdfJs.Quad[] {
const quads: RdfJs.Quad[] = [];
const dataFactory = options.dataFactory ?? RdfJsDataFactory;
const dataFactory = options.dataFactory ?? DataFactory;

Object.keys(predicates).forEach((predicateIri) => {
const predicateNode = dataFactory.namedNode(predicateIri);
Expand Down

1 comment on commit cb25776

@vercel
Copy link

@vercel vercel bot commented on cb25776 Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

solid-client-js – ./

solid-client-js-inrupt.vercel.app
solid-client.vercel.app
solid-client-js-git-main-inrupt.vercel.app

Please sign in to comment.