code: public ImmutableTerm getSubjectAtom(TriplesMap tm, String joinCond) throws Exception {
  		ImmutableTerm subjectAtom = null;
  		String subj = "";
  		classPredicates.clear();
  
  		// SUBJECT
  		SubjectMap sMap = tm.getSubjectMap();
  
  		// process template declaration
  		IRI termType = sMap.getTermType();
  
  		// WORKAROUND for:
  		// SubjectMap.getTemplateString() throws NullPointerException when
  		// template == null
  		//
  		Template template = sMap.getTemplate();
  		if (template == null) {
  			subj = null;
  		} else {
  			subj = sMap.getTemplateString();
  		}
  
  		if (subj != null) {
  			// create uri("...",var)
  			subjectAtom = getTermTypeAtom(subj, termType, joinCond);
  		}
  
  		// process column declaration
  		subj = sMap.getColumn();
  		if (subj != null) {
  			if(template == null && (termType.equals(R2RMLVocabulary.iri))){
  
  				subjectAtom = termFactory.getImmutableUriTemplate(termFactory.getVariable(subj));
  
  			}
  			else {
  				// create uri("...",var)
  				subjectAtom = getTermTypeAtom(subj, termType, joinCond);
  			}
  		}
  
  		// process constant declaration
          // TODO(xiao): toString() is suspicious
          RDFTerm subjConstant = sMap.getConstant();
  		if (subjConstant != null) {
  			// create uri("...",var)
              subj = subjConstant.toString();
  			subjectAtom = getURIFunction(subj, joinCond);
  		}
  
  
  		// process class declaration
  		List<IRI> classes = sMap.getClasses();
  		for (IRI o : classes) {
              classPredicates.add( termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(o.getIRIString())));
  		}
  
  		if (subjectAtom == null)
  			throw new Exception("Error in parsing the subjectMap in node "
  					+ tm.toString());
  
  		return subjectAtom;
  
  	}
docs: Get subject
  
  @param tm
  @param joinCond
  @return
  @throws Exception