Checks whether the input can be handled by this class. If it cannot handle the input, rejects with an error explaining why.
Input that could potentially be handled.
A promise resolving if the input can be handled, rejecting with an Error if not.
Handles the given input. This may only be called if canHandle did not reject. When unconditionally calling both in sequence, consider handleSafe instead.
Input that needs to be handled.
A promise resolving when handling is finished.
Helper function that first runs canHandle followed by handle. Throws the error of canHandle if the data cannot be handled, or returns the result of handle otherwise.
Input data that will be handled if it can be handled.
A promise resolving if the input can be handled, rejecting with an Error if not.
Converts JSON data by using it as input parameters for rendering a template. The
extension
field can be used to only support a specific type of templates, such as ".ejs" for EJS templates.To find the templates it expects the Representation metadata to contain
SOLID_META.template
triples, with the objects being the template paths. For each of those templates there also needs to be a CONTENT_TYPE triple describing the content-type of that template.The output of the result depends on the content-type matched with the template. In case JSON is the most preferred output type, the input representation will be returned unless a JSON template is defined.