You are right, select from MyV set element_name = "myv"
should be update MyV set element_name = "myv" sorry. >From within bulbs you can create a vertex of type "MyV" by doing In [9]: data = {"@class":"MyV","ovgid":"test1", "element_type":"MyV"} > In [10]: v=g.vertices.create(data) On Tuesday, April 21, 2015 at 10:37:52 AM UTC-7, Kevin I wrote: > > @kyle, > > Sorry to get back so late. I can't quite wrap my head around this. From > what you've said and I understand from the docs and from fiddling with the > console, this is what I've understood: > > 1. In orientdb, all classes are identified with the `@CLASS` property just > like the classes in Bulbs are identified with `element_type` property. > 2. A Class cannot be changed in orientdb, once it is created. > > I have the following classes in Bulbs for example : > Student, Staff, Subject, Branch > > Now, I need to create lucene indexes for which I cannot use Bulbs. So, I > get into the Orientdb console. As you said, I tried creating the class > `Student` in orientdb too, like this: > > `create class Student extends V` > > But, still all the above 4 bulbs class type objects are shown as `V` > objects in orientdb. ie. the number of `Student` records in orientDB is 0. > > So, in short, what I want to do is to convert the `V` type records to the > `Student`, `Staff`, `Subject` and `Branch` type records in OrientDB, so > that I can create indices in Lucene for my search module. > > Also, I tried your command : > `select from MyV set element_name = "myv"` > but it throwed a syntax error. > > Thank you for your help so far. Looking ahead for your reply! > > On Wed, Apr 15, 2015 at 11:58 PM, <ky...@ovguideinc.com <javascript:>> > wrote: > >> <class-name> refers to classes defined in Orientdb. >> >> http://orientdb.com/docs/last/orientdb.wiki/Tutorial-Classes.html >> >> Useful default classes are "V" for vertices, and "E" for edges. >> >> You can define a new classes like: >> >> create class MyV extends V >> create class MyE extends E >> >> you can do >> >> create property V.element_name STRING >> select from MyV set element_name = "myv" >> >> (all above are osql console commands) >> to create an element name property, and populate all records of that >> class with a string representing that property (this relates to what I >> mentioned before about not seeing any way to access the "@class" field in >> bulbs). >> >> You can now create bulbs model classes that correspond to the classes in >> Orientdb itself. "element_name" is the default field name to associate >> graphdb records with bulbs python model classes, it can be changed if >> something else works better for you. >> >> >> On Tuesday, April 14, 2015 at 9:05:33 PM UTC-7, Kevin I wrote: >>> >>> Thank you very much ky...! I've installed pyorient. >>> >>> But now, what is this class name here : >>> >>> CREATE INDEX <name> ON <class-name> (prop-names) FULLTEXT ENGINE LUCENE >>> >>> >>> as found in this wiki here >>> <https://github.com/orientechnologies/orientdb-lucene/wiki/Full-Text-Index>? >>> >>> I tried using the Bulbs model class name and obviously it didn't work. Do I >>> have to define separate classes for this? If so, can you please show how to >>> do it? >>> >>> Thanks! >>> >>> >>> On Wednesday, April 15, 2015 at 12:13:11 AM UTC+5:30, >>> ky...@ovguideinc.com wrote: >>>> >>>> I'm pretty certain you can't create these fancy orientdb indices via >>>> bulbs. >>>> >>>> ---- >>>> This open issue is about adding support to directly talk to orientdb >>>> via the REST api. >>>> https://github.com/espeed/bulbs/issues/128 >>>> I'd very much like this feature! >>>> >>>> ---- >>>> you can use pyorient to talk to orientdb in python: >>>> https://github.com/mogui/pyorient >>>> >>>> ---- >>>> >>>> Additionally, there are serialization issues with custom orientdb stuff. >>>> >>>> e.g, a list of >>>> EMBEDDED SETS/LISTS get serialized as: >>>> u'kind': u'[tv_tv_program, film_film]' >>>> >>>> I've noticed DATE fields getting serialized as: >>>> u'modified': u'Wed Apr 01 15:58:46 PDT 2015', >>>> which can cause problems (e.g, schema violation when not turned back >>>> into date) when trying to save via bulbs >>>> >>>> LINKLIST/SET properties are serialized as >>>> u'cast': >>>> u'com.tinkerpop.blueprints.impls.orient.OrientElementIterable@3949de91', >>>> which is completely unworkable. The only workaround I know is judicious >>>> use of server side gremlin scripts. >>>> >>>> Bulbs doesn't seem to have access to the "@class" property so you can't >>>> know the class of a record without adding another field to record that, I >>>> think this is a problem at the rexster level though I am unsure. >>>> >>>> The date and embedded set/list problems can easily be fixed by >>>> subclassing the Property class in >>>> https://github.com/espeed/bulbs/blob/master/bulbs/property.py >>>> and creating custom conversion to/from python/orientdb. >>>> >>>> >>>> On Tuesday, April 14, 2015 at 8:33:15 AM UTC-7, Kevin I wrote: >>>>> >>>>> I just realized that I'm trying to interpret the SQL query with the >>>>> Gremlin interpreter. >>>>> >>>>> Still I don't know how to execute it. >>>>> >>>>> On Tuesday, April 14, 2015 at 9:01:17 PM UTC+5:30, Kevin I wrote: >>>>>> >>>>>> I have the Lucene index plugin installed and active. I just can't >>>>>> figure out how to create indices. I tried this: >>>>>> >>>>>> g.gremlin.execute('create index Student.name on Student (name) >>>>>> fulltext engine lucene') >>>>>> >>>>>> but it doesn't work. Returns the following error: >>>>>> >>>>>> SystemError: ({'status': '500', 'transfer-encoding': 'chunked', >>>>>> 'server': 'grizzly/2.2.16', 'connection': 'close', 'date': 'Tue, 14 >>>>>> Apr 2015 20:54:50 GMT', 'access-control-allow-origin': '*', >>>>>> 'content-type': 'application/json'}, >>>>>> '{"message":"","error":"javax.script.ScriptException: >>>>>> groovy.lang.MissingPropertyException: No such property: index for class: >>>>>> Script5","api":{"description":"evaluate an ad-hoc Gremlin script for a >>>>>> graph.","parameters":{"returnTotal":"when set to true, the full result >>>>>> set >>>>>> will be iterated and the results returned (default is >>>>>> false)","rexster.returnKeys":"an array of element property keys to >>>>>> return >>>>>> (default is to return all element >>>>>> properties)","rexster.showTypes":"displays the properties of the >>>>>> elements >>>>>> with their native data type (default is false)","load":"a list of >>>>>> \'stored >>>>>> procedures\' to execute prior to the \'script\' (if \'script\' is not >>>>>> specified then the last script in this argument will return the >>>>>> values","rexster.offset.end":"end index for a paged set of data to be >>>>>> returned","rexster.offset.start":"start index for a paged set of data to >>>>>> be >>>>>> returned","params":"a map of parameters to bind to the script >>>>>> engine","language":"the gremlin language flavor to use (default is >>>>>> groovy)","script":"the Gremlin script to be >>>>>> evaluated"}},"success":false}' >>>>>> ) >>>>>> >>>>>> What am I missing here? >>>>>> >>>>> -- >> >> --- >> You received this message because you are subscribed to a topic in the >> Google Groups "OrientDB" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/orient-database/Oi34bWhARAU/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> orient-databa...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Always remember that the world around you is made by people that are no > smarter than you and me. > -- --- 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 orient-database+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.