我在我的Java类中使用Groovy gremlin来遍历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()
我想要的是基于城市的人与他们的朋友信息(不仅是边缘ID)的信息
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);