code: public static String convertToLevel3(final String biopaxData) {
  		String toReturn = "";
  		
  		try {
  			ByteArrayOutputStream os = new ByteArrayOutputStream();
  			InputStream is = new ByteArrayInputStream(biopaxData.getBytes());
  			SimpleIOHandler io = new SimpleIOHandler();
  			io.mergeDuplicates(true);
  			Model model = io.convertFromOWL(is);
  			if (model.getLevel() != BioPAXLevel.L3) {
  				log.info("Converting to BioPAX Level3... " + model.getXmlBase());
  				model = (new LevelUpgrader()).filter(model);
  				if (model != null) {
  					io.setFactory(model.getLevel().getDefaultFactory());
  					io.convertToOWL(model, os);
  					toReturn = os.toString();
  				}
  			} else {
  				toReturn = biopaxData;
  			}
  		} catch(Exception e) {
  			throw new RuntimeException(
  				"Cannot convert to BioPAX Level3", e);
  		}
  
  		return toReturn;
  	}
docs: Converts BioPAX L1 or L2 RDF/XML string data to BioPAX L3 string.
  
  WARN: this is not for huge (larger than 1GB) BioPAX RDF/XML data
  due to use of (UTF-8) String and Byte Array internally.
  This can be and is used by online web apps, such as the
  BioPAX Validator.
  
  @param biopaxData String
  @return BioPAX Level3 RDF/XML string