class DefaultIriExpressionProcessor implements IriExpressionProcessor {

    @Override
    public IRI processExpression(String expression, IriExpressionContext context) throws SemanticTranslationException {
        try {
            final Expression compiledExpression = PARSER.parseExpression(expression);
            String result = compiledExpression.getValue(new StandardEvaluationContext(context), String.class);
            LOG.debug("IRI expression resulted in '{}' with context of type {}", result, context.getClass().getName());
            return valueFactory.createIRI(result);
        } catch (SpelEvaluationException | SpelParseException | IllegalArgumentException e) {
            throw new SemanticTranslationException("Issue processing IRI expression for expression '"
                    + expression + "' with context of type: " + context.getClass().getName(), e);
        }
    }

}