Search in sources :

Example 1 with UniVertex

use of org.unipop.structure.UniVertex in project unipop by unipop-graph.

the class RestController method addVertex.

@Override
public Vertex addVertex(AddVertexQuery uniQuery) {
    UniVertex vertex = new UniVertex(uniQuery.getProperties(), graph);
    for (RestVertexSchema vertexSchema : vertexSchemas) {
        try {
            BaseRequest baseRequest = vertexSchema.addElement(vertex);
            if (baseRequest == null)
                return vertex;
            baseRequest.asJson();
        } catch (UnirestException e) {
            e.printStackTrace();
        } catch (NoSuchElementException e) {
            continue;
        }
    }
    return vertex;
}
Also used : BaseRequest(com.mashape.unirest.request.BaseRequest) UnirestException(com.mashape.unirest.http.exceptions.UnirestException) UniVertex(org.unipop.structure.UniVertex)

Aggregations

UnirestException (com.mashape.unirest.http.exceptions.UnirestException)1 BaseRequest (com.mashape.unirest.request.BaseRequest)1 UniVertex (org.unipop.structure.UniVertex)1