code: private ImmutableTerm generateSubject(DatabaseRelationDefinition td, boolean ref) {
  		
  		String varNamePrefix = "";
  		if (ref)
  			varNamePrefix = td.getID().getTableName() + "_";
  
  		UniqueConstraint pk = td.getPrimaryKey();
  		if (pk != null) {
  			List<ImmutableTerm> terms = new ArrayList<>(pk.getAttributes().size() + 1);
  			
  			List<String> attributes = new ArrayList<>(pk.getAttributes().size());
  			for (Attribute att : pk.getAttributes()) 
  				attributes.add(R2RMLIRISafeEncoder.encode(att.getID().getName()) + "={}");
  			
  			String template = baseIRI + R2RMLIRISafeEncoder.encode(td.getID().getTableName()) + "/" + Joiner.on(";").join(attributes);
  			terms.add(termFactory.getConstantLiteral(template));
  			
  			for (Attribute att : pk.getAttributes())
  				terms.add(termFactory.getVariable(varNamePrefix + att.getID().getName()));
  
  			return termFactory.getImmutableUriTemplate(ImmutableList.copyOf(terms));
  		}
  		else {
  			List<ImmutableTerm> vars = new ArrayList<>(td.getAttributes().size());
  			for (Attribute att : td.getAttributes())
  				vars.add(termFactory.getVariable(varNamePrefix + att.getID().getName()));
  
  			return termFactory.getImmutableBNodeTemplate(ImmutableList.copyOf(vars));
  		}
  	}
docs: - If the table has a primary key, the row node is a relative IRI obtained by concatenating:
  - the percent-encoded form of the table name,
  - the SOLIDUS character '/',
  - for each column in the primary key, in order:
  - the percent-encoded form of the column name,
  - a EQUALS SIGN character '=',
  - the percent-encoded lexical form of the canonical RDF literal representation of the column value as defined in R2RML section 10.2 Natural Mapping of SQL Values [R2RML],
  - if it is not the last column in the primary key, a SEMICOLON character ';'
  - If the table has no primary key, the row node is a fresh blank node that is unique to this row.
  
  @param td
  @return