Creating Vertex subclass instances for OrientDB and Archimedes

76 views
Skip to first unread message

Mattox Beckman

unread,
Mar 16, 2015, 1:16:07 PM3/16/15
to clojure-...@googlegroups.com

I have been playing with OrientDB (2.0.4), Archimedes (2.5.0.0), and com.orientechnologies/orientdb-graphdb (2.0.5).
I can use the console to create subclasses of Vertex, and I can select records of these, but I can’t find how to create a new vertex of a specific class. Is that something that can be done, or is that an unsupported extension of OrientDB?

For example I have a database where there is a Course class extending Vertex.

orient.core> (v/find-by-kv og "@CLASS" "Course")
#{#<OrientVertex v(Course)[#14:0]> #<OrientVertex v(Course)[#14:1]>}
orient.core> (def c1 (v/find-by-id og "14:0"))
#'orient.core/c1
orient.core> (v/to-map c1)
{:__id__ #<ORecordId #14:0>, :rubric "cs331"}
orient.core> (v/create! og ?????)

I can only get the last create command to create a Vertex; never a Course.

Thanks,
Mattox

Mattox Beckman

unread,
Mar 17, 2015, 4:44:47 PM3/17/15
to clojure-...@googlegroups.com

The problem is that I was trying to use keywords. If you use the string “@class” then it works.

core> (v/create! og { "@class" "Semester" :start "2014-01"})
#<OrientVertex v(Semester)[#-1:-2]>

Cheers,
Mattox

Reply all
Reply to author
Forward
0 new messages