@@ -0,0 +1,1877 @@
+package won.protocol.util;%0A%0Aimport java.net.URI;%0A%0Aimport org.apache.jena.rdf.model.Model;%0Aimport org.apache.jena.rdf.model.ModelFactory;%0Aimport org.apache.jena.riot.Lang;%0Aimport org.apache.jena.riot.RDFDataMgr;%0Aimport org.apache.jena.vocabulary.RDF;%0A%0Apublic class UriChecker %7B%0A    public static void main(String%5B%5D args) %7B%0A        if (args.length != 1) %7B%0A            System.err.println(%22usage: UriChecker %5Buri%5D%22);%0A            System.err.println(%0A                            %22 checks if the specified URI conforms to the URI specification by testing it against java.net.URI%22);%0A            System.exit(1);%0A        %7D%0A        String uri = args%5B0%5D;%0A        System.out.println(%22checking URI '%22 + uri + %22'%22);%0A        URI asURI = URI.create(uri); // throws an exception if it's not a valid URI.%0A        System.out.println(%22valid%22);%0A        System.out.println(%22scheme                : %22 + asURI.getScheme());%0A        System.out.println(%22rawAuthority          : %22 + asURI.getRawAuthority());%0A        System.out.println(%22rawPath               : %22 + asURI.getRawPath());%0A        System.out.println(%22rawQuery              : %22 + asURI.getRawQuery());%0A        System.out.println(%22rawFragment           : %22 + asURI.getRawFragment());%0A        System.out.println(%22rawSchemeSpecificPart : %22 + asURI.getRawSchemeSpecificPart());%0A        System.out.println(%22authority             : %22 + asURI.getAuthority());%0A        System.out.println(%22path         : %22 + asURI.getPath());%0A        System.out.println(%22query        : %22 + asURI.getQuery());%0A        System.out.println(%22fragment     : %22 + asURI.getFragment());%0A        System.out.println(%22making a TTL with it...%22);%0A        Model m = ModelFactory.createDefaultModel();%0A        m.add(m.getResource(uri), RDF.type, m.getResource(%22http://example.com/Test%22));%0A        RDFDataMgr.write(System.out, m, Lang.TTL);%0A        System.out.println(%22done%22);%0A    %7D%0A%7D%0A

Add small program checking if an URI is valid