Currently the AnyToRdfConverter is hardcoded to only support JSON:
|
super("application/json", outputType); |
The super call also supports arrays so you can have multiple entries there. If the types it supports depend on other factors you probably just want to extend RepresentationConverter and have a custom canHandle implementation.
One potential issues when supporting all types is that this converter might be chosen for conversions it actually can't handle. For example, converting from JSON-LD to Turtle in the CSS works by having one converter convert the JSON-LD to quad objects, and then chain a second converter that converts quad objects to Turtle. But if there is also an AnyToRdfConverter in that array, that one would be chose instead since it says it can do the conversion in 1 step.
There are some ways around this. One of them is to just not put this converter in the main array of converters but put it somewhere further in the store stack, after a regex router rule for example. Another way is to have a more advanced canHandle function so it can detect if it can actually do the conversion or not.
Currently the
AnyToRdfConverteris hardcoded to only support JSON:solid-rml-store/src/any-to-rdf-converter.ts
Line 31 in 239cfd7
The super call also supports arrays so you can have multiple entries there. If the types it supports depend on other factors you probably just want to extend
RepresentationConverterand have a customcanHandleimplementation.One potential issues when supporting all types is that this converter might be chosen for conversions it actually can't handle. For example, converting from JSON-LD to Turtle in the CSS works by having one converter convert the JSON-LD to quad objects, and then chain a second converter that converts quad objects to Turtle. But if there is also an
AnyToRdfConverterin that array, that one would be chose instead since it says it can do the conversion in 1 step.There are some ways around this. One of them is to just not put this converter in the main array of converters but put it somewhere further in the store stack, after a regex router rule for example. Another way is to have a more advanced
canHandlefunction so it can detect if it can actually do the conversion or not.