// Path: src/main/java/com/dmitriid/cali/db/Tokens.java
// public class Tokens {
// 
//     public static final String JSON_APPLICATION = "json/application";
// 
//     public static final String _ID = "_id";
//     public static final String ID = "id";
//     public static final String DIRECTION = "direction";
//     public static final String _TYPE = "_type";
//     public static final String _LABEL = "_label";
//     public static final String _OUT_V = "_outV";
//     public static final String _IN_V = "_inV";
//     public static final String VERTEX = "vertex";
//     public static final String EDGE = "edge";
// 
// 
//     public static final String REXSTER_GRAPH_TYPE = "rexster.graph.type";
//     public static final String REXSTER_GRAPH_FILE = "rexster.graph.file";
//     public static final String REXSTER_CACHE_MAXSIZE = "rexster.cache.maxsize";
//     public static final String REXSTER_PACKAGES_ALLOWED = "rexster.packages.allowed";
// 
//     public static final String DESCRIPTION = "description";
//     public static final String PARAMETERS = "parameters";
//     public static final String API = "api";
// }


import com.dmitriid.cali.db.Tokens;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Element;
import com.tinkerpop.blueprints.pgm.Vertex;
import org.neo4j.helpers.Pair;
import java.util.ArrayList;
import java.util.Set;

    Object get_properties(){
        ArrayList properties = new ArrayList();
        if(null == _properties) {
            if(_o instanceof Edge){
                Edge edge = (Edge) _o;
                properties.add(new Pair("label", edge.getLabel()));
                properties.add(new Pair("inE", edge.getInVertex().getId()));
                properties.add(new Pair("outE", edge.getOutVertex().getId()));

                return new Pair("edge", properties);
            } else {
                Vertex vertex = (Vertex) _o;
                properties.add(new Pair("id", vertex.getId()));
                for(String key : vertex.getPropertyKeys()) {
                    properties.add(new Pair(key, vertex.getProperty(key)));
                }
            }
        } else {
            Element element = (Element) _o;
            for(Object k : _properties) {
                String key = (String) k;
                if(key.equals(Tokens._ID)) {
                    properties.add(new Pair("id", element.getId()));
                } else if(element instanceof Edge && (key.equals(Tokens._LABEL) ||key.equals("label"))) {
                    Edge edge = (Edge) element;
                    properties.add(new Pair("label", edge.getLabel()));
                } else if(element instanceof Edge && key.equals(Tokens._IN_V)) {
                    Edge edge = (Edge) element;
                    properties.add(new Pair("inV", edge.getInVertex().getId()));
// Path: src/main/java/com/dmitriid/cali/db/Tokens.java
// public class Tokens {
// 
//     public static final String JSON_APPLICATION = "json/application";
// 
//     public static final String _ID = "_id";
//     public static final String ID = "id";
//     public static final String DIRECTION = "direction";
//     public static final String _TYPE = "_type";
//     public static final String _LABEL = "_label";
//     public static final String _OUT_V = "_outV";
//     public static final String _IN_V = "_inV";
//     public static final String VERTEX = "vertex";
//     public static final String EDGE = "edge";
// 
// 
//     public static final String REXSTER_GRAPH_TYPE = "rexster.graph.type";
//     public static final String REXSTER_GRAPH_FILE = "rexster.graph.file";
//     public static final String REXSTER_CACHE_MAXSIZE = "rexster.cache.maxsize";
//     public static final String REXSTER_PACKAGES_ALLOWED = "rexster.packages.allowed";
// 
//     public static final String DESCRIPTION = "description";
//     public static final String PARAMETERS = "parameters";
//     public static final String API = "api";
// }


// Path: src/main/java/com/dmitriid/cali/converters/ElementObject.java
import com.dmitriid.cali.db.Tokens;
import com.tinkerpop.blueprints.pgm.Edge;
import com.tinkerpop.blueprints.pgm.Element;
import com.tinkerpop.blueprints.pgm.Vertex;
import org.neo4j.helpers.Pair;
import java.util.ArrayList;
import java.util.Set;


    Object get_properties(){
        ArrayList properties = new ArrayList();
        if(null == _properties) {
            if(_o instanceof Edge){
                Edge edge = (Edge) _o;
                properties.add(new Pair("label", edge.getLabel()));
                properties.add(new Pair("inE", edge.getInVertex().getId()));
                properties.add(new Pair("outE", edge.getOutVertex().getId()));

                return new Pair("edge", properties);
            } else {
                Vertex vertex = (Vertex) _o;
                properties.add(new Pair("id", vertex.getId()));
                for(String key : vertex.getPropertyKeys()) {
                    properties.add(new Pair(key, vertex.getProperty(key)));
                }
            }
        } else {
            Element element = (Element) _o;
            for(Object k : _properties) {
                String key = (String) k;
                if(key.equals(Tokens._ID)) {
                    properties.add(new Pair("id", element.getId()));
                } else if(element instanceof Edge && (key.equals(Tokens._LABEL) ||key.equals("label"))) {
                    Edge edge = (Edge) element;
                    properties.add(new Pair("label", edge.getLabel()));
                } else if(element instanceof Edge && key.equals(Tokens._IN_V)) {
                    Edge edge = (Edge) element;
                    properties.add(new Pair("inV", edge.getInVertex().getId()));
                } else if(element instanceof Edge && key.equals(Tokens._OUT_V)) {