fix: Prefer all inputs equally when generating quads

This commit is contained in:
Joachim Van Herwegen 2021-10-28 16:00:06 +02:00
parent ed287ffade
commit c6544fac1d
2 changed files with 4 additions and 4 deletions

View File

@ -13,7 +13,7 @@ import type { RepresentationConverterArgs } from './RepresentationConverter';
*/ */
export class RdfToQuadConverter extends BaseTypedRepresentationConverter { export class RdfToQuadConverter extends BaseTypedRepresentationConverter {
public constructor() { public constructor() {
super(rdfParser.getContentTypesPrioritized(), INTERNAL_QUADS); super(rdfParser.getContentTypes(), INTERNAL_QUADS);
} }
public async handle({ representation, identifier }: RepresentationConverterArgs): Promise<Representation> { public async handle({ representation, identifier }: RepresentationConverterArgs): Promise<Representation> {

View File

@ -17,9 +17,9 @@ describe('A RdfToQuadConverter', (): void => {
const identifier: ResourceIdentifier = { path: 'path' }; const identifier: ResourceIdentifier = { path: 'path' };
it('supports serializing as quads.', async(): Promise<void> => { it('supports serializing as quads.', async(): Promise<void> => {
const types = Object.entries(await rdfParser.getContentTypesPrioritized()); const types = await rdfParser.getContentTypes();
for (const [ type, weight ] of types) { for (const type of types) {
await expect(converter.getOutputTypes(type)).resolves.toEqual({ [INTERNAL_QUADS]: weight }); await expect(converter.getOutputTypes(type)).resolves.toEqual({ [INTERNAL_QUADS]: 1 });
} }
}); });