code: private void cmdDuplicateMappingActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_duplicateMappingButtonActionPerformed
  		Object[] currentSelection = mappingList.getSelectedValues();
  		if (currentSelection == null) {
  			JOptionPane.showMessageDialog(this, "No mappings have been selected", "ERROR", JOptionPane.ERROR_MESSAGE);
  			return;
  		}
  		int confirm = JOptionPane.showConfirmDialog(
  				this,
  				"This will create copies of the selected mappings. \nNumber of mappings selected = "
  				+ currentSelection.length + "\nContinue? ", 
  				"Copy confirmation", 
  				JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE);
  		
  		if (confirm == JOptionPane.NO_OPTION || confirm == JOptionPane.CANCEL_OPTION || confirm == JOptionPane.CLOSED_OPTION) {
  			return;
  		}
  		OBDAModel controller = apic;
  		URI current_srcuri = selectedSource.getSourceID();
  
  		for (int i = 0; i < currentSelection.length; i++) {
  			SQLPPTriplesMap mapping = (SQLPPTriplesMap) currentSelection[i];
  
  			String id = mapping.getId();
  
  			// Computing the next available ID
  			int new_index = -1;
  			for (int index = 0; index < 999999999; index++) {
  				if (controller.indexOf(current_srcuri, id + "(" + index + ")") == -1) {
  					new_index = index;
  					break;
  				}
  			}
  			String newId = id + "(" + new_index + ")";
  
  			// inserting the new mapping
  			try {
  
  				SQLPPTriplesMap oldmapping = controller.getTriplesMap(id);
  				SQLPPTriplesMap newmapping = new OntopNativeSQLPPTriplesMap(newId, oldmapping.getSourceQuery(),
                          oldmapping.getTargetAtoms());
  				controller.addTriplesMap(current_srcuri, newmapping, false);
  
  			} catch (DuplicateMappingException e) {
  				JOptionPane.showMessageDialog(this, "Duplicate Mapping: " + newId);
  				return;
  			}
  		}
  
  	}
docs: GEN-LAST:event_menuExecuteBodyActionPerformed