public Triple getTriple(String identifier) throws InvalidRecordException{
		
		Predicate pred = null;
		Node sub = null;
		Node obj = null;
		
		//Check for the Triple, if not add it to the KnowledgeGraph
		if (!(tripleMap.containsKey(identifier))){
			
			StringTokenizer st = new StringTokenizer(identifier," ");											
			if (st.countTokens() != 3) throw new InvalidRecordException ("Skipped record: "+identifier+": Not a valid N-Triple record");		//Data validation
			String tokens[] = new String[st.countTokens()];

			while(st.hasMoreTokens()){
				String curtoken = st.nextToken().trim();
			if (curtoken.contains("?")) throw new InvalidRecordException ("Skipped record: "+identifier+": Input recored should not contain ?");//Data validation
				if (st.countTokens() == 2) {tokens[2] = curtoken; sub = getNode(tokens[2]);}
				if (st.countTokens() == 1) {tokens[1] = curtoken; pred = getPredicate(tokens[1]);}
				if (st.countTokens() == 0) {tokens[0] = curtoken; obj = getNode(tokens[0]);}	
			}	
			tripleMap.put(identifier, new Triple(identifier, sub, pred, obj));
			buildQueryMapSet(tripleMap.get(identifier));
		}

		return tripleMap.get(identifier);
	}