}
private IRubyObject createFunction(ThreadContext context, RubySymbol arg) {
try {
Var keyword_fn = DiametricService.getFn("clojure.core", "keyword");
Keyword entityKey = (Keyword) keyword_fn.invoke(arg.toString());
Var entity_fn = DiametricService.getFn("datomic.api", "entity");
Entity entity = (Entity) entity_fn.invoke(database, entityKey);
datomic.function.Function function = (Function) entity.get(DiametricService.keywords.get("db/fn"));
RubyClass clazz = (RubyClass)context.getRuntime().getClassFromPath("Diametric::Persistence::Function");
DiametricFunction diametric_function = (DiametricFunction)clazz.allocate();