All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.uniroma2.art.coda.structures.ResourcesSmartSuggested_old Maven / Gradle / Ivy

The newest version!
package it.uniroma2.art.coda.structures;

import it.uniroma2.art.coda.projectionrule.PlaceholderStruct;
import it.uniroma2.art.owlart.model.ARTURIResource;

import java.util.HashMap;
import java.util.Map;

/**
 * This class contains the map linking a placeholder to resources (even not already present in the ontology) 
 * suggested by the Resources Smart Suggestion. This class should be instantiated only by the 
 * Resources Smart Suggestion component
 * 
 * @author Andrea Turbati
 * 
 */

public class ResourcesSmartSuggested extends InterComponentObject{
	
	Map> placeholderToARTURIResMap;
	
	public ResourcesSmartSuggested() {
		placeholderToARTURIResMap = new HashMap>();
	}
	
	/**
	 * Add a new placeholder, its value (a string) and the associated ontology resource to the map
	 * 
	 * @param placeholder
	 *            the placeholder
	 * @param valueOfFeat
	 *            the value for this placeholder (a string)
	 * @param res
	 *            the RDF resource 
	 */
	public void addBindLabelARTURIResource(PlaceholderStruct placeholder, String valueOfFeat,
			ARTURIResource res) {
		if (!placeholderToARTURIResMap.containsKey(placeholder)) {
			placeholderToARTURIResMap.put(placeholder, new HashMap());
		}
		Map artUriResMAp = placeholderToARTURIResMap.get(placeholder);
		artUriResMAp.put(valueOfFeat, res);
	}

	/**
	 * Get the complete map contained in this instance
	 * 
	 * @return the complete map placeholder-value
	 */
	public Map> getPlaceholderToARTURIResMap() {
		return placeholderToARTURIResMap;
	}

	/**
	 * Get the list of value associated to a placeholder
	 * 
	 * @param placeholder
	 *            the placeholder to which the values are associated to
	 * @return the values associated to a placeholder
	 */
	public Map getArtResourceMapFromPlaceholder(PlaceholderStruct placeholder) {
		return placeholderToARTURIResMap.get(placeholder);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy