code: private ImmutableList<TargetAtom> getMappingTripleAtoms(TriplesMap tm) throws Exception {
  		//the body to return
  		ImmutableList.Builder<TargetAtom> bodyBuilder = ImmutableList.builder();
  		
  		//get subject
  		ImmutableTerm subjectAtom = r2rmlParser.getSubjectAtom(tm);
  		
  		//get any class predicates, construct atom Class(subject), add to body
  		List<ImmutableFunctionalTerm> classPredicates = r2rmlParser.getClassPredicates();
  		for (ImmutableFunctionalTerm classPred : classPredicates) {
  			ImmutableTerm predFunction = termFactory.getImmutableUriTemplate(termFactory.getConstantLiteral(RDF.TYPE.toString())); ;
  			bodyBuilder.add(targetAtomFactory.getTripleTargetAtom(subjectAtom, predFunction, classPred));   // objectAtom
  		}		
  
  		for (PredicateObjectMap pom : tm.getPredicateObjectMaps()) {
  			//for each predicate object map
  
  			//predicates that contain a variable are separately treated
  			List<ImmutableFunctionalTerm> bodyURIPredicates = r2rmlParser.getBodyURIPredicates(pom);
  			
  			//get object atom
  			ImmutableTerm objectAtom = r2rmlParser.getObjectAtom(pom);
  			
  			if (objectAtom == null) {
  				// skip, object is a join
  				continue;
  			}
  
  			
  			//treat predicates
  			for (ImmutableFunctionalTerm predFunction : bodyURIPredicates) {
  
  				bodyBuilder.add(targetAtomFactory.getTripleTargetAtom(subjectAtom, predFunction, objectAtom));   // objectAtom
  			}
  		}
  		return bodyBuilder.build();
  	}
docs: Get OBDA mapping body terms from R2RML TriplesMap
  @param tm
  @return
  @throws Exception