You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to use the DataFactory object from the N3 library?
When I naively try new SHACLValidator(shapes, { factory: DataFactory }); I get:
Type 'typeof DataFactory' is not assignable to type 'Factory<Quad, Quad, DatasetCore<Quad, Quad>>'.
Property 'dataset' is missing in type 'typeof DataFactory' but required in type 'DatasetCoreFactory<Quad, Quad, DatasetCore<Quad, Quad>>'. (tsserver 2322)
It did work well for me with rdf-ext but I wanted to avoid converting quad objects back and forth and also the extra dependency if possible.
I am not super experienced with Typescript. Any idea how to fix or work around this?
The text was updated successfully, but these errors were encountered:
export const ExtendedDataFactory = {
...DataFactory,
dataset: quadsToN3Store
}
export function quadsToN3Store(quads: Quad[]): Store {
return new Store(quads);
}
N3 also has a DataSetCoreFactory since recently (see rdfjs/N3.js#314 and https://github.com/rdfjs/N3.js/pull/398/files) but I struggled to use it since it's implemented as a class static function and I (beginner in Typescript, sorry) don't know how to efficiently combine that class with the DatasetFactory required by the SHACLValidator constructor.
Is it possible to use the
DataFactory
object from the N3 library?When I naively try
new SHACLValidator(shapes, { factory: DataFactory });
I get:It did work well for me with rdf-ext but I wanted to avoid converting quad objects back and forth and also the extra dependency if possible.
I am not super experienced with Typescript. Any idea how to fix or work around this?
The text was updated successfully, but these errors were encountered: