Hey Christian,

You can use the Document API via that call to getRawGraph() which returns 
an ODatabaseDocumentTx object.

The Graph API, which implements the TinkerPop Blueprints interface, is also 
very easy to use and makes it simpler to add edges to vertices.

Something to note about the Graph API v. the Document API.  The Graph API 
by default operates within an automatic transaction because it has to 
maintain both sides of the operation when adding/managing links as edges.

You can also called graphDB.command( ... ) to execute the SQL.  But, if 
you're already using the Graph DB API, might as well just call addEdge on a 
vertex or on the graph DB object directly.

Some of my document databases that I ported to OrientDB I just left as 
documents and manually added links to other documents.  This gave me the 
graph functionality I needed, even though I was responsible for the 
connections instead of letting the database handle the edges.

Hope that helps!

-Colin

Orient Technologies

The Company behind OrientDB



On Thursday, March 5, 2015 at 10:45:01 AM UTC-6, Christian C wrote:
>
> Thanks for the quick response Colin
>
> If I got you right, I can switch to the Graph API and use the Document API 
> functionality out of the Graph API right? Does this mean I can get 
> a ODatabaseDocumentTx via the Graph API also? This would be very great!
>
> But anyway I can always use the sql interface to create edges by calling:
>
>         ODatabaseDocumentTx db = pool.acquire();
>         db.command(new OCommandSQL("create edge Living from #10:3 to #11:4 
> set from = '2000-01-01', to = '2012-04-06'")).execute();
>
> Right?
>
> PS Thanks for helping me out, I am leaving from MongoDB because of the 
> Graph functionality so I was more "fimilar" to start of with the Document 
> API and now I do not want to rewrite things.
>
>

-- 

--- 
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.

Reply via email to