Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jnosql-dev] JNoSQL and Graph API

https://github.com/eclipse/jnosql-artemis-extension/blob/master/graph-extension/README.md

On Sun, Jul 16, 2017 at 10:33 PM, Otávio Gonçalves de Santana <otaviopolianasantana@xxxxxxxxx> wrote:

To JNoSQL covers the Graph API, the initial step is as an artemis-extension.

The extension uses TinkerPop as Communication API, so, this extension will convert to/from TinkerPop API.
TinkerPop has support to around twenty differents Graph NoSQL.

public interface GraphTemplate {

    <T> T insert(T bean) throws NullPointerException;

    <T> T update(T bean) throws NullPointerException;

    <T extends EdgeElement> T add(T edge) throws NullPointerException;

    void delete(GraphDeleteQuery query) throws NullPointerException;

   <OUT, IN> EdgeBuilder<OUT, IN>  addEdge(OUT out, String label, IN in) throws NullPointerException;

    GraphTraversalQuery getQuery();
}

Save an Entity

Person ada =//instance
Person grace = //instance
GraphTemplate template =//instance
template.insert(ada);
template.insert(grace);

Save an Edge

Person ada =//instance
Person grace = //instance
GraphTemplate template =//instance
 EdgeEntity<Person, Person> edge = template.addEdge(grace, "know", ada)
.property("where", "Europe")
.execute();

GraphTraversalQuery

GraphTemplate template =//instance
GraphTraversalQuery g = template.getQuery();
List<Person> people = g.V().has("occupation", "Java").outE("knows")
.has("feel", "love").bothV().execute();





--
Otávio Gonçalves de Santana



--
Otávio Gonçalves de Santana

Back to the top