When I create the lightweight edge using gremlin it does not create a class.
I see you can do > alter database custom useClassForEdgeLabel=false; but that seems to still require creating normal edges. I have very heterogeneous data, creating a class for each edge label would require creating hundreds of thousands of classes. A large portion of the data is going to remain static, so my plan has been to create lightweight edges for the static portions and classes for the more involved data to reduce storage, increase performance and make schema management less cluttered. So, is there a way to create lightweight edges using sql that does not require creating classes or does that functionality require gremlin? On Thursday, April 16, 2015 at 2:56:43 PM UTC-7, Colin wrote: > > Try creating the Knows edge class prior to creating the actual edge. > > See if that works. > > -Colin > > Orient Technologies > > The Company behind OrientDB > > > On Thursday, April 16, 2015 at 2:40:41 PM UTC-5, [email protected] > wrote: >> >> I am using orientdb 2.0.7 >> I cannot create lightweight edges in the console >> >> I executed >> alter database custom useLightweightEdges=true >> >> If I try to create a lightweight edge labeled "knows" I get the following >> error: >> Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: >> Error on parsing command at position #0: Class 'KNOWS' was not found >> >> >> >> I am able to create lightweight edges using gremlin. >> >> >> orientdb> create database >>> plocal:/home/kyle/Downloads/orientdb-community-2.0.7/databases/ledge_test2 >>> admin admin >>> Creating database >>> [plocal:/home/kyle/Downloads/orientdb-community-2.0.7/databases/ledge_test2] >>> >>> using the storage type [plocal]... >>> Database created successfully. >>> Current database is: >>> plocal:/home/kyle/Downloads/orientdb-community-2.0.7/databases/ledge_test2 >>> orientdb {db=ledge_test2}> alter database custom useLightweightEdges=true >>> Database updated successfully >>> orientdb {db=ledge_test2}> insert into V set myid = 1 >>> Inserted record 'V#9:0{myid:1} v1' in 0.007000 sec(s). >>> orientdb {db=ledge_test2}> insert into V set myid = 2 >>> Inserted record 'V#9:1{myid:2} v1' in 0.001000 sec(s). >>> orientdb {db=ledge_test2}> create edge knows from #9:0 to #9:1 >>> Error: >>> com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error on >>> parsing command at position #0: Class 'KNOWS' was not found >>> orientdb {db=ledge_test2}> disconnect >>> Disconnecting from the database [ledge_test2]...OK >>> orientdb> exit >> >> >> now go to gremlin console! >> >> gremlin> g = new OrientGraph("remote:localhost/ledge_test2") >>> Apr 16, 2015 12:32:55 PM com.orientechnologies.common.log.OLogManager log >>> INFO: OrientDB auto-config DISKCACHE=13,498MB (heap=455MB os=16,002MB >>> disk=30,513MB) >>> ==>orientgraph[remote:localhost/ledge_test2] >>> gremlin> g.isUseLightweightEdges() >>> ==>true >>> gremlin> v1=g.V[0].next();v2=g.V[1].next(); >>> ==>v[#9:1] >>> gremlin> e=v1.addEdge("knows",v2) >>> ==>e[#9:0->#9:1][#9:0-knows->#9:1] >>> gremlin> e >>> ==>e[#9:0->#9:1][#9:0-knows->#9:1] >>> gremlin> e.isLightweight() >>> ==>true >> >> >> >> there are closed issues on github so I figured I'd ask here first in case >> I'm doing something wrong. >> https://github.com/orientechnologies/orientdb/issues/3271 >> >> -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
