Certain value expressions that are currently INeedsMaterialization.ALWAYS can probably be changed to work with inline values now that bops implement the openrdf Value interfaces. A good example of this is StrBOp, which uses the Literal.getLabel() method to do its work. Currently, it calls bop.getValue().getLabel(), which can result in NotMaterializedExceptions. By simply tweaking it to use bop.getLabel(), StrBOp can operate on fully inline values (except for extensions) without resorting to costly materialization. This will allow it to work on bops that were created by other value expressions but that do not exist in the database. For example, right now, it would not be possible to evaluate this:
Because the result of the MathBOp will be an inline numeric, and even if ?x is materialized, (?x+1) will not be. This is an example of a "dummy inline IV".
There are also value expressions that can create dummy non-inline IVs, such as the DatatypeBOp or any other value expression that returns a URI. However this will never be a materialization problem, since these dummy non-inline IVs are by their very nature already materialized.