SparqlPatternRequest { @RequestMapping(method = RequestMethod.GET) public String getClass(@RequestParam(value = "q") final String q) { logger.debug("Requesting Sparql Pattern VIA GET - forbidden"); return "GET forbidden"; }  @RequestMapping(method = RequestMethod.GET) String getClass(@RequestParam(value = "q") final String q); @RequestMapping(method = RequestMethod.POST) String postClass(@RequestBody final String input);  }
@Test public void sparqlPatternRequestTest() { PatternSparqlGenerator sparql = PatternSparqlGenerator.getInstance(); String question = "Who is the spouse of Barack Obama?"; String classAnno = getClass(question); String propertyAnno = postProperty(classAnno); String spotlightAnno = postSpotlight(propertyAnno); List<Document> nifDocs = nif.parseNIF(spotlightAnno); Document nifDoc = nifDocs.get(0); String realAnswer = "SELECT * WHERE{ <http: String answer = sparql.nifToQuery(nifDoc); Assert.assertTrue(realAnswer.equals(answer)); LOG.debug("Final query: " + answer); }