Skip to content

Support Any type in the AnyToRdfConverter #3

Description

@joachimvh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions