
package eu.dnetlib.dhp.contextpropagation;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Map;

import com.google.common.collect.Maps;

import eu.dnetlib.dhp.contextpropagation.model.PropagationUse;

public class Costants implements Serializable {

	private static Map<String, PropagationUse> publicationDatasetSemantics = Maps.newHashMap();

	static {
		publicationDatasetSemantics
			.put("issupplementedby", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		publicationDatasetSemantics.put("cites", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		publicationDatasetSemantics.put("describes", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		publicationDatasetSemantics.put("references", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		publicationDatasetSemantics.put("documents", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));

	}

	private static Map<String, PropagationUse> datasetDatasetSemantics = Maps.newHashMap();

	static {
		datasetDatasetSemantics.put("isdescribedby", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("iscitedby", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("cites", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("issupplementedby", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("issupplementto", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("iscontinuedby", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("continues", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("hasversion", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isversionof", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isnewversionof", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics
			.put("ispreviousversionof", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("ispartof", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("haspart", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("references", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isreferencedby", PropagationUse.newInstance("reuse", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("documents", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isdocumentedby", PropagationUse.newInstance("latent", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isvariantformof", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isoriginalformof", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isidenticalto", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("obsoletes", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));
		datasetDatasetSemantics.put("isobsoletedby", PropagationUse.newInstance("proxy", "1.0", new ArrayList<>()));

	}

	public static Map<String, PropagationUse> getPublicationDatasetSemantics() {
		return publicationDatasetSemantics;
	}

	public static Map<String, PropagationUse> getDatasetDatasetSemantics() {
		return datasetDatasetSemantics;
	}

	public static boolean containedInPubSem(String sem) {
		return publicationDatasetSemantics.containsKey(sem);
	}

	public static boolean containedInDatsSem(String sem) {
		return datasetDatasetSemantics.containsKey(sem);
	}

	public static PropagationUse getPublicationValue(String sem) {
		return publicationDatasetSemantics.get(sem);
	}

	public static PropagationUse getDatasetValue(String sem) {
		return datasetDatasetSemantics.get(sem);
	}
}
