Example #1
0
 @RequestMapping(
     value = {"/", "/index"},
     method = RequestMethod.GET)
 public String home(Model model) {
   // Two Test Dataset from datehub.io
   InputStream in2005 =
       servletContext.getResourceAsStream("/WEB-INF/content/ibm-publications-2005.rdf");
   InputStream in2006 =
       servletContext.getResourceAsStream("/WEB-INF/content/ibm-publications-2006.rdf");
   try {
     ArrayList<RdfModel> rms2005 = RdfProcess.processRDF(in2005);
     Boolean b = rms2005.addAll(RdfProcess.processRDF(in2006));
     for (int i = 0; i < rms2005.size(); i++)
       jc.execute(
           new Delete.Builder(String.valueOf(i))
               .index("publications")
               .type("publication")
               .build());
     RdfSearch.Indexing(jc, rms2005);
     model.addAttribute("rdfModel", new RdfModel());
   } catch (Exception e) {
     e.printStackTrace();
   }
   return "index";
 }