package ch.tkuhn.bel2nanopub;

public class Bel2Nanopub {

	public static void main(String[] args) {
		System.out.println( "Hello World!" );
	}

}

@@ -28,116 +28,1056 @@
 b;%0A%0A
-public class Bel2Nanopub %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println( %22Hello World!%22 )
+import java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.io.InputStreamReader;%0A%0Aimport org.openbel.bel.model.BELParseErrorException;%0Aimport org.openbel.framework.common.bel.parser.BELParseResults;%0Aimport org.openbel.framework.common.bel.parser.BELParser;%0A%0Apublic class Bel2Nanopub %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String belDoc = getResourceAsString(%22/examples/pubmed11340296.bel%22);%0A%09%09BELParseResults result = BELParser.parse(belDoc);%0A%09%09for (BELParseErrorException ex : result.getSyntaxErrors()) %7B%0A%09%09%09System.err.println(ex.getMessage());%0A%09%09%7D%0A%09%7D%0A%0A%09private static String getResourceAsString(String resourceName) %7B%0A%09%09try %7B%0A%09%09%09StringBuffer sb = new StringBuffer();%0A%09%09%09InputStream is = Bel2Nanopub.class.getResourceAsStream(resourceName);%0A%09%09%09BufferedReader br = new BufferedReader(new InputStreamReader(is, %22UTF-8%22));%0A%09%09%09for (int c = br.read(); c != -1; c = br.read()) %7B%0A%09%09%09%09sb.append((char) c);%0A%09%09%09%7D%0A%09%09%09return sb.toString();%0A%09%09%7D catch (IOException ex) %7B%0A%09%09%09ex.printStackTrace();%0A%09%09%7D%0A%09%09return null
 ;%0A%09%7D

Read exemplary BEL document (leads to errors...)