private void graphToDB(Graph graph) {
		HashMap<String, String> names = new HashMap<String, String>();
		for (String v : graph.getVertices()) {
			Visode o = db.find(v);
			String name = o == null ? v : String.valueOf(((OdeNode)o).getDisplayName());
			names.put(v, name);
		}
		
		db.clear();
		for (String v : graph.getVertices()) {
			Visode ode = new OdeNode(v, names.get(v));
			if (ode.getUID().matches("\\d+")) {
				if (graph.getEdges(v).size() == 0) {
					// spacer!
					ode.setType(Visode.TYPE_SPACER);
				} else {
					ode.setType(Visode.TYPE_LINK);
				}
			}
			if (positions != null && positions.containsKey(v)) {
				ode.setCenter(positions.get(v));
			}
			db.register(ode);
			for (String o : graph.getOutgoingVertices(v))
				db.addParent(v, o);
		}
	}