graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java
public JSONObject jsonFromElement(final Element element) throws JSONException {
    final ObjectNode objectNode = this.objectNodeFromElement(element);

    try {
      return new JSONObject(new JSONTokener(mapper.writeValueAsString(objectNode)));
    } catch (IOException ioe) {
      // repackage this as a JSONException...seems sensible as the caller will only know about
      // the jettison object not being created
      throw new JSONException(ioe);
    }
  }
public JSONObject jsonFromElement(final Element element) throws JSONException {
    final ObjectNode objectNode = this.objectNodeFromElement(element);

    try {
      return new JSONObject(new JSONTokener(mapper.writeValueAsString(objectNode)));
    } catch (IOException ioe) {
      // repackage this as a JSONException...seems sensible as the caller will only know about
      // the jettison object not being created
      throw new JSONException(ioe);
    }
  }
Creates GraphSON for a single graph element.