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

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

There is a newer version: 2.0.2
Show newest version
package it.uniroma2.art.coda.structures;


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

import org.eclipse.rdf4j.model.Value;

/**
 * This class represents a single tuple of a result obtained from a SPARQL query
 * @author Andrea Turbati
 *
 */
public class Tuple {
	private Map varMap;
	
	public Tuple(){
		varMap = new HashMap();
	}
	
	/**
	 * Add a variable and its associated ontology resource
	 * @param varId the variable id
	 * @param artNode the ontology resource associated to the variable 
	 * @return true if the variable was not already present in the map, false otherwise
	 */
	public boolean addVarValue(String varId, Value artNode){
		if(varMap.containsKey(varId))
			return false;
		varMap.put(varId, artNode);
		return true;
	}
	
	/**
	 * Get the map containing the variable name and its associated ontology resource
	 * @return the map containing the variable name and its associated ontology resource
	 */
	public Map  getTupleMap(){
		return varMap;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy