*/
public class SCLComputationalValue extends ContextualRelatedValue {
+ // TODO: unify and merge CompileValueRequest and CompileResourceValueRequest as one
@Override
public Function1<Object,Object> getFunction(ReadGraph graph, Resource s, Resource o, Resource p) throws DatabaseException {
- if (s != null && p != null && o != null) {
- return CompileValueRequest.compile(graph, s, o, p);
+ if (p != null && o != null) {
+ // we are now at Variable context
+ return CompileValueRequest.compile(graph, o, p);
} else if (o != null) {
+ // we are now at Resource context
return CompileResourceValueRequest.compile(graph, o);
} else {
throw new DatabaseException("Could not compile SCL expression: s=" + s + " p=" + p + " o=" + o);