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