--- /dev/null
+package org.simantics.db.layer0.adapter;
+
+import org.simantics.db.ConverterExternalValue;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.scl.CompileValueRequest;
+import org.simantics.layer0.Layer0;
+import org.simantics.scl.reflection.ReflectionUtils;
+import org.simantics.scl.reflection.ValueNotFoundException;
+import org.simantics.scl.runtime.function.Function1;
+
+public class SCLExternalValue implements ConverterExternalValue {
+
+ @Override
+ public <T> T getValue(ReadGraph graph, Resource resource) throws DatabaseException {
+ try {
+ return (T)ReflectionUtils.getValue(Layer0.URIs.Functions_computeExpression).getValue();
+ } catch (ValueNotFoundException e) {
+ throw new DatabaseException(e);
+ }
+ }
+
+ @Override
+ public Function1 getFunction(ReadGraph graph, Resource s, Resource o, Resource p) throws DatabaseException {
+ return CompileValueRequest.compile(graph, s, o, p);
+ }
+
+}