Package org.trippi

Examples of org.trippi.TriplestoreReader


                    throws Exception {
        try {
            StringWriter sWriter = new StringWriter();
            PrintWriter sout = new PrintWriter(sWriter);
            sout.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            TriplestoreReader reader = server.getReader();
            String href = enc(requestURI.replaceAll("/$", ""));
            sout.println("<query-service href=\"" + href + "\" context=\"" + enc(getContext(contextPath)) + "\">");
            sout.println("  <alias-map>");
            Map<String, String> map = reader.getAliasMap();
            Iterator<String> iter = map.keySet().iterator();
            while (iter.hasNext()) {
                String name = iter.next();
                String uri = map.get(name);
                sout.println("    <alias name=\"" + name + "\" uri=\"" + enc(uri) + "\"/>");
            }
            sout.println("  </alias-map>");
            sout.println("  <triple-languages>");
            String[] langs = reader.listTripleLanguages();
            for (int i = 0; i < langs.length; i++) {
                sout.println("    <language name=\"" + enc(langs[i]) + "\"/>");
            }
            sout.println("  </triple-languages>");
            langs = reader.listTupleLanguages();
            sout.println("  <tuple-languages>");
            for (int i = 0; i < langs.length; i++) {
                sout.println("    <language name=\"" + enc(langs[i]) + "\"/>");
            }
            sout.println("  </tuple-languages>");
View Full Code Here

TOP

Related Classes of org.trippi.TriplestoreReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.