package com.wx.application.nebula.graph.base;

import cn.hutool.core.util.HashUtil;

public class Generators {
	
	private final static String tag = "tag_";
	
	private final static String edge = "edge_";
	
	private final static String tagindex = "tagindex_";
	private final static String edgeindex = "edgeindex_";
	
	private final static String field = "field_";
	private final static String name = "名称,姓名,name";
	
	
	public static String tagname(String label) {
		return tag + HashUtil.fnvHash(label);
	}
	
	public static String indextagname(String name) {
		return tagindex + name;
	}
	
	public static String indexedgename(String name) {
		return edgeindex + name;
	}
	
	public static String edgename(String label) {
		return edge + HashUtil.fnvHash(label);
	}
	
	public static String fieldname(String label) {
		if(name.contains(label)) {
			return "name";
		}
		return field + HashUtil.fnvHash(label);
	}
	
	public static String vid(String label) {
		return "" + HashUtil.fnvHash(label);
	}
	
	/**
	 * 本体空间所需要得id
	 * @param ontologyId
	 * @param label
	 * @return
	 */
	public static String ontologyVid(Long ontologyId, String vid) {
		return ontologyId + "_" + vid;
	}
}
