// Path: freya/freya-annotate/src/main/java/org/freya/model/learning/Vote.java
// public class Vote {
// 	// this is usually URI or DatatyepPropertyValueIdentifier
// 	Object identifier;
// 	
// 	volatile long id;
// 	volatile double score;
// 	volatile String function;
// 	public Object getIdentifier() {
// 		return identifier;
// 	}
// 	public void setIdentifier(Object identifier) {
// 		this.identifier = identifier;
// 	}
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	public double getScore() {
// 		return score;
// 	}
// 	public void setScore(double score) {
// 		this.score = score;
// 	}
// 	public String getFunction() {
// 		return function;
// 	}
// 	public void setFunction(String function) {
// 		this.function = function;
// 	}
// }


import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PostConstruct;
import org.apache.commons.io.FileUtils;
import org.freya.model.learning.Vote;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

package org.freya.learning;



// import org.apache.commons.logging.Log;
// import org.apache.commons.logging.LogFactory;
//import org.codehaus.jackson.JsonGenerationException;
//import org.codehaus.jackson.JsonParseException;
//import org.codehaus.jackson.map.JsonMappingException;
//import org.codehaus.jackson.map.ObjectMapper;
//import org.codehaus.jackson.type.TypeReference;


/**
 * this class is initialising the learning model from file; on start up it feeds it into the memory and then it saves it
 * at certain periods of time
 * 
 * @author danica
 * 
 */
@Component
public class LearningModel {
    private static final Logger logger = LoggerFactory.getLogger(LearningModel.class);



// Path: freya/freya-annotate/src/main/java/org/freya/model/learning/Vote.java
// public class Vote {
// 	// this is usually URI or DatatyepPropertyValueIdentifier
// 	Object identifier;
// 	
// 	volatile long id;
// 	volatile double score;
// 	volatile String function;
// 	public Object getIdentifier() {
// 		return identifier;
// 	}
// 	public void setIdentifier(Object identifier) {
// 		this.identifier = identifier;
// 	}
// 	public long getId() {
// 		return id;
// 	}
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// 	public double getScore() {
// 		return score;
// 	}
// 	public void setScore(double score) {
// 		this.score = score;
// 	}
// 	public String getFunction() {
// 		return function;
// 	}
// 	public void setFunction(String function) {
// 		this.function = function;
// 	}
// }


// Path: freya/freya-annotate/src/main/java/org/freya/learning/LearningModel.java
import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PostConstruct;
import org.apache.commons.io.FileUtils;
import org.freya.model.learning.Vote;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;
import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

package org.freya.learning;



// import org.apache.commons.logging.Log;
// import org.apache.commons.logging.LogFactory;
//import org.codehaus.jackson.JsonGenerationException;
//import org.codehaus.jackson.JsonParseException;
//import org.codehaus.jackson.map.JsonMappingException;
//import org.codehaus.jackson.map.ObjectMapper;
//import org.codehaus.jackson.type.TypeReference;


/**
 * this class is initialising the learning model from file; on start up it feeds it into the memory and then it saves it
 * at certain periods of time
 * 
 * @author danica
 * 
 */
@Component
public class LearningModel {
    private static final Logger logger = LoggerFactory.getLogger(LearningModel.class);



    Map<String, List<Vote>> votesMap = new ConcurrentHashMap<String, List<Vote>>();
