Я использую Groovy Gremlin в своем классе Java для обхода orient-db и вижу следующую проблему. Если я использую:
g.V('@class','Person').has('city-name','NY').in('city-depends').toList()
Я получаю людей в зависимости от города, и если я пытаюсь использовать преобразование, чтобы также получить друзей человека, используя друзей края
g.V('@class','Person').has('city-name','NY').in('city- depends').transform({[it,it.in('friends').toList()]}).toList()
Мне нужна информация о людях, проживающих в городе, с информацией о их друзьях (не только идентификатор края)
Трассировки стека:
com.orientechnologies.orient.core.exception.OStorageException: Error on executing command:
at com.orientechnologies.orient.client.remote.OStorageRemote.handleException(OStorageRemote.java:1481)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:1059)
at com.orientechnologies.orient.client.remote.OStorageRemoteThread.command(OStorageRemoteThread.java:430)
at com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:59)
at orientdb.prototype.OrientGremlinExample.getActivityByResource(OrientGremlinExample.java:87)
at orientdb.prototype.OrientGremlinExample.main(OrientGremlinExample.java:26)
Caused by: java.lang.IllegalArgumentException: Unsupported record type: 0
at com.orientechnologies.orient.core.record.ORecordFactoryManager.newInstance(ORecordFactoryManager.java:93)
at com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol.readIdentifiable(OChannelBinaryProtocol.java:121)
at com.orientechnologies.orient.client.remote.OStorageRemote.command(OStorageRemote.java:1023)
... 4 more
Caused by: java.lang.IllegalArgumentException: Record type '0' is not supported
at com.orientechnologies.orient.core.record.ORecordFactoryManager.getFactory(ORecordFactoryManager.java:108)
at com.orientechnologies.orient.core.record.ORecordFactoryManager.newInstance(ORecordFactoryManager.java:91)
... 6 more
Код:
OGremlinHelper.global().create();
ScriptEngine engine = new GremlinGroovyScriptEngineFactory().getScriptEngine();
engine.getBindings(ScriptContext.ENGINE_SCOPE).put("g", graph);
OCommandGremlin command = new OCommandGremlin(" ...... ");
Map<String, Object> params = new HashMap<String, Object>();
List agg1 = graph.getRawGraph().command(command).execute(params);
System.out.println("Result:-- " + agg1);