fix: rdf convertors should not read or write plain JSON

This commit is contained in:
Thomas Dupont
2022-06-28 13:39:35 +02:00
committed by Joachim Van Herwegen
parent dacd6d0006
commit 9ecb769e09
2 changed files with 11 additions and 3 deletions

View File

@@ -13,7 +13,10 @@ import type { RepresentationConverterArgs } from './RepresentationConverter';
*/
export class RdfToQuadConverter extends BaseTypedRepresentationConverter {
public constructor() {
super(rdfParser.getContentTypes(), INTERNAL_QUADS);
const inputTypes = rdfParser.getContentTypes()
// ContentType application/json MAY NOT be converted to Quad.
.then((types): string[] => types.filter((type): boolean => type !== 'application/json'));
super(inputTypes, INTERNAL_QUADS);
}
public async handle({ representation, identifier }: RepresentationConverterArgs): Promise<Representation> {